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
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:
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:
This works basically the same way on Mac OS X, but sometimes even changing the directory doesn’t resolve the issue,
then
diskutilcomes to the help.