[3510] 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 (Greg Hudson)
Thu Sep 19 00:17:39 2002

Date: Thu, 19 Sep 2002 00:17:36 -0400
Message-Id: <200209190417.AAA15418@error-messages.mit.edu>
From: Greg Hudson <ghudson@MIT.EDU>
To: Bill Cattey <wdc@MIT.EDU>
CC: release-team@MIT.EDU, jmhunt@MIT.EDU
In-reply-to: <1030737304.13324.23.camel@tokata.mit.edu>

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