Package: util-linux
Version: 2.12p-4sarge1

Looks like it is time for another Mad System Administrator bug(s):

The display of varying disk slice types is inconsistant. From what I can
tell, it appears that the unit display of MSDOS partitions reports end
sector-1, rather than end sector. In cylinder display mode start cylinder
reporting is off by one.

Attached are two mostly equivalent sectors. One is using a Sun disk label
the other is an MS-DOS partition table. Both have two actual disk slices
that line up, `fdisk -l` of these report differing numbers:


Disk /dev/hd# (Sun disk label): 16 heads, 63 sectors, 19374 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/hd#2  u      17436     19374    976752   82  Linux swap
/dev/hd#3  u          0     19374   9764496    5  Whole disk
/dev/hd#8             0     17436   8787744   83  Linux native

Disk /dev/hd# (Sun disk label): 16 heads, 63 sectors, 19374 cylinders
Units = sectors of 1 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/hd#2  u   17575488  19528992    976752   82  Linux swap
/dev/hd#3  u          0  19528992   9764496    5  Whole disk
/dev/hd#8             0  17575488   8787744   83  Linux native

Disk /dev/hd#: 10.2 GB, 10245537792 bytes
16 heads, 63 sectors/track, 19852 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hd#2           17437       19374      976752   82  Linux swap / Solaris
/dev/hd#4   *           1       17436     8787744   83  Linux

Partition table entries are not in disk order

Disk /dev/hd#: 10.2 GB, 10245537792 bytes
16 heads, 63 sectors/track, 19852 cylinders, total 20010816 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hd#2        17575488    19528991      976752   82  Linux swap / Solaris
/dev/hd#4   *           0    17575487     8787744   83  Linux

Partition table entries are not in disk order


I'm sure they line up, because I confirmed that the second was mountable
using either table and the first was usable as swap. I must argue that
the end sector listing from the MSDOS-style is wrong because the end
number is what the Sun-style actually contains, and the block count is
correct in both cases. I'd also argue cynlinders start from zero so the
start cylinder reporting is one too high for MSDOS-style.

Also it was impossible to create the MSDOS-style table inside `fdisk`,
some creativity was required. Though changing between the styles is not a
common event, both were quite serious problems for doing the conversion.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [EMAIL PROTECTED] PGP 8881EF59         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
    \___\_|_/82 04 A1 3C C7 B1 37 2A*E3 6E 84 DA 97 4C 40 E6\_|_/___/


Attachment: sun.raw
Description: Binary data

Attachment: dos.raw
Description: Binary data

Disk /dev/hd# (Sun disk label): 16 heads, 63 sectors, 19374 cylinders
Units = cylinders of 1008 * 512 bytes

         Device Flag    Start       End    Blocks   Id  System
/boot/boot.hdb2  u      17436     19374    976752   82  Linux swap
/boot/boot.hdb3  u          0     19374   9764496    5  Whole disk
/boot/boot.hdb8             0     17436   8787744   83  Linux native
Disk /dev/hd#: 10.2 GB, 10245537792 bytes
16 heads, 63 sectors/track, 19852 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb2           17437       19374      976752   82  Linux swap / Solaris
/dev/hdb4   *           1       17436     8787744   83  Linux

Partition table entries are not in disk order
Disk /dev/hd# (Sun disk label): 16 heads, 63 sectors, 19374 cylinders
Units = sectors of 1 * 512 bytes

         Device Flag    Start       End    Blocks   Id  System
/boot/boot.hdb2  u   17575488  19528992    976752   82  Linux swap
/boot/boot.hdb3  u          0  19528992   9764496    5  Whole disk
/boot/boot.hdb8             0  17575488   8787744   83  Linux native
Disk /dev/hd#: 10.2 GB, 10245537792 bytes
16 heads, 63 sectors/track, 19852 cylinders, total 20010816 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb2        17575488    19528991      976752   82  Linux swap / Solaris
/dev/hdb4   *           0    17575487     8787744   83  Linux

Partition table entries are not in disk order

Reply via email to