Subject: Re: Increased nr of partitions ?
To: Rakhesh Sasidharan <rakhesh@cse.iitd.ernet.in>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-help
Date: 09/03/2000 17:44:34
On Sun, Sep 03, 2000 at 05:58:15PM +0530, Rakhesh Sasidharan wrote:
> 
> Why is NetBSD limited to just 8 partitions (a-h) for the whole disk ?  I
> had asked this question once, but I got a reply that if that was to be
> changed, then the different disklabels would be incompatible.

There's more issues than the disklabel, there's also the devices minor
numbers (and that's the bigger problem):
with 8 partitons, wd0a has minor 0, wd0h minor 7 and wd1a minor 8
(see the DISKUNIT, DISKPART and DISKMINOR macros). With 16 partitons,
miror 8 becomes wd0i and wd1a has minor 16. So we comes to the point where
wd1a can be called wd0h, when you're kernel and /dev are not in sync.
The point is that there is a moment where they will necesserally be out
of sync, and very bad things can happen. 
This can be dealt with with a carefull upgrade procedure. The other issue
is that, with modern disk, 16 isn't enouth anyway. We are looking for a
better, more general and flexible sheme for this.

Now, you can convert you system to 16 partitions per disk: just change
MAXPARTITIONS to 16 in sys/arch/i386/include/disklabel.h, then rebuild
a kernel and userland, then change /dev/MAKEDEV to create
the [i-p] devices. If you have only wd0 or sd0 disks this is not a problem,
if you have wdx or sdx with x >= 1 then you'll have to be very carefull and
understand what's you're doing.
> 
> But then, I saw that OpenBSD has 16 partitions, and things still seem to
> work smooth.  Could anybody elaborate as to what the issues would be if 16
> partitions were allowed.

OpenBSD (which is younger than NetBSD)  started with 16 partition, so they
didn't have to deal with compatibilities issues. Also note that some of the
newer NetBSD ports have 16 partitions too.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--