[mdlug] External Hard Drives: Mounting, Unmounting, Partial Mounting?

Ingles, Raymond Raymond.Ingles at compuware.com
Mon Jan 21 14:48:54 EST 2008


> From: Elisa Gomez

> is there a command I can run that will output some
> information about what's currently going on in there
> in a user-friendly format that I will be able to
> mostly understand? ;)

 lsof /media/externaldrive

 (Or whatever the drive is mounted on instead of "/media/externaldrive".)

 It will list all processes that have open files on that device ("lsof" is
short for 'list open files'). E.g., on my machine:

$ lsof /media/lgflash/
COMMAND   PID     USER   FD   TYPE DEVICE  SIZE NODE NAME
bash     5724 sorceror  cwd    DIR   8,97 23040    1 /media/lgflash/
vi      19990 sorceror  cwd    DIR   8,97 23040    1 /media/lgflash/

 ...I've got a shell prompt and a 'vi' running there. If you know the device
itself, you can sometimes get a bit more information that way, for example:

$ lsof /dev/sdg1
COMMAND   PID     USER   FD   TYPE DEVICE  SIZE NODE NAME
bash     5724 sorceror  cwd    DIR   8,97 23040    1 /media/lgflash
vi      19990 sorceror  cwd    DIR   8,97 23040    1 /media/lgflash
vi      19990 sorceror    4u   REG   8,97 16384 7069 /media/lgflash/.bookmarks.html.swp

 Sincerely,

 Ray Ingles                                   (313) 227-2317

  "I like the flag plenty, but I never forget it's only a
 symbol, a reminder of what we stand for, not a replacement
              for actually standing for it."
 - Bill Maher, "When You Ride Alone You Ride With bin Laden"
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.



More information about the mdlug mailing list