Subject: Re: > 1T filesystems, disklabels, etc
To: Ignatios Souvatzis <is@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 12/15/2002 14:26:17
On Sun, 15 Dec 2002, Ignatios Souvatzis wrote:

> Hi,
>
> On Sat, Dec 14, 2002 at 11:47:07PM -0800, Bill Studenmund wrote:
> > I think we can get what everyone wants with something more of an
> > intermediate step. Here's its proposal:
>
> Which I won't copy here. However, it is possible in your scheme (and in
> the wedge scheme) to find the same partition twice - what happens then?

Hmmm... Good question.

Well, what do we do now? Yes, you have to go out of your way (entering the
same partition twice in a disklabel for instance) at the moment, but what
do we do?

> Example: a MO medium with mbr + NetBSD label to be usable on a i386 and
> with an RDB structure to be usable on an Amiga. Yes, this is perfectly
> possible.
>
> Now, if the PC doesn't know the RDB scheme, and the Amiga doesn't know the
> PC scheme, all is well - but if they (or one of them) know both, you'll get
> duplication.

The idea is that they will both, with the help of the userland daemon,
know about both.

> Do we want to avoid this? (e.g., if the same partition is offered
> by a later scheme, it is ignored)

No, I don't think we want to avoid this; I think we should, within the
range found by a scheme, list all of the partitions in that scheme.

> Do we want to make avoiding it switchable?
>
> I think we want to avoid (undetected) duplication normally, as access to
> a partition denies other accesses to a partition, at least at some
> securelevels and for some types of accesses.

While I think we shouldn't deny duplicate listing, I FULLY agree we
shouldn't permit the duplicate to get around partition access
restrictions.

We have FS_UNUSED & friends. How about FS_DUPLICATE? We mark subsequent
partitions (or wedges) as FS_DUPLICATE, and we don't permit access to
them.

Note: we don't need different partitioning schemes to hit this problem.
The mbr scheme will hit it all on its own. Most people I know, myself
included, have taken advantage of the fact a netbsd disklabel can reach
outside of the "NetBSD" slice to add NetBSD partitions for Windows and
Linux partitions. So all of those will be duplicates the moment we do
this.

> > c) amigaPart. Grabs like 16 partitions (I think that's an ok #) and fills
> > them in like now.
>
> That's what the current code does anyway, and I think the number is ok, too.
> Note that conceptually, the RDSK block just points to a linked list of
> PART blocks, with no upper limit on the number of partitions (other than
> the number of blocks in the first N blocks of the disk, with N only
> _guaranteed_ to be < the disk size).

Yeah, it's a trade-off. If we grab too many slots, we starve any other
method on the disk. If we grab too few, we stifle that partitioning
scheme.

> > d) sun disklabel (if it is different at this level), grabs 8 partitions
> > and reads from the sun disklabel.
>
> Oh - is this a reference to the duplication problem I mentioned above?

I don't think so. I mainly was thinking we'd need this if the NetBSD-be
code wouldn't find/match the Sun disklabel, then we'd need separate code.

Take care,

Bill