A way to recover deleted files (just contents) from USF2

Andrey Smirnov smir at delit.net
Tue Apr 20 06:47:43 PDT 2004

Steve Ames wrote:
> On Tue, Apr 20, 2004 at 05:16:12PM +0400, Andrey Smirnov wrote:
>>I've got ffsrecov to work in several hours of fixing it up to work with 
>>UFS2. But actually it can do nothing with deleted files - their inodes 
>>are all zeroes, excluding uid/gid, which is less important to me....
>>Seems like everything is lost... ;-((((
> Do you trust your patches enough to submit them to the ffsrecov developers
> or to the port-maintainer? Some good should come out of your misfortune :)

They were ugly hacks... Not patches ;-(
It seemed like working, but I can't be 100% sure, and I suppose I don't 
have enough knowledge to make it really correct.
Some of them are fixes like 32bit->64bit and most of them are 
substitutions, when structure names changed with UFS1->UFS2.
Also stat(/dev/ad0s1a) doesn't return valid size (it returns zero), 
after that ffsrecov tries mmaping zero bytes, succeeds and crashes 
afterwards. I changed behaviour to fallback on read(2).
That's all, but I suppose there are more deep problems.

More information about the freebsd-current mailing list