sabato 18 giugno 2011

Linux - which program is using a device

There has never happened to not be able to unmount a device because of a message tells you some program is using it?
But which program?


The lsof command is what you need. 


For example if I mount a device as /media/disk 
typing lsof /media/disk I obtain the following result:



COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
Thunar  1448 drea   20r   DIR   8,16    32768    1 /
Thunar  1448 drea   21r   DIR   8,16    32768    1 /media/disk


pretty useful information :-)

Nessun commento:

Posta un commento