Wednesday, October 12, 2011

Trying to umount: device is busy

You can see that the device is busy, so check out who is using it.

Syntax: fuser [options] |
-c Checks the mounted file system
-k Kills processes using the file system
-m Shows all processes using the file system
-u Displays user IDs
-v Provides verbose output

Try to unmount the file system to see whether it is busy:
# umount /opt/backup
umount: /opt/backup: device is busy.

Check to see what users are currently using the file system:
# fuser -cu /dev/hdc1

You can also use the lsof command for more details. View all open files:
# lsof /dev/hdc1
Note: You can either contact the users or terminate any open connections yourself.

To kill the open connections, you can use the fuser command again:
# fuser -ck /opt/backup

Now you should be able to unmount the file system:
# umount /opt/backup