How to get around the umount device is busy error.

Sometimes you will try to unmount a disc and get a 'device is busy' error:

# umount /mnt/dvdrw
umount: /mnt/dvdrw: device is busy

I am using /mnt/dvdrw in this example, but the same goes for any disc, like /mnt/cdrom, /dev/hdc, etc.

fuser

You can see what users and processes are accessing disc with the fuser command:

# fuser -u /mnt/dvdrw
/mnt/dvdrw:           8159(bn)  8162(root)

The -k switch should kill the processes, allowing you to umount the disc.

# fuser -k /mnt/dvdrw
/mnt/dvdrw:           8159  8162

lsof

The lsof command can be used to do a similar thing:

# lsof -t /dev/dvdrw
8159
8162

Use of the kill command with this will attempt to kill the processes:

# kill -9 `lsof -t /dev/dvdrw`

umount

By now you should be able to unmount and eject the disc.

# umount /mnt/dvdrw
# eject

Doesn't work?

If the processes have become zombies, then you may not be able to kill them and umount the disc. In this case you can use a lazy umount to detatch the filesystem and umount the disc.

# umount -l /mnt/dvdrw

Last modified: 13/02/2007 Tags: (none)

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top