UFS2 recovery tool?

Anish Mistry mistry.7 at osu.edu
Wed Jul 20 23:22:44 GMT 2005

On Wednesday 20 July 2005 01:30 pm, Frank Mayhar wrote:
> Due to a series of circumstances involving a RAID controller and an
> unclear user interface and an unfortunate use of "fsck -y", I
> managed to hammer a couple of very large file systems. 
> (Fortunately I had a very recent copy of /home backed up elsewhere,
> or I wouldn't be sending this email.)
> While I could live without the data on those file systems if I
> absolutely had to, I know much of the data is recoverable with the
> right tools.  In fact I found a whole intact subtree using fsdb.
> Unfortunately the root directory was wiped.  While I can recover
> the inode with fsdb, it doesn't allow me to allocate a new (free)
> block for the directory contents.
> What I need is either a way to set up the root directory so I can
> link the subtrees that I find to it, or, alternatively, something
> like ffsrecov that will just pull the subtree off the dead
> filesystem directly, writing it to a _live_ filesystem. 
> Unfortunately, ffsrecov hasn't yet been updated to support UFS2.
> If I have to, I'll write the code myself, but I'm hoping here that
> someone else has done so already.  (At the moment it's hard for me
> to find the time for such relatively complex development that isn't
> directly work-related.)
> So, has anyone done this?  If someone even has code lying around
> that understands UFS2 and can create directories and allocate
> blocks, even if it's not suitable for inclusion in ports, that
> would be wonderful.  Drop me email with a pointer to said code.
> Alternatively, if you have (detailed, low-level) advice as to how
> to write the code, feel free to chime in.  (Please, though, don't
> tell me to look at fsck_ffs, fsdb and sys/ffs/*; that I know
> already and it will be where I start if I end up writing this all
> myself.)
> So here's hoping...
scan_ffs and gpart have saved my butt more than a few times.  
Depending on your situation they may or may not help.

Anish Mistry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050720/a61237f9/attachment.bin

More information about the freebsd-hackers mailing list