[parted-devel] libparted ped_disk_get_max_partition_geometry() function oddness

ben scott benscott at nwlink.com
Tue Feb 17 07:12:12 UTC 2009


Doesn't anyone have any ideas? I would really appreciate any help.

I have a several more data points:
when I use a gpt table the function returns the correct values.
Also, I am using libpartedversion 1.8.8 but I tried 1.7 with
the same results. Lastly, recreating the partition with fdisk
doesn't seem to help if the sector is past the point where
the  CHS value goes to "fe ff ff."

On Saturday 14 February 2009 4:59:51 pm ben scott wrote:
> hope this is not to far off topic for this list. I tried the #parted
> IRC already and received no reply.
>
> I am writing a program that uses libparted to create and move
> partitions and have run into a problem I can't figure out. Lets say I
> create three partitions on an MS-DOS disk label with libparted and
> then I want to move the middle one. My program calls
> ped_disk_get_max_partition_geometry() to find out how much space is
> available. The problem is that the geometry returned is less than the
> real space available, often off by many megabytes. If I create the
> original partitions with fdisk or some other program the function call
> returns the correct value, even when I create the partitions at the
> *exact* same spot. When I looked at the partition table I noticed that
> there is one diffence I can see. The LBA addresses are the same but
> the CHS ones are different.
>
> As an example linux fdisk reports for a disk:
>
>    226 heads, 63 sectors/track, 10977 cylinders, total 156301488 sectors
>
> and creates this partition:
>
>    start: 63 end: 303407
>    0000447 01 01 00 83 45 3f 15 3f 00 00 00 f1 a0 04 00 00 00
>
> While my program creates this partition:
>
>    0000447 01 01 00 83 e1 3f 12 3f 00 00 00 f1 a0 04 00 00 00
>
> Partitions created with gparted seem to work fine too yet it uses
> libparted. Does anyone know what I am doing wrong?
>
> Thank you.
>
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel





More information about the parted-devel mailing list