Subject: Re: partition types...
To: Andrew Brown <twofsonet@graffiti.com>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: port-i386
Date: 02/09/1999 10:58:42
On Tue, Feb 09, 1999 at 11:41:30AM -0500, Andrew Brown wrote:
> >  I heard that you could have more than 4 partitions in an
> >extended partition.  It appears that each extended partition can
> >hold one partition, and a chain to another extended partition.
> 
> i'm not sure about that, since the extended partition table is (i
> thought) laid out more or less exactly the same way as the main
> partition table.

  According to the docs I saw, an extended partition is allowed
to have only two entries in the four slots in the partition
table:  one for a logical partition, and one for a chained
extended partition.  The rest of the EMBR (extended MBR) is unused.

  I think Linux fdisk can grok extended partitions, so a peek
there (if you can manage to find the source code!) might be
helpful.  I'll try to dig up the code sometime in the next few
days (I'm leaving for a 2-day conference tonight).

> however...if we are allowed to have extended partitions within
> extended partitions, there ought to be no limit except for (a) disk
> space or (b) insanity.

  I think by default, each extended partition will cost you one
cylinder, or at least one head (63 sectors), since that's the
default BIOS way.  But under NetBSD, I'm sure we could just use
one sector for the partition table, and start the next
partition in the next sector.

  I'm also not sure of exactly how the extended partitions are
handled.  Do they need to be nested (first extended covers rest
of disk, next extended covers only part of that, etc.)?  Or can
they just be arbitrarily linked?  If they are nested, then it
means that disk tools can tell how much of the disk is used by
simply looking at the extents of the four partitions in the MBR,
without even knowing how to grok extended partitions.

  Brian