"Failed to delete Core Storage information" during 10.10 imaging

btaitt
Contributor

This is on Casper Imaging 9.65.

After creating a config with a base 10.10.2 DMG (but I also used a custom one made from AutoDMG), a user PKG, and a directory binding, I receive this error (screenshot attached) when attempting to image.

This seems to happen on all my images now.

Interestingly enough, this has been happening on devices that already had 10.10. When I attempt to image devices that have 10.9 or below, it seems they can't mount the volume (attached this message as well).

Is there something wrong with my NetBoot set? Very surprised how this has all fallen apart.

50 REPLIES 50

GabeShack
Valued Contributor II

Mind sharing that one? I'd love to give it a go...

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

mpermann
Valued Contributor II

@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

djwojo
New Contributor III

Anyone have something new to add to this, like JAMF? πŸ™‚

jreinstedler
New Contributor III

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.

Sandy
Valued Contributor II

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.

Eigger
Contributor III

@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!

61b9e9995e00466faa9a59bf669fb935
ef64ca5d6a8b4643a6218a18573e013d

Look
Valued Contributor III

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.

Eigger
Contributor III

@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?

Look
Valued Contributor III

Yes it involves finding and deleting the cs volumes.

Look
Valued Contributor III

@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 #####

Eigger
Contributor III

@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!