Skip to main content
Question

Secure Drive Erase before Imaging

  • September 18, 2013
  • 4 replies
  • 18 views

Forum|alt.badge.img+18

Has anyone implemented this? Not a full DoD wipe, just zeroing the drive before dropping an image. I assume I can run a script before the block copy of the DMG and prompt the tech to select the drive then run a secure erase.

While on the topic, am I missing something regarding re-imaging FV2-encrypted drives? Right now we manually have to destroy the Logical Volume Group before launching Casper Imaging.

4 replies

RobertHammen
Forum|alt.badge.img+29
  • Esteemed Contributor
  • September 18, 2013

I would possibly create an Automator app to run the script for you (done this before to work around issues with volumes not properly partitioned).

I have the same experience with having to destroy the logical volume group via Terminal commands before imaging...


Forum|alt.badge.img+24
  • Valued Contributor
  • September 19, 2013

Man diskutil


Forum|alt.badge.img+16
  • Honored Contributor
  • September 19, 2013

I use a csh script saved as a .command for our onsite to run. I also remove the machine from the JSS at the same time..

This works for me, but I am sure I am not doing 100% "right"

#!/bin/csh

# getting core storage family name
set LVG=`diskutil cs info disk0s2|grep LVG |awk '{ print $4; }'`

#echo "$LVG"

# deleting core storage volume 
diskutil cs delete $LVG

# partitioning drive
diskutil partitionDisk disk0 GPT JHFS+ Macintosh HD 100%

# getting UUID
set UUID=`ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, """); printf("%s
", line[4]); }'`

# deleting computer from casper with UUID
curl -k -v -u username:password https://myjssV9:8443/JSSResource/computers/udid/$UUID -X DELETE

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • September 19, 2013

In my experience at least, there's no need to remove the CoreStorage Logical Volume before reformatting the volume.

We run a script very similar to your partition drive line. It looks like this-

diskutil partitionDisk disk0 GPT JHFS+ "Macintosh HD" R

And we've never had an issue. Once its flattened that way, we can let the imaging process partition the drive again and lay down the Recovery HD and base OS.
I should note however that we use DeployStudio, not Casper Imaging, so I don't know if that makes a difference. I can't see why though.