Subject: Re: Some help with disklabel please?
To: None <>
From: Bill Studenmund <>
List: current-users
Date: 08/09/1995 14:51:56
> On Wed, 9 Aug 1995 11:18:38 +0100 (BST) 
>  David Brownlee <> wrote:
>  > 	I guess its mods to the kernel & disklabel
>  > 	You could define in the kernel config file what disklabel
>  > 	support you wanted.
>  > 
>  > 	options		NETBSD_DISKLABEL
>  > 	options         SUNOS_DISKLABEL
>  > 	options		MACOS_DISKLABEL
> Indeed, it's arguable that all NetBSD ports should support the disklabel 
> format of all other NetBSD ports of at least the same byte order...

I think that all ports should be able to deal w/ all byte-orders. Why?
I think everybody should be able to read DOS disks as they are so
prevelant.  Yes, many people think DOS is evil. Unfortunatly it is
becoming a standard. Also, being able to support variable-endianness
would complicate things. But the ISO CDROM code does this, so we'd
have a working model for int-swapping routines, etc.

>  > 	Maybe a /sys/ufs/disklabels/ directory to hold the code?
> Ummm ... well, given that disklabels are _not_ UFS-specific, this is a 
> less-than-desirable place to put them.  My code lived in 
> sys/kern/subr_disklabel.c.

I'd tend to agree with you on this point. Maybe sys/kern/disklabels or
sys/miscfs/disklabels? Though exactly where is not a big deal, IMHO.

> Also, to touch on a few things that I read before, but deleted the message...
> In this thread there was a procedure posted, about that could happen with 
> a disklael switch system...couple of point to make that could affect that 
> procedure:
> 	* At least in the MI SCSI code, the disklabel is read then the
> 	  device is opened, not when it is probed/matched/attached.

My ignorance shows at this point. When _which_ device is opened? One of the
sdXY's? But don't you need a disktab to see if a device really does
anything? Also, is the timing of when the disklabel gets read critical?
As long as it's after the ability to talk to the drive exists, and before
people want to use the partitions, does it make a difference?

> 	* Not all ports keep the `whole disk' in the `c' partition.

I don't think this will be a problem. The disktab reading routine
can read whatever it needs off of "c" to build a new disktab. It then
closes "c", installs the new disktab, and away it goes. At that point,
the port does whatever it wants.

I see the problem w/ my idea. What I described would have the whole
disk on c on some disks and on d on others. Though couldn't that
be passed as an option; "put the whole disk here, and if this isn't your
normal place, swap  what you'd put here with your normal place".
I.E. most system's would have something in d, and the disk in c. On
a platform that does it different, the something would go into c, and
the whole disk into d.

Why do some ports not keep everything in c?

> 	* Probably others ... maybe I'll dig through the archives today...
> Just random thoughts on this subject...
> Ciao.

Take care,