Well, yes and no. Most versions of e2fsck (i.e. every version in existence
unless you have a very recent copy from Ted's BitKeeper repository) will
try possible block sizes, but will not try different block numbers.
> Why isn't e2fsck smart enought to look for then? Is this an intended purpose?
Well, in the most recent versions, it will try a lot harder to try and find
backup superblocks. It will still not run e2fsck automatically on the device.
There are many reasons why e2fsck may think the superblock is corrupted, but
in fact it isn't:
1) superblock has a new feature which an old e2fsck doesn't understand
2) filesystem is no longer ext2, but may still have the backup superblock
(e.g. you mkswap on an old ext2 partition, it leaves the old superblock)
> Why do you use the -B option ? How can it be useful to force the block size?
> Especially if this one is different.
Well, since it is possible to have multiple block sizes for ext2, if you
specify "-b 32768" (i.e. block 32768) for the superblock backup, how does
it know what the blocksize is if you don't tell it that also*. The old
error message (try -b 8193) assumes that you have a 1kB blocksize. All
ext2 filesystems larger than 500MB made in the last couple of years really
have 4kB blocksize** so e2fsck is far more likely to find a superblock
backup at 4kB * 32768 than at 1kB * 32768 (especially since there will
never be a backup at 1kB * 32768, but rather 1kB * 32769, and only on
_really_old_ non-sparse ext2 filesystems).
Cheers, Andreas
*) OK, that is a bit of a lie, e2fsck appears to check all valid blocksizes
when a block number is given, but since one can assume it is a 4kB
block size, you may as well specify it.
**) 4kB blocks provide _much_ better performance than 1kB blocks, even if
they waste more space, and also allow for larger filesystems.
-- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/