When force umount doesn’t even work

DISCLAIMER: 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.


Imprint

This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at weblog2017@rubenschade.com. Thanks :).