[3511] in Release_7.7_team

home help back first fref pref prev next nref lref last post

Re: CORRECTION: Odd error from Partition Magic

daemon@ATHENA.MIT.EDU (William Cattey)
Thu Sep 19 01:04:30 2002

Date: Thu, 19 Sep 2002 01:05:27 -0400
Content-Type: text/plain; charset=US-ASCII; format=flowed
Mime-Version: 1.0 (Apple Message framework v482)
Cc: release-team@mit.edu, jmhunt@mit.edu
To: Greg Hudson <ghudson@mit.edu>, dalmeida@mit.edu
From: William Cattey <wdc@MIT.EDU>
In-Reply-To: <200209190417.AAA15418@error-messages.mit.edu>
Message-Id: <69D4A14D-CB8D-11D6-B548-000393995C5C@mit.edu>
Content-Transfer-Encoding: 7bit

I'm adding Danilo to the CC list here, because I think he may be able to 
help us shed light on what is the true and correct way to approach 
partitioning.

Something ghudson said in person, was that the Linux kernel would only 
handle 4 partitions, even in an extended partition, and so the way to 
create many partitions was to have multiple extended partitions.

It may be that the rules governing partition tables changed since the 
1998 edition of my favorite PC reference, _Upgrading_and_Repairing_PC's_ 
by Scott Mueller, but here's what he says about partitioning:

> DOS is designed to support up to 24 partitions on a single hard drive 
> (represented by the letters C: through Z:), but the partition table in 
> the master partition boot sector can have a maximum of only 4 entries.  
> To resolve this discrepancy, the FDISK program enables you to create 
> two types of FAT partitions: a primary DOS partition and an extended 
> DOS partition.  The first FAT partition that you can create on a disk 
> should be the primary, which is listed in the master partition table 
> and appears to the operating system as a single drive letter.
>
> An extended DOS partition is listed in the master partition table like 
> the primary, but it differs that you can use its disk space to create 
> multiple logical partitions, or volumes.  You can create only one 
> extended DOS partition on a single drive, meaning that there will never 
> be more than two entries in the master partition table devoted to FAT 
> drives.
>
> The logical volumes that you can create in the extended DOS partition 
> appear as separate drive letters to the operating system, but they are 
> not listed in the master partition table.  Logical volumes also cannot 
> be active partitions, and are therefore not bootable.  You can create 
> up to 23 volumes out of a single extended DOS partition (assuming you 
> have already created a primary DOS partition, which brings the total to 
> 24).
>
> Each of the logical partitions (or volumes) in an extended DOS 
> partition includes an "extended partition table" that contains 
> information about that volume.  The master partition table's entry for 
> the extended DOS partition contains a reference to the first volume's 
> extended partition table.  This table in turn contains a reference 
> detailing the location of the second volume's table.  This chain 
> continues, linking all the volumes in the extended DOS partition to the 
> master partition table.
>
> Of course, few people have any reason to create 24 FAT partitions on a 
> single disk drive, but the extended DOS partition makes it possible to 
> exceed the four-entry limitation of the master partition table.
>   (pp. 1067-1068)

The Partition Magic documentation speaks of only being able to create a 
SINGLE extended partition on a drive.

I think we're now booting off partitions in extended land, so one aspect 
of the above specification is being disregarded.

But it sounds like the DOS
	Four Primary partitions, any bootable
	And one of the four can be the Extended partition.
	One Extended partition, with up to 23 volumes, none bootable

Has been mis-understood by the Linux folk as:
	Four partitions, any bootable, any can be Extended.
	An Extended partition can contain up to 4 partitions, any bootable, 
any can be Extended.

Perhaps this explains some odd behavior with multi-boot systems????????

I think sfdisk is doing the WRONG thing, and if we want multi-boot 
systems actually to work, we should not be allowing sfdisk to create 
partition table chains that are going to choke Partition Magic.

On Thursday, September 19, 2002, at 12:17 AM, Greg Hudson wrote:

