Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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)

Posted on Feb 1, 2012 5:44 AM

Reply
3 replies

Feb 1, 2012 6:40 AM in response to aircha

This doesn't look good:


Feb 1 14:36:10 CW-g5-01 kernel[0]: USBF: 61952.168 AppleUSBEHCI[0x1cd2800]::Found a transaction which hasn't moved in 5 seconds on bus 75, timing out!
Feb 1 14:36:17 CW-g5-01 kernel[0]: USBF: 61959.168 AppleUSBEHCI[0x1cd2800]::Found a transaction which hasn't moved in 5 seconds on bus 75, timing out!
Feb 1 14:36:23 CW-g5-01 kernel[0]: USBF: 61965.168 AppleUSBEHCI[0x1cd2800]::Found a transaction which hasn't moved in 5 seconds on bus 75, timing out!


This is with CCC - so it does look like a hardware (USB) problem after all.

Feb 1, 2012 6:57 AM in response to aircha

Why don't you try creating the .dmg with that disk mounted? After all, you can create .dmg files from entire folders on disks that aremounted and in use, so I'd think the same logic applies to the entire disk. The only difference is that you won't actually be using this external disk you're trying to image.


Also, is therre some reason you're trying to do this, rather than use SuperDuper or Carbon Copy Cloner to clone the disk? That would seem to be easier, and the results would be bootable.

Feb 1, 2012 12:22 PM in response to kurt188

Fair points.


As it happens I don't care if the result is bootable or not. It's a safety guard because I'm about to wipe out the source disk, it's the files, documents and settings files I want to preserve - the source disk is so corrupt it won't boot anyway.


I wanted to do this as I can start and monitor this more easily remotely while the user is doing something else. It's also useful sometimes to know how to do something if I don't have access to something like CCC.


For the most part CCC is a file copy, while 'hdiutil create' is a block copy, and I tend to trust block copies more.


As it happens I've made some unusual progress in the last hour anyway, and I've changed my mind. I've decided that transferring large files over USB isn't a very sane thing to do anyway, and have used CCC to do a couple of backups. I was getting the same problems as above.


Using a different external drive, CCC has just run very sweetly for 160GB. On the original USB external drive, I've changed the power supply and USB cable, and so far (for 28 minutes) it has run fine. With the other, cheaper looking, black cable CCC didn't run for more than about 3 minutes without stalling. I've done a tail -f /var/log/system.log and seen no USB errors so far. How odd.


The other thing I've learned is that unmount using the disk utility seems to keep the volume unmounted - in itself very useful to know.


I've never come across such sensitivty in the choice of cables before!


Thanks for your response.

hdiutil create srcdevice fails to create image

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.