Unmounting a device that is currently “busy”.

Often times working on servers when using external hard drives or some other sort of drive that needs unmounted, you'll sometimes encounter "Device is busy" when trying to unmount it:

[root@p97650 934627]# umount /external/
umount: /external: device is busy
umount: /external: device is busy

In this example, I currently have /dev/sdb1 (external drive) mounted to /external :

[root@p97650 934627]# fuser -m /dev/sdb1
/dev/sdb1:           11686

Now you want to find what process is running that is keeping it busy:

[root@p97650 934627]# ps aux | grep 11686
root     11686 28.1  0.0   5428  1820 ?        Ss   02:20  35:28 /sbin/mount.ntfs /dev/sdb1 /external/ -o rw
root     17934  0.0  0.0   4020   700 pts/0    S+   04:26   0:00 grep 11686

Great, now lets kill that process and unmount the drive:

[root@p97650 934627]# kill -9 11686
[root@p97650 934627]# umount /external 
[root@p97650 934627]# df -h
Filesystem            Size  Used Avail Use% Mounted on
                      225G   59G  155G  28% /
/dev/sda1             244M   15M  216M   7% /boot
tmpfs                1013M     0 1013M   0% /dev/shm
/usr/tmpDSK           2.1G   68M  1.9G   4% /tmp

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *