View Single Post
  #8  
Old 03-02-2005, 08:18 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Exclamation Forcing the unmount - an attempt.

Yes -- "erase then copy" erases, then copies.

The transcript you'd change is "BuildTranscript.plist". The specific part is under "shouldEraseTarget", around line 40.

Note to lurkers -- skip this part. It's scary. You don't need to know this stuff to use SD! Nothing to see here. Move along!

What I'd basically do is:

Force the unmount
Remount
Perform the same erase logic with diskutil

Finally, I'd remove the slow erase logic, and replace with a relatively friendly error. So, the appropriate section would look something like (NOTE: UNTESTED, but should be right):

Code:
JNLD=$(diskutil info SDTargetVolumeMount.'Path | grep  -q -F Journaled; echo $?);diskutil force unmount "SDTargetVolume.Device";diskutil mount "SDTargetVolume.Device";diskutil eraseVolume HFS+ SDTargetVolume.'Name SDBootableFlag SDTargetVolumeMount.'Path >&1 2>&1 | grep -q -F "Could not unmount"; if [ "$?" == "0" ]; then echo "Could not erase " SDTargetVolume.'Name "."; exit 2; fi; if [ $JNLD -eq 0 ]; then diskutil enableJournal "SDTargetVolume.Device"; fi
Note that I didn't use hdiutil, because it's documented for use with images, not disks (even though it seemed to work for you).

Hope that's reasonably easy to follow! Let me know if it works.
__________________
--Dave Nanian
Reply With Quote