Monday, December 4, 2006

Find Out Why You Can't Unmount a Partition

Linux Server Hacks, Volume Two
Hack 92. Find Out Why You Can't Unmount a Partition

If you can't unmount a disk because it's busy, you can use the lsof and fuser commands to find open files or pesky attached processes.

$ fuser -m /mnt/music
$ ps alxww | grep 29846

By default, the fuser command returns all active processes

$ sudo fuser -am /dev/mapper/data-music

If you're really in a hurry, you can also specify the fuser command's –k option

$ lsof /mnt/music

$ sudo lsof /mnt/music # more complete view

No comments:

Digg / Technology

Blog Archive