Subject: Re: newfs: determining file system parameters
To: Ted Unangst <tedu@zeitbombe.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/20/2003 10:03:30
--i0/AhcQY5QxfSsSZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sat, Oct 18, 2003 at 02:55:29AM -0400, Ted Unangst wrote:
> On Fri, 17 Oct 2003, Bill Studenmund wrote:
>=20
> > > one possible concern is that this approach is very ffs-centric.
> >=20
> > How so? i.e. who has this as a concern?
>=20
> let me elaborate. personally, i think fs parameters should be entirely=
=20
> separate from the partition.
Ahhh...
> > The purpose of the ioctl is so that newfs and all the other file system=
=20
> > generators don't have to bother with a disklabel. They just know they h=
ave=20
> > a partition, and get/set info about it.
>=20
> there are only two pieces of information that i think matter at the=20
> partition level. size and fs type. size because it's an inherent=20
> property of the partition, independent of fs. type because it saves the=
=20
> trouble of iterating around looking for magic numbers (and no false=20
> matches).
>=20
> anything else belongs in the file system itself (superblock). if a fs=20
> exists, the superblock is obviously the definitive record and the=20
> "outside" information doesn't matter. if no fs exists yet, the fs=20
> generator should be able to guess/generate/ask for sane values.
>=20
> you've convinced me you will need an ioctl to get/set all this extra info=
. =20
> you haven't convinced me this info should be stored outside the fs. :)
> for the record, i don't think this info belongs in the disklabel either. =
=20
> i think a better location for it all would be something like /etc/fstab=
=20
> (/etc/partitions perhaps) if you think it's important.
You're assuming you can find the superblock. The information is in the=20
disklabel specifically in case the primary superblock is damaged, so that=
=20
you can figure out where to find the secondary superblocks. I think I've=20
only needed this once or twice. But in those cases, I've needed it.
/etc/partitions is bad for two reasons. First, how do you use it to fix=20
the root file system? Second, disks can move around. How do you ensure=20
that the /etc/partitions info for a disk move with it?
Take care,
Bill
--i0/AhcQY5QxfSsSZ
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQE/lBViWz+3JHUci9cRAhxAAJsFKzzv2Rhth+cPga8AKu618Nln8ACeIWIc
xmZFfN/8q1mKmIo64A8Okt0=
=luCj
-----END PGP SIGNATURE-----
--i0/AhcQY5QxfSsSZ--