Home > Bash, Linux > Find the process using a mounted device

Find the process using a mounted device

If you’re trying to unmount a device (USB-drive or similar) and you’re getting the error “device is busy”, try the following:

[root@server]# umount /dev/sdm1
umount: /mnt/disken: device is busy
[root@server]# fuser -m /dev/sdm1
/dev/sdm1:           22121c
[root@server]# ps auxw|grep 22121
root     22121  0.0  0.2  4264 1304 pts/0    S    08:38   0:00 -bash
root      1696  0.0  0.1  3684  556 pts/0    R    10:26   0:00 grep 22121
[root@server]#

In this case it’s the ‘bash’ process that’s holding the device. Quit the PuTTY session, reconnect and umount the device!

Categories: Bash, Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.