List Open Files



If you try to unmount a partition and get a message like this:

# umount /media/usbdisk/
umount: /media/usbdisk: device is busy

use the lsof command to find out what programs are using what files:

# lsof /media/usbdisk/
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 6925 root cwd DIR 8,17 4096 1 /media/usbdisk/
xmms 6979 root cwd DIR 8,17 4096 1 /media/usbdisk/

This shows that the programs bash and xmms are using the device. For an even clearer picture, use the device name rather than the mountpoint:

# lsof /dev/sdb1
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 6925 root cwd DIR 8,17 4096 1 /media/usbdisk
xmms 6979 root cwd DIR 8,17 4096 1 /media/usbdisk
xmms 6979 root 8r REG 8,17 2713101 377 /media/usbdisk/a.mp3

You either can wait until those processes exit or terminate them manually.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

4 comments:

madin said...

Copiare i vestiti Moncler sono molto belli e molto temperati.repliche moncler Mi piace molto questo abito Moncler replica. replica moncler donna gilet Il servizio del negozio è molto buono, la qualità dei vestiti è molto buona e il prezzo è molto buono, penso di essere molto economico ed economico.

madin said...

From cool sneakers to warm velvet sandals,Replica ALEXANDER MCQUEEN the new season Alexander McQueen shoes are suitable for replica mens ALEXANDER MCQUEEN shirt dark history and romance. We chose the main style of the season.

madin said...

No name in the watch industry can be compared with Rolex's status. Literally, fake rolex watches is synonymous with quality, and the household name goes beyond the replica Milgauss watchesleading manufacturer of segmented products and replica Oyster Perpetual watches a model of international popular culture.

heavy said...

Replica luxury handbags and watches, free shipping worldwide,the highest quality and lowest price,GUCCI LV DIOR CHANEL PRADA please contact Whats App+8618100140127 website:kelly online shop

https://www.zhongximaoyi.com

Post a Comment

Popular Posts