tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fsck(8) and superblock backups

On Mon, Mar 05, 2012 at 07:16:09PM -0500, Matthew Mondor wrote:
> Hello,
> Does FFS1 contain superblock backups?  I have a broken FS image which I
> have attempted to fix or recover files from, and the corruption is
> located at the beginning.  fsck(8) complains that it cannot find the
> superblock, but I see no scan mode for it to search for a superblock
> backup, either.

There are a lot of copies of the superblock.

My thoughts are that even mount should verify the last one in the fs.
fsck could search/guess the location of a later superblock quite easily
and verify the a reasonable number of the later ones are present.

One reason for doing the verifies is that the subsequent superblocks
are much more likely to have been destroyed if the disk has been
reused for a different fs type.
Checking the last one (and the last physical sector of the fs) is
also a good check against fsck using corrupt data.

I've also sometimes thought that fsck should queue up sector writes
so that it can decide 'this is all horribly wrong' and not have written
to the disk.

Maybe some of this could be a 'summer of code' project...


David Laight:

Home | Main Index | Thread Index | Old Index