With libparted, version 2.3, I have been having a problem with
ped_disk_get_max_partition_geometry(). The function returns values that are
correct for the beginning of a partition but too small for the end. This only
seems to happen with MS-DOS disk labels. The returned value can be short by
over 2 megabytes and can even be *smaller* than the partition that already
exists there.
I have seen the same behavior with disks of 40 GB too 1 TB and even flash
drives. GParted reports the correct sizes and often shows substantial
unallocated space after a partition that was supposed to be maximized.
I am running Debian Linux.