Subject: Re: MAXPARTITIONS (kern/18256)
To: Emmanuel Dreyfus <>
From: David Laight <>
List: tech-kern
Date: 06/16/2003 08:13:19
On Mon, Jun 16, 2003 at 07:25:44AM +0200, Emmanuel Dreyfus wrote:
> Hello everybody
> kern/18256 requests a bump of MAXPARTITIONS to 16 on hpcarm. A quick
> grep shows that rouhgly half of our arch have it definded to 16 and the
> other half have it defined to 8.
> Is there a particular reason why MAXPARTITIONS is not consistent accross
> platforms? This prevents moving a disk from one arch to another.
> I thought about committing the patch supplied in kern/18256, but I
> wonder if the MAXPARTITIONS stuff cannot be made machine independent.

It isn't that simple :-(

What you need to do is separate out the size of disklabel that the
system can support from the size that can be saved on any given disk.
Currently these two numbers are tied hard together.

Unfortunately the d_npartitions field doesn't help!  This gets set to the
number of partitions defined, not to the number of partitions that there
is space to define.

I think it is only possible to do this if the code to write disklabels
is removed from the kernel.  It is much easier to arrange to tell the
disklabel program the type of label you are trying to create/update.
The kernel code can then safely play 'hunt the disklabel' on a given
volume without any danger of it writing it back in an incorrect format.

I'm not sure, but I suspect that only disklabel and mbrlabel (which I'm
near to deprecating) write disklabels (sysinst rund disklabel).


David Laight: