Subject: Re: A new partition handling scheme: wedges
To: Ty Sarna <tsarna@endicor.com>
From: David Brownlee <abs@NetBSD.ORG>
List: tech-kern
Date: 02/04/1998 18:21:41
On Wed, 4 Feb 1998, Ty Sarna wrote:

> 0. I was surprised to see this thread die out so quickly.  I hope that
> doesn't indicate a lack of interest. I've been wanting something like
> this for _years_. Further, this particular proposal opens up a way to do
> named partitions reasonably (see below), which I see as being just as
> valuable as cross-platform partition map support, perhaps even more so.
> 
	I dont think anyone can argue with the need for the functionality,
	and I guess those who had any problems with the implementation
	have already voiced them...

> 1. Since this is going to create a fair amount of /dev clutter, I
> suggest putting all the nodes under /dev/dsk.
	[...etc...]

	Seems to make a lot of sense.

> 2.  For partition map types that support named partitions (RDB, for
> one...  do any other NetBSD-supported machines have this concept?), the
> disk name should *not* be a component of the wedgeconfig-generated link. 
> IE, if sd0 is partitioned with RDB's, and has a partition named
> "NetBSD-home", the generated link or node should be
> /dev/dsk/rdb/NetBSD-home, not /dev/dsk/sd0/rdb/NetBSD-home. Why?
> Because then if my fstab says something like:
> 
> /dev/dsk/rdb/NetBSD-home	/home	ffs rw		0 2
> 
> I can take what is now sd0, change it's SCSI ID and move it to a
> different controller, and it'll still mount fine without editing fstab. 
>
> No more worries about nailing down sd unit numbers, etc. Put it where
> you like, and NetBSD will find it. It could even be on removable media,
> and if I have more than one drive, it doesn't matter into which I
> load that disk. In the specific case of the Amiga, it also would make it
> easy to access adosfs filesystems and be sure of getting the right one:
	[...etc...]

	This is a very nice idea, but how do you handle the case where
	you have two or more partitions named the same on different
	disks?

		/dev/dsk/sd0/rdb/NetBSD-home
		/dev/dsk/named/NetBSD-home

	The latter only created when there is a single unique partition
	named 'NetBSD-home'.

	We would presumablky have a matching /dev/rdsk tree for the
	raw devices.

	This still does not handle the case where two partitions on the 
	same disk are named the same, which may be a broken situation,
        but should really be dealt with. Maybe three nodes?

		/dev/dsk/sd0/rdb/a
		/dev/dsk/sd0/rdb/named/NetBSD-home
		/dev/dsk/named/NetBSD-home

	Hmm.. does not feel nice, though I _do_ like the idea of
	naming partitions and being able to move them around...

> 3.  We should invent a new, architecture-neutral, scalable, extensible,
> partition map format that supports named partitions, so that this
> capability can easily be used everywhere.  I'd suggest something close
> in spirit to RDB (linked blocks, flexible placement of root block), but
> with a less platform-specific bent and with some fields expanded to 64
> bits (RDB is limited to a little less than 2TB if my calculations are
> right.  A time when this is too small is not that far away). If this is
> thought a good idea, I'll elaborate further on it. 
> 
	Since we would already have that functionality with rdb maps under
	NetBSD/amiga it certainly sounds good to have it on all ports...

> 4. For those partion map types where names aren't defined, but where we
> can add them in a backward compatible manner, we should do so.
> 
	Which cases would these be - for something like MBR you would have
	to store the information elsewhere, then you have the problem of
	some non netbsd utility changing the MBR...

> 5. The choice of which format to use is still left up to the user. If you
> have a box that's got Linux and NetBSD on it, and you want to share some
> partitions, keep them under MBR, so Linux can easily find them.  If you
> have a NetBSD-only box with lots of disks and a tendancy for things to
> move around a lot, use the new format.  Likewise if you have a large
> RAID array or somesuch, that is larger than MBR can handle (how large a
> disk can an MBR-type scheme span, anyway?), use the new format.
> 
> 6.  Perhaps (even "Probably") the generated name for name-capable
> partition map types shouldn't even include a component specifying what
> type of partition map it was found in.  Maybe just
> "/dev/dsk/NetBSD-home".  Or "/dev/disk/named/NetBSD-home", if you want
> named partitions grouped together. 

	/dev/dsk/NetBSD-home runs into problems when someone names a disk
	'sd0' or similar... (dumb though it may be)
	
		David/absolute

- Anyone who cannot cope with mathematics is not fully human.  At best he
- is a tolerable subhuman who has learned to wear shoes, bathe and not
- make messes in the house.
- 		-- Lazarus Long, "Time Enough for Love"