Casper Imaging 9.72, old school NBI build (no AutoCasperNBI) and Mac Mini 7,1 (running 10.10/14A389 straight outta China) ... could not delete CS using typical imaging/erase hd workflow. I'm going to mess with it a bit to try and establish a pattern.
Curious what OS/builds those having trouble are finding installed (perhaps not relevant)?
edit: CS info deleted on reboot/2nd pass. Meh.
I've seen it before with MAc minis. Open disk Utility and run Verify Disk on the Mac Mini, then try to image it.
We tried to verify the disk,repair the disk, to format it manually, to unmount it and mount it again, we still get the same error.
the error only occurs when in casper imaging on the netboot i check the " format before deployment" box.
@william_rogan can you post the Casper imaging debug log from the AutoCasperNBI when it fails?
Did you tick the rc.netboot option when creating the NBI in AutoCasperNBI?
Lastly, can you unmount the Macs HD when booted into the AutoCasperNBI created NBI?
We use the modified rc.netboot and a 10.10.4 base netboot and Casper Imaging 9.73 and we see this pop up in about 2 out of 10 machines that we are imaging currently. We do have erase target drive selected. We are imaging macbook air 2015s right now with a single partition. If I force quit Casper Imaging and then open disk utility and wipe the drive 1st, then it works fine. Really annoying.
Edit: Now this is happening to each machine. Really very annoying.
Edit2: After checking my netboot system out, I found that my netboot clients folder had over 1500 entries. After clearing this out it seems I may have fixed this issue. Not sure though.
I wonder if the edited rc.netboot file includes a limit on client records that would have caused this.
Gabe Shackney
Princeton Public Schools
I found out that if you reboot after error and run Casper Imaging again, it suceeds!
So I've seen this, and honestly all I've done is opened Disk Utility and erased the drive that way. Usually the first time fails and the second time succeeds. It's been limited Retinas and Airs built before the mid-2015 build.
I've seen this like many others, but I've created a fork of AutoCasperNBI to include a hard drive reformatting script that runs before Casper Imaging. This script nukes the drive and repartitions to a single HFS volume. CasperImaging then takes over and installs our clean image.
So far I have only seen this on new iMacs
@cdev would you mind sharing more information about your fork of AutoCasperNBI and the reformatting script you are using? I'd be interested in your script especially. Thanks.
Still happening to us as well when the machine is first formatted. It wont allow disk utility to unmount the drive the first go around. Then I quit disk utility then it will erase the volume and allow casper imaging to continue.
Gabe Shackney
Princeton Public Schools
I'm having the same issue as @gshackney. Gotta format it twice for it to work properly.
Edit: This is for new computers.
So has anyone found why the netboot is not allowing this to delete properly the first time?
I'd love to fix this at the root of the problem.
Gabe Shackney
Princeton Public Schools
We've had similar issues with new computers that ship with Core Storage volumes. We created a simple formatting script that we run before Casper Imaging launches to destroy the Core Storage volume and create a new one. This has worked well for use so far.
Mind sharing that one? I'd love to give it a go...
Gabe Shackney
Princeton Public Schools
@gshackney the below was created by my colleague @gregwilcox. The script is a python script we call format.command that we simply put on our NBI and put a shortcut in the dock to click on to format the drive. There is some logic and other controls that you may not need. Maybe you can adapt it to use for your purposes. It can probably be done in bash but he's been working with python lately. If you have questions about it you might want to ping @gregwilcox with them. His scripting knowledge is more advanced than mine.
#!/usr/bin/python
import commands, sys
while True:
bash_cmd = "clear"
(status,output) = commands.getstatusoutput(bash_cmd)
print output
# Look for core storage. If found the mount point will be on disk 1.
bash_cmd = "diskutil cs list | grep 'Logical Volume Group'|awk '{print $5}'"
(status,output) = commands.getstatusoutput(bash_cmd)
uuid = output
if uuid == "":
print
print "No CoreStorage Logical volume group found"
print
diskvol_mount = "disk0s2"
else:
print
print "CoreStorage Logical volume group found"
print
bash_cmd = "diskutil cs list | grep ' Disk:'| awk '{print $2}'"
(status,output) = commands.getstatusoutput(bash_cmd)
diskvol_mount = output
bash_cmd = "diskutil info " + diskvol_mount + " | grep 'Mount Point:'"
(status,output) = commands.getstatusoutput(bash_cmd)
output_pos = output.find('/')
output = output[output_pos:]
print "Mount Point: " + diskvol_mount + " " + output
print
print "Looking for user home directories..."
bash_cmd = "ls '" + output + "/Users/'"
(status,output) = commands.getstatusoutput(bash_cmd)
print bash_cmd
print output
print
confirmation = raw_input("type 'f' to format or q to quit: ")
if confirmation == "q":
sys.exit(0)
elif confirmation == "f":
break
# disable core storage if it existed
if uuid != "":
print
print "disabling core storage..."
print
bash_cmd = "diskutil cs delete " + uuid
(status,output) = commands.getstatusoutput(bash_cmd)
print output
# repartition
print
print "formating..."
print
bash_cmd = 'diskutil partitionDisk disk0 GPT JHFS+ "Macintosh HD" 100%'
(status,output) = commands.getstatusoutput(bash_cmd)
print output
print
Anyone have something new to add to this, like JAMF? :)
Having the same issue here myself on machines running everything up through 10.11.3 - In troubleshooting and discovering a disk repair fixed it, I came here and also saw @GaToRAiD's suggestion of a disk repair clearing it up as well. The issue as I've seen it has been somewhat random.
Hi,
Maybe to save others from frustration:
"Failed to delete Core Storage information"
If you see this error, look into your diskless functionality on your Netboot Server. I have 2 netboot servers, and I was thrown off by the intermittent nature of this problem, and when looking further at the client folders on each server, some had shadow files and some did not, on each server... so makes perfect sense that for those not creating a shadow folder on the server they were being created in /private/var on the local HD and thus could not be erased by Casper Imaging.
I used this KB to troubleshoot: https://support.apple.com/en-us/HT203638
Also, once this had happened it was important to remove that directory even after getting your diskless functionality back, as Casper Imaging is not able to remove it with the built in erase.
and I know some use ram disk for diskless function but I have never had reason to.
I am successfully serving up a 10.11.3 netboot image on 2 10.10.5 minis.
@Sandy The above fix on the link you provided didnt work for us. We have 400 brand new MBP and the issue is happening to all of them. We have to reboot once after the error, then the imaging will start successfully. Can anyone be so kind to share a ready made script to nuke the HD before the Casper Imaging takes place? and please teach me how to add it to AutoCasperNBI. We are on 9.92. Imaging 10.11.5, AutoCasperNBI is on latest release and using 10.11.5 as well. PreStage imaging is useless because of this stupid error!
I also just want to share what Apple Changed this year. Apparently, they stopped shipping bulk orders of Laptops in 5 Pack boxes, instead they are boxed individually! How frustrating just unboxing them! Such a waste! Not very environmentally friendly at all!


