Wednesday, March 27, 2013

Attempting to use dd on Mac OSX? Resource Busy?

If you're trying to use the dd command to image a usb disk or another device and you're running into an error that looks like:

# dd: /dev/disk#: Resource busy

There is a simple solution.

Use OSX's Disk Utility and unmount any of the partitions you have mounted on that particular disk without unmounting or ejecting the disk itself.

Afterwards, attempt the dd command again.

Update:  

Attempting to use the umount utility in Mac OSX will result in a "Resource busy -- try 'diskutil unmount'".  The command-line equivalent would be:

# sudo diskutil unmount /Volumes/<disk in question>

E.g.  

# sudo diskutil unmount /Volumes/FLASHUSB

4 comments:

  1. Another solution:
    1. open Terminal.app
    2. type df -h and find the mountpoint of the usb drive
    3. umount "mountpoint" (like: umount /Volumes/Untitled)
    4. try your dd-command again :)

    ReplyDelete
    Replies
    1. I almost forgot, you have to use sudo for these commands to work.

      Delete
    2. Thanks for your comment. I updated the post; umount isn't reliable (as shown in the update). The diskutil command is the preferred method on Mac OSX.

      Delete