MacResource
Is it possible to identify files in use? - Printable Version

+- MacResource (https://forums.macresource.com)
+-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1)
+--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3)
+--- Thread: Is it possible to identify files in use? (/showthread.php?tid=21517)

Pages: 1 2


Is it possible to identify files in use? - ka jowct - 10-30-2006

I was trying to run DiskWarrior on a volume and kept getting an error message that the volume couldnt be unmounted because some files were in use. Quitting apps didn't help. Is there a way to identify what files are open on this other volume?


Re: Is it possible to identify files in use? - Donkey Hotay - 10-30-2006

lsof -- list open files by process

Applications->Utilities->Terminal

$ lsof

takes a variety of option switches (which you can see/learn about via

$ man lsof

happy hunting!)


Re: Is it possible to identify files in use? - ka jowct - 10-30-2006

Any quick, easy way? Due to my lousy text entry skills, I avoid Terminal and know nothing about lavigating in a command line mode.

It would be really nice if Disk Warrior could produce a list of the files in use.


Re: Is it possible to identify files in use? - Donkey Hotay - 10-30-2006

"OPTIONS
In the absence of any options, lsof lists all open files belonging to
all active processes.
"

$ lsof
COMMAND . PID . USER . FD . TYPE DEVICE SIZE/OFF NODE . . . . NAME
sshd . . . . 21648 dhotay cwd VDIR 14,2 . . 1428 . . . . 2 . . . . . . /
sshd . . . . 21648 dhotay 0u . VCHR 3,2 . . 0t0 . . . . . 60880004 . /dev/null
...
csh . . .. . 21649 dhotay txt . VREG 14,2 . . 347016 . . 2761. . . . . /bin/tcsh
csh . . .. . 21649 dhotay txt . VREG 14,2 . . 1793424 . 1143496 . . /usr/lib/dyld
csh . . .. . 21649 dhotay txt . VREG 14,2 . . 4398100 . 1143709 . . /usr/lib/libSystem.B.dylib
csh . . .. . 21649 dhotay txt . VREG 14,2 . . 304580 . . 1143863 . . /usr/lib/libncurses.5.4.dylib
...

The last column, under NAME, is the file that is open.
(dots added to try to preserve vertical alignment)


Re: Is it possible to identify files in use? - laarree - 10-30-2006

Did you try just logging out and logging back in and then using Disk Warrior?


Re: Is it possible to identify files in use? - johnc - 10-30-2006

http://sveinbjorn.org/sloth


Re: Is it possible to identify files in use? - ka jowct - 10-30-2006

Did you try just logging out and logging back in and then using Disk Warrior?

Logging out and in; restarting; swearing.

I did actually open Terminal and list open files. Would the volume name appear in the file's path name? Everything in the list appeared to be on the boot drive.


Re: Is it possible to identify files in use? - johnc - 10-30-2006

Are you using a font manager?

Is it possible you've got some open font files on the volume in question?


Re: Is it possible to identify files in use? - Donkey Hotay - 10-30-2006

It sounds like there are files marked as open in the filesystem itself ( in the Finder database, perhaps?). These will not be listed by the 'lsof' command, which looks at a different set of data in the UNIX/MacOSX '/proc' (process data) directory tree.

Sorry, I don't know what would work for Desktop DB or Finder DB . I think an earlier topic mentioned File Buddy(?) as a possible tool.


Re: Is it possible to identify files in use? - johnc - 10-30-2006

Another stab in the dark ... is Spotlight indexing turned off for that volume?