I will post my script on Monday (no access to it from home).
You can general in just put the format scripts in the imaging workflow and set them to run BEFORE and they work fine, if there are other scripts set to run before name the format so it appears alphabetically at the top (although any other before script is also probably doing pretty fundamental stuff so it may not matter).
The only consideration is that the volume name has to be the name before and after the formatting otherwise Casper Imaging fails to find the new volume.
@Look Thank you Sir! We really appreciate it! I'll wait till then. I'm just curious, does your script involves listing the core storage volume "diskutil cs list" to find the LVG UUID then delete it using "diskutil cs delete UUID"? Or just wiping the Entire Volume?
Yes it involves finding and deleting the cs volumes.
@Eigger
As promised here is our current script, just a few things to note.
- Very destructive, ALL partitions on ALL drives will be wiped!
- Intended to be run as part of Casper Imaging as Before script.
- The target drive must Start as Macintosh HD as this is what it will finish with and Casper Imaging will fail if this is not the case.
- If your only after OS X partitions you can probably simply use as is, however if you want Windows as well see below.
- If you give it an argument of 25 to 75 it will set aside that percentage for Windows, however it will also modify the MBR data so it is an EFI intended volume and place a FORMAT_C.BAT file for converting to NTFS, so comment out the call to the function Set_EFI_Windows if you don't want this, this was really for our internal use with SCCM boot media.
- If there is an SSD and an HDD it will create a fusion drive of them.
- If you have a fusion drive and a Windows partition it will create a funny little NONE partition, also really for our internal use.
#!/bin/bash
#Sam Look November 2015, all care and no responsibility, this sucker will blitz everything so watch out
##### SUBROUTINES START HERE #####
Get_First_HDD(){
echo Starting search for HDD
for The_Disk in $(diskutil list | awk '/internal/ && /physical/ {print $1}'); do
echo Checking $The_Disk
if [[ ! "$The_HDD" ]] && [[ "$(diskutil info $The_Disk | awk '/Solid State/ && /No/')" ]]; then
The_HDD=$The_Disk
echo HDD found at $The_HDD
break
fi
done
}
#####
Get_First_SSD(){
echo Starting search for SSD
for The_Disk in $(diskutil list | awk '/internal/ && /physical/ {print $1}'); do
echo Checking $The_Disk
if [[ ! "$The_SSD" ]] && [[ "$(diskutil info $The_Disk | awk '/Solid State/ && /Yes/')" ]]; then
The_SSD=$The_Disk
echo SSD found at $The_SSD
break
fi
done
}
#####
Remove_Existing_CS(){
CS_Group=$(diskutil cs list | awk '/-- Logical Volume Group / {print $NF}')
if [[ "$CS_Group" ]]; then
echo "Removing CS group detected at $CS_Group"
diskutil cs delete $CS_Group
sleep 2
else
echo "No CS group detected"
fi
CS_Group=$(diskutil cs list | awk '/-- Logical Volume Group / {print $NF}')
}
#####
External_Boot(){
if [[ "$(diskutil info / | awk '/Device Location/ && /Internal/')" ]]; then
return 1
else
return 0
fi
}
#####
Set_EFI_Windows(){
Windows_Disk=$(diskutil list | awk '/Microsoft Basic Data/ && /WINDOWS/ {print $NF}'| head -n 1 | cut -c 1-5)
echo $(echo $Windows_Disk)
if [[ "$Windows_Disk" ]] && [[ ! "$(fdisk /dev/$Windows_Disk | awk '/4: 00 /')" ]]; then
echo "Windows drive with MBR boot detected checking for data"
if [[ ! "$(ls -1 /Volumes/WINDOWS | awk '!/^[.]/ && !/FORMATC/ && !/SMST/')" ]]; then
echo "No data detected setting to EFI boot"
(echo setpid "2"; echo "0"; echo "quit"; echo "y";) | fdisk -e /dev/$Windows_Disk
(echo setpid "3"; echo "0"; echo "quit"; echo "y";) | fdisk -e /dev/$Windows_Disk
(echo setpid "4"; echo "0"; echo "quit"; echo "y";) | fdisk -e /dev/$Windows_Disk
echo 'FORMAT C: /FS:NTFS /Q /V:WINDOWS /y' > /Volumes/WINDOWS/FORMATC.BAT
chmod 777 /Volumes/WINDOWS/FORMATC.BAT
else
echo "Aborting because data detected on Windows"
fi
else
echo "No elligible drive detected"
fi
}
#####
Create_New_Fusion(){
if [[ $Windows_Size -gt 0 ]];then
Mac_Size=$((100 - Windows_Size))
diskutil partitionDisk $The_HDD 2 GPTFormat jhfs+ "HDD Fusion" ${Mac_Size}% fat32 "WINDOWS" R
diskutil partitionDisk $The_SSD 2 GPTFormat jhfs+ "SSD Fusion" 99% fat32 "NONE" R
sleep 2
diskutil cs create fusion $(diskutil list | awk '/SSD Fusion/ {print $NF}') $(diskutil list | awk '/HDD Fusion/ {print $NF}')
sleep 2
Set_EFI_Windows
else
diskutil partitionDisk $The_HDD 1 GPTFormat jhfs+ "HDD Fusion" 0
diskutil partitionDisk $The_SSD 1 GPTFormat jhfs+ "SSD Fusion" 0
sleep 2
diskutil cs create fusion $The_SSD $The_HDD
fi
sleep 2
CS_Group=$(diskutil cs list | awk '/-- Logical Volume Group / {print $NF}')
sleep 2
diskutil cs createVolume $CS_Group jhfs+ "Macintosh HD" 0
}
#####
Get_Windows_Size(){
if [[ $Passed_Size -gt 20 ]] && [[ $Passed_Size -lt 80 ]]; then
echo Valid Windows partition size given as $Passed_Size
Windows_Size=$Passed_Size
else
echo No windows size given
fi
}
#####
Single_Disk_Partition(){
if [[ $Windows_Size -gt 0 ]];then
Mac_Size=$((100 - Windows_Size))
diskutil partitionDisk $Single_Disk 2 GPTFormat jhfs+ "Macintosh HD" ${Mac_Size}% fat32 "WINDOWS" R
Set_EFI_Windows
else
diskutil partitionDisk $Single_Disk 1 GPTFormat jhfs+ "Macintosh HD" 0
fi
}
##### MAIN PROGRAM STARTS HERE #####
if External_Boot; then
Get_First_HDD
Get_First_SSD
Passed_Size=$(echo $4 | tr -cd [:digit:])
Get_Windows_Size
if [[ "$The_SSD" ]] || [[ "$The_HDD" ]]; then
Remove_Existing_CS
fi
if [[ "$The_SSD" ]] && [[ "$The_HDD" ]]; then
echo "Drives required for fusion detected"
if [[ ! "$CS_Group" ]]; then
Create_New_Fusion
else
echo "Cannot create fusion as previous CS group cannot be removed"
fi
elif [[ "$The_SSD" ]]; then
Single_Disk=$The_SSD
Single_Disk_Partition
elif [[ "$The_HDD" ]]; then
Single_Disk=$The_HDD
Single_Disk_Partition
fi
else
echo "This script cannot be run while booted off the internal drive"
fi
##### FIN #####
@Look Thank you Sir! Hope you had a good Memorial Day Weekend! Will try this tomorrow and report back to you! Have a good one!