|Subject:||parted command : provide a way to resize / maximize a partition without FS resize|
|Date:||Wed, 27 Mar 2013 14:32:09 +0100|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3|
I'm looking for a way to resize or maximize a partition that can be used from a script, without touching the filesystem inside.
Actually, when you attempt to resize an ext4 partition with the parted command, a warning is displayed telling you to use the resize2fs command :
(parted) resize 1
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Fine! But how to resize the partition without touching the FS then?
Most methods you find on the Web involve using fdisk to drop the partition and create again with the same begging, but I find this method risky and error prone. And hard to script!
A proper method is to use the GNU version of cfdisk, which offers a way to do that in resize > Change size > Fixed start. The problem is that this is not scriptable.
As the methods seems already implemented in libparted API (ped_disk_maximize_partition),
is it possible to add the that to the parted command ?
or at least a way to avoid the file system resize ?
Thanks in advance,
|[Prev in Thread]||Current Thread||[Next in Thread]|