> I think the C/H/S errors are orthogonal to the fatal error, and are
> not important.  I think they simply represent a mostly-harmless bug in
> Bill's version of Partition Magic for the case when a partition's
> starting sector cannot be represented in C/H/S form due to field width
> restrictions.  sfdisk assigns the highest possible C/H/S value in this
> case; I'm not sure if Partition Magic would be happy about anything it
> could possibly see.
>
> I think sfdisk is generating a partition table which looks like:
>
>   1: Windows
>   2: Maint
>   3: Extended --> 1: Swap
>   4: <empty>      2: Extended --> 1: Cache
>                   3: <empty>      2: Extended --> 1: Root
>                   4: <empty>      3: <empty>      2: <empty>
>                                   4: <empty>      3: <empty>
>                                                   4: <empty>
>
> The Linux kernel assigns this partition table device numbers as:
>
>   hda1: Windows Partition
>   hda2: Maintenance Partition
>   hda3: Extended partition
>   hda4: <nothing>
>   hda5: Linux swap partition
>   hda6: Linux cache partition
>   hda7: Linux root partition
>
> I think Bill's version of Partition Magic simply can't handle a
> partition table like this, so it barfs.  I think it's within our
> rights to throw up our hands and say that this is an issue between the
> user and PowerQuest; it is not of critical importance to us that
> Partition Magic works after a Linux-Athena install, as long as it
> works beforehand.
>
> However, this new revelation about sfdisk's behavior (and the kernel's
> behavior) does mean that we'll need to rethink our installer
> partitioning strategy a bit.
>
> ---
>
> For the sake of science, here is the evidence which I have and have
> not procured in favor of the above theory:
>
>   * I verified, by reading /usr/src/linux-*/fs/partitions/msdos.c,
>     that the Linux kernel assigns hda[1-4] to the primary partitions,
>     if they exist, whether they are data partitions or extended
>     partitions; then, for any extended partitions, it assigns
>     sequentially increasing numbers to logical data partitions found
>     within the extended partitions or in nested extended partitions
>     within them.
>
>   * The following expert-mode fdisk output came from a laptop in
>     Bill's possession, which exhibits the Partition Magic errors:
>
>       Disk /dev/hda: 240 heads, 63 sectors, 5168 cylinders
>
>       Nr AF  Hd Sec  Cyl  Hd Sec  Cyl    Start     Size ID
>        1 80   1   1    0 239  63 1023       63 37920897 07
>        2 00 239  63 1023 239  63 1023 75645360  2494800 1c
>        3 00 239  63 1023 239  63 1023 37920960 37724400 05
>        4 00   0   0    0   0   0    0        0        0 00
>        5 00 239  63 1023 239  63 1023        1  1105919 82
>        6 00 239  63 1023 239  63 1023        1   276479 83
>        7 80 239  63 1023 239  63 1023        1 36341999 83
>
>     Note that the LBA "Start" sector is 1 for each of the logical
>     partitions.  Unless sfdisk created overlapping partitions (which I
>     think we would have noticed), that implies that each logical
>     partition lives at the beginning of a distinct extended partition.
>
>   * I looked at sfdisk's source code, but didn't find it immediately
>     easy to understand, so I have not verified that it creates chained
>     extended partitions.
>
>   * I did not examine Bill's laptop's partition table using a tool
>     other than fdisk in expert mode.  However, I can corroborate from
>     my crash and burn machine, which was also partitioned with sfdisk
>     via the IS Linux installer (in "wipe the disk" mode):
>
>       Disk /dev/hda: 255 heads, 63 sectors, 2431 cylinders
>
>       Nr AF  Hd Sec  Cyl  Hd Sec  Cyl    Start     Size ID
>        1 80   0   2    0 254  63    3        1    64259 83
>        2 00   0   1    4 254  63 1023    64260 38989755 05
>        3 00   0   0    0   0   0    0        0        0 00
>        4 00   0   0    0   0   0    0        0        0 00
>        5 00   0   2    4 254  63   69        1  1060289 82
>        6 00   0   2   70 254  63   86        1   273104 83
>        7 00   0   2   87 254  63 1023        1 37656359 83
>
>       Disk /dev/hda: 255 heads, 63 sectors, 2431 cylinders
>       Units = cylinders of 16065 * 512 bytes
>
>          Device Boot    Start       End    Blocks   Id  System
>       /dev/hda1   *         1         4     32129+  83  Linux
>       /dev/hda2             5      2431  19494877+   5  Extended
>       /dev/hda5             5        70    530144+  82  Linux swap
>       /dev/hda6            71        87    136552   83  Linux
>       /dev/hda7            88      2431  18828179+  83  Linux
>
>     Note that the expert-mode listing has the same starting sector for
>     the three logical partitions, but the standard-mode listing shows
>     a different starting cylinder for each.  (This is kind of
>     interesting; it's a case where fdisk's expert mode listing doesn't
>     contain a strict superset of the information in standard mode.)


home help back first fref pref prev next nref lref last post