#457768 libparted1.7-1: doesn't correctly recognizes an hp 32M SecureDigital

#457768#5
Date:
2007-12-25 13:53:05 UTC
From:
To:
Hello,

I'm not sure the cause is libparted1.7-1, but this is the common factor
between gnu-fdisk and gparted, the two programs that shows this error.
Strangely enough, the comman line parted itself works correctly.  Please
reassign to whatever the correct package is in case :-)

I wanted to replace the vfat partition on my hp 32M SD with an ext3,
but gnu-fdisk wrongly recognizes the disk geometry:
=====
root@gismo:~# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 24 MB, 24675840 bytes
255 heads, 63 sectors/track, 3 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System

root@gismo:~# fdisk.distrib -l /dev/mmcblk0

Disk /dev/mmcblk0: 30 MB, 30605312 bytes
4 heads, 16 sectors/track, 934 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x0006d3ad

        Device Boot      Start         End      Blocks   Id  System

root@gismo:~#
=====

gnu-cfdisk suffers the same problem, however it recognizes that the SD
card is a 32M one.  I guess gnu-cfdisk starts counting from 0 instead of
1, thus the difference in the byte size:
=====
GNU cfdisk 1.0

Unknown
Disk: /dev/mmcblk0   Disk type: msdos    Size: 30605311B, 30.6MB
Heads: 255   Sectors per track: 63   Cylinders: 3
-----
cfdisk (util-linux-ng 2.13.1-rc1)

Disk Drive: /dev/mmcblk0
Size: 30605312 bytes, 30 MB
Heads: 4   Sectors per Track: 16   Cylinders: 934
=====

FYI, gparted also suffers the same gnu-fdisk problem, while parted and
sfdisk correctly identifies the SD:
=====
root@gismo:~# parted /dev/mmcblk0
GNU Parted 1.7.1
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print

Disk /dev/mmcblk0: 30.6MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.

root@gismo:~# sfdisk -g /dev/mmcblk0
/dev/mmcblk0: 934 cylinders, 4 heads, 16 sectors/track

root@gismo:~#
=====

Thx, bye,
Gismo / Luca