[ALUG] Recovering deleted files that a process still has open

Chris G cl at isbd.net
Wed Dec 5 11:55:08 GMT 2007


On Wed, Dec 05, 2007 at 11:42:05AM +0000, Mark Rogers wrote:
> I may have found the "solution", and why it won't work in my case....
> 
> See http://www.linux.com/articles/58142 for details, but:
>     sudo lsof | grep deleted
> .. gives a list of files open by processes that have been deleted, or 
> alternatively
>     sudo lsof | grep vmx
> .. gives a list of open .vmx files
> 
> Given that info I could (in theory) work out the file descriptor 
> information and recover the file from /proc (I won't duplicate the above 
> article here).
> 
> However (and it's a big "however"), it turns out that VMWare does not 
> keep the .vmx files open after all, so I appear to have lost it.
> 
> This would have worked had I deleted the vmdk (disk image) files so 
> that's something, I guess. Rebuilding a .vmx file from scratch is a 
> nuisance more than anything else.

I was just going to say that - the .vmx files are just text files in
the style of Windows .ini files.  If you create a new virtual machine
you could copy the .vmx file created, make any obvious changes
required (i.e. point it at the disk image for the one that's lost its
.vmx) and then tune as required.

Or you could even just create a new virtual machine and tell it to use
the existing disk image file(s).

-- 
Chris Green



More information about the main mailing list