When force umount doesn’t even work
SoftwareDISCLAIMER: Your Linux box won’t normally prevent you unmounting something without a reason. Run these commands at your own risk… to data integrity.
If you’re attempting to unmount a volume (such as /mnt), and it refuses…
# umount /mnt ==> umount: /mnt: device is busy. ==> (In some cases useful info about processes that use ==> the device is found by lsof(8) or fuser(1))
…there’s a chance a process is still accessing it. You can use lsof to see:
bash 14115 root cwd DIR 202,16 4096 2 /mnt
Great, in this case the only thing using it is our shell, and we’re not even in the directory. In that case, time to force:
# umount -f /mnt ==> umount2: Device or resource busy ==> umount: /mnt: device is busy. ==> (In some cases useful info about processes that use ==> the device is found by lsof(8) or fuser(1)) ==> umount2: Device or resource busy
For more persistent errors, its time to kill the process using it with fsuer
.
# fuser -km /mnt ==> /mnt: 14115c # umount /mnt
Then the volume should unmount. Now would also be a good time to re–read the disclaimer at the beginning of this post.