[parted-devel] keeping partitions in disk order

Andrew Gaffney agaffney at gentoo.org
Sat Aug 26 16:56:39 UTC 2006


Andrew Gaffney wrote:
> leslie.polzer at gmx.net wrote:
>> Sorry for letting you both wait so long.  A lot of things have
>> backlogged during my absence in August and full-time work in July.
>>
>>   Try calling ped_disk_enumerate_partitions() after the operation
>> and see whether it does what you want.
> 
> What exactly does this function do? There doesn't appear to be a wrapper 
> function in pyparted for it, which means that I can't really test it. If 
> it does do exactly what I want, I'll try requesting its addition with 
> pyparted upstream :)

Looking at the parted code, this function is currently only called at the end of 
ped_disk_remove_partition(), so it stands to reason that it's designed to "fill 
in holes" in the numbering scheme when a partition is removed. Will this 
function also work as-is to rearrange the partition numbers so that they match 
physical disk order? From what I can understand of 
ped_disk_enumerate_partitions() and _partition_enumerate(), it does not seem so. 
Please correct me if I'm wrong :P

-- 
Andrew Gaffney                            http://dev.gentoo.org/~agaffney/
Gentoo Linux Developer                                   Installer Project



More information about the parted-devel mailing list