Forcefully unmounting a device.

Often when 'chroot'ed into something I accidentally leave something running in the 'chroot' and find myself unable to unmount my devices.

For example. Let's say I have /dev/md0 mounted at /sysroot. I 'chroot' in and start samba. When I exit the 'chroot' and try to umount /dev/md0 I'm presented with a nice little error telling me it failed.

To solve this I can simply 'chroot' back in and stop samba. Or if I don't know what I left running I can use fuser -v -m / while in 'chroot' to find out what processes are using / and then fuser -i -k / to kill them one by one.

If all else fails you can always try a lazy unmount like umount -l /dev/md0. This, however, is a last ditch resort.

forcefully_unmounting_a_device.txt · Last modified: 2011/12/17 14:02 by siigna
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki