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

Re: superblocks and lilo



On Mon, 2002-03-25 at 21:50, Derek James Witt wrote:
> Hey all.
> 
> I'm going through the kernel source for XFS and I'm trying to find out
> how many superblocks a partition usually has and the maximum it's
> allowed to have.  So far in xfs_mount.h, I'm seeing that we are allowed
> two superblocks.  I am proposing that we have two consecutive primary
> superblocks (duplicates) in use. In other words, mirrored blocks. 
> 
> So, if lilo or any other boot loader comes along and overwrites a part
> of the first superblock, the mounting code can still get at the 2nd sb.
> But, the problem is that the size of the superblock I've seen varies
> from 512 bytes to 65535 bytes.  In lilo's sources, we got blocks of size
> 1024 and sector sizes of 512. Any ideas on what to do on this?
> 

Nathan answered some structural details here, but the idea of placing
a second super block after the first will not work, the second 512 bytes
of the filesystem contain another data structure. In fact there are
data structures in the first 2K of disk, then a 2K gap, then regular
metadata can start at 4K.

The only fields in the primary superblock which change are the totals
of free space and inodes used. These can all be reconstructed with xfs
repair.

Thanks for the lilo patch though.

Steve


-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@sgi.com