Linux Force Dismount

I recently had some issues getting a drive to dismount in Debian. Then I discovered the fuser -mu tool, and was able to get the job done. This command will list the processes preventing the drive from dismounting, along with the user who spawned said processes. Simply run a kill command against the provided pid(s) and you'll be able to umount it.

$ sudo umount chelsey/
[sudo] password for tlhunter: 
umount: /storage/chelsey: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
tlhunter@titan:/storage$ fuser -mu chelsey/
/storage/chelsey:     2026rce(tlhunter)
tlhunter@titan:/storage$ kill 2026
tlhunter@titan:/storage$ sudo umount chelsey/

Good luck! You can also try the -l switch, which dismounts the drive as soon as its possible.

Tags: #linux
Thomas Hunter II Avatar

Thomas is the author of Advanced Microservices and is a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.