hdiutil create srcdevice fails to create image
I want to create a disk image of a Mac drive (.dmg file).
I used:
hdiutil create -srcdevice /dev/disk1 /Volumes/HITACHI/MacHD_20120201.dmg
I figured that it might not be a good idea to try and image a live disk, so I unmounted it (the user dragged the disk icon to the eject icon), and I confirmed it was unmounted by looking at /Volumes. To be clear here, this isn't the boot volume, that is /dev/disk0.
/dev/disk1 is an internal drive - as it happens it's the original drive for this OSX 10.4 G5, AND /Volumes/HITACHI is the mount point for an external USB drive.
I have tried this twice.
On both occassions, things seemed to go well, but after a few minutes (about 10 - 20 minutes), I observed that the target file on /Volumes/HITACHI stopped growing, then a bunch of unpleasant stuff started to happen:
* I did lsof /Volumes/HITACHI/MacHD_20120201.dmg and found the PID of the diskimage binary, ps waux showed it was doing nothing (CPU% was 0.0). This indicates a stuck process to me.
* The hdutil command stopped producing '.'
* I could not cancel the hduitl command
* I could not rm the MacHD_20120201.dmg file
* I could not ls the /Volumes/HITACHI directory
* unlink also hung
A little further into this, the Mac became unresponsive. I observed that the disk was now mounted again (grrr!). As a work around I switched the USB drive off and on, and Mac came good - all my terminals started to respond, the GUI responded for the user.
Before you ask, I did an fsck on this drive last night with no errors.
My workaround has been to use CCC to make a clone of the disk - but I don't like this because I think .dmg files are much more convenient (for a start, now that I've used CCC I can't use the USB drive for anything else).
You have to appreciate that I don't want to disturb the user by trying endless combinations of hdiutil, or distracting them while I'm playing with disk utility.
My questions:
* Is my methodology wrong? Do I really need to umount the /dev/disk1
* Can you disable finder from automounting an internal hard drive (I am particularly interested in this)
TIA,
Andrew
PS: CCC seems to be progressing well, so this eliminates a hardware problem.
Mac Pro, Mac OS X (10.4.11)