Re: ext2fs disaster - how to recover some files ?

From: Andreas Dilger (adilger@turbolinux.com)
Date: Wed Oct 25 2000 - 19:41:57 EST


You write:
> Could somebody can tell me where I can read about recovering
> (rather very) damaged e2fs partition ?

There is a tool to recover the whole partition table, gpart, if
your partition table is corrupt. However, it sounds more like
just the filesystem is corrupt.

> First, I've made a copy (dd if=/dev/hda3 of=/copy/hda_3 ...).
> Next, I was tried e2fsck which tell me that there is bad magic...
> and to use -b 8193, etc. I've tried next 6 values (n*8192)+1
> seeking good superblock. Then I've made shorst script to
> scan (sequentially) few thousands of values starting at 32765
> to find valid superblock. (Exactly - its still running up to 2000000).

Since you have a filesystem > 500MB it will default to having 4kB blocks,
and the backup superblocks will be aligned on 32768 block boundaries.
Try "e2fsck -B 4096 -b 32768" (or 98304, 163840, 229376, 81920) to see
if that works. I think I will submit a patch to Ted which offers more
suggestions than 8193 for backup blocks, since not too many people know
where the backups are located on more recent filesystems since they
will normally have 4kB blocks these days.

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:17 EST