Subject: Re: newfs: determining file system parameters
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 10/20/2003 19:12:54
> You're assuming you can find the superblock. The information is in the 
> disklabel specifically in case the primary superblock is damaged, so that 
> you can figure out where to find the secondary superblocks. I think I've 
> only needed this once or twice. But in those cases, I've needed it.

The first alternative is easy to find - there aren't that many possible
locations.  What the code should do is check that the info in it lets
you find the others - and that they match (or at least most of them
almost match).

Finding the 2nd alternative only requires that about 50MB of disk be scanned
(with 1k fragments) - that isn't actually excessive.
In fact you can just scan the disk looking for valid superblocks.
(Or run the correct version of newfs -N to see where it would have put them.)

At the moment newfs defaults to the block/fragment sizes from the disklabel
(in spite of suggestions in the man page that the defaults depend on the
file system size), and also tries to save the values it used into the label.

Oh, how do you intend to squeeze 64bit offset and size into the 16byte
disklabel entry?

	David

-- 
David Laight: david@l8s.co.uk