force unmount on mac os x 27. Jun 2008

When using Mac OS X you might have encountered this message.

The disk "foobar" is in use and could not be ejected.
Try quitting appplications and try again.

This message may occur even if you have all closed all programs. The guilty party for this behavious may be Leopard’s FSEvents, which sometimes has a lock on a volume. To force the unmount of a volume just open a Terminal and use umount.

sudo umount -f /Volumes/FooBar
 

Kommentare (4)

  1. b. About 1 hour later

    On linux machines it is often the case, that you are in the mounted directory when trying to unmount the device. Therefore you have to leave the directory to unmount the device:

    # mount -o loop foo.iso /mnt
    # cd /mnt/bar
    # umount /mnt
    umount: /mnt: device is busy
    

    The man page tells us: -f Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)

    The -f directive does not work in this case under linux machines. The umount command is still locked. So you have to leave the directory:

    # cd /tmp
    # umount /mnt
    
  2. Stefan About 11 hours later

    This works basically the same way on Mac OS X, but sometimes even changing the directory doesn’t resolve the issue,

    # umount /Volumes/Foobar
    umount: unmount(/Volumes/Foobar): Resource busy
    

    then diskutil comes to the help.

    # diskutil umount /Volumes/Foobar
    Volume Foobar on disk1s10 unmounted
    

Kommentar schreiben

Markdown Syntax