Subject: Re: bug#24167: Way to tell parted to resize partition to max size?

From: Tom Roche <[email-masked]>
Date: Fri, 12 Aug 2016 16:36:21 -0700

[footnotes after .sig]

Petter Reinholdtsen[1]
> With btrfs I can do like this to extend to the end of the partition:

>   btrfs filesystem resize max /

> Could parted be changed to allow something similar?  Perhaps

>   resizepart 1 max

WARNING: I have not tried this! but I believe you want `-1`, e.g.

    resizepart 1 -1

I am basing this on the knowledge that

    sudo parted ${DRIVE_DEV} --script -- mkpart primary 0 -1

I concur (presuming it works :-) that note of the semantics of `-1` should be added to the manual, e.g. here[2] and here[3]. Note the manual[2] does state clearly

>> When growing a partition you will want to grow the filesystem afterwards, but
>> when shrinking, you need to shrink the filesystem before the partition. 

HTH, Tom Roche <[email-masked]>

[1]: http://lists.gnu.org/archive/html/bug-parted/2016-08/msg00001.html
[2]: https://www.gnu.org/software/parted/manual/parted.html#resizepart
[3]: https://www.gnu.org/software/parted/manual/parted.html#mkpart