[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: resizing containerpartition and keeping startpoint intact
From: |
B.Hakvoort |
Subject: |
Re: resizing containerpartition and keeping startpoint intact |
Date: |
Mon, 22 Nov 2004 20:36:34 +0100 |
On Mon, 2004-11-22 at 19:54 +0100, B.Hakvoort wrote:
> The disadvantage of this is that the end of the partition is then also
> not set to a cylinder boundary. Oh well.. i think of something ...
>
Ok, i think i have something (didn't test it yet):
---------------------------------------------------------------
First i'd just get the normal contraint and use it to set the geom of
the partition in question:
constraint = ped_constraint_any( device );
ped_disk_set_partition_geom ( disk, c_partition, constraint, start,
end ) ;
now c_partition ->geom ->end contains a sector which lies nicely on a
cylinder boundary.
Next i'll set c_partition ->geom ->start to the value of the original
partition:
ped_geometry_set_start (c_partition ->geom, orig_start) ;
Then i'll get the exact contraint and set the final size of the
partition with this constraint:
constraint = ped_constraint_exact ( c_partition ->geom ) ;
ped_disk_set_partition_geom ( disk, c_partition, constraint, start,
end ) ;
-----------------------------------------------------------------
It's a bit hackish, but afaics it'll keep the startsector intact and the
end is nicely rounded on a cylinder boundary. Hopefully there's a better
way of achieving this, so keep them coming... :-)
Thanks,
Bart
--
www.titanium-it.nl --- Open Minded Open Source
www.real-life.nl <-----Another Source