[parted-devel] bug: parted gets partitions wrong

Jim Meyering jim at meyering.net
Fri May 23 20:35:36 UTC 2008


Jim Meyering <jim at meyering.net> wrote:
> "xerces8" <xerces8 at butn.net> wrote:
>>> The first 4 sectors are attached.
>
> Thanks!
> I'll take a look by Friday.

Thanks.
I did reproduce the failure (fdisk sees 2 partitions, parted sees just
one), using your MBR on a 0-extended loopback device.
However, that's not fair, since loopback doesn't work with partitions.
Then I put the boot sector on a USB key.  fdisk still sees two:

    $ fdisk -l /dev/sdc

    Disk /dev/sdc: 65 MB, 65986560 bytes
    64 heads, 32 sectors/track, 62 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Disk identifier: 0x00000000

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *           1         716      733168    6  FAT16
    /dev/sdc2             717         979      269312    6  FAT16

but parted fails:

    $ ./parted -m -s /dev/sdc p
    Error: /dev/sdc: unrecognised disk label
    [Exit 1]

I suspect that the above merely shows that parted
looks farther than the partition table, and attempts
to do some minimal verification.  When (at least in my case)
it doesn't find anything sane beyond the partition table, it fails.
I'll investigate further next week.



More information about the parted-devel mailing list