bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

resizing containerpartition and keeping startpoint intact


From: B.Hakvoort
Subject: resizing containerpartition and keeping startpoint intact
Date: Mon, 22 Nov 2004 15:18:21 +0100

Hi all,

I've implemented resizing of filesystems in gparted using CLI-tools and
it works quite well. In general it's just a matter of resizing the
partition (with libparted) and then call the specific application to
resize to filesystem to fit the new partition.

However, the code to resize the partition also changes the startpoint to
match the cylinderboundary. When a partition is created by a decent
partitionmanager this isn't a problem, but when it's created by a
program that doesn't care about cylinders etc.. it's very dangerous.
For instance, i just killed a partition/filsystem which was created by
Partition Magic 5.0 . The startsector had moved a bit and none of the
e2fstools could ever find the ext2 filesystem back.
( np here, it's just a testdisk =) )

So, here's my question, how do i resize (shrink/grow) a partition while
keeping the startpoint _extact_ as it was?
Here's a code snippet of my current resizer:
--------------------------------------------------------
constraint = ped_constraint_any( device );
ped_disk_set_partition_geom ( disk, c_partition, constraint, start,
end ) ;
----------------------------------------------------------------

I guess i need to create another contraint, but looking at the API i
can't figure out how to get a fixed startpoint. Maybe i should use
constraint_exact ?

Thanks for bearing with me ;)

Bart

PS. Andrew, gnomemeeting is up and running, it just isn't much fun
without cam/mic :P

-- 
www.titanium-it.nl --- Open Minded Open Source
www.heavenisopen.com <-----Another Source





reply via email to

[Prev in Thread] Current Thread [Next in Thread]