Hi all,

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 <http://www.gnu.org/software/parted/api/group__PedDisk.html#g701f35a56151cd77624f025a1ac14c54>),
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,
Marc

Reply via email to