Based on patch from Alex Bligh <alex@alex.org.uk>, Alex wrote:
By default, omitting a size parameter means that the maximum sized partition
is used. However, this option is not available in conjunction with the -N
flag, as under such circumstances the default is the current size of the
partition. This patch allows a size to be specified as "+" in which case
the maximum sized partition is used, irrespective of the setting of the -N
flag.
This allows partitions to be programatically resized to their maximum size,
by (for instance):
echo ",+," | sfdisk -N1 /dev/sda
This is non-trivial to do without the patch, as -N makes the default size
the existing size. As there is (without this patch) no way of reading the
maximum size, the only option is to delete the partition and recreate it.
This is undesirable for a number of reasons (e.g. errors between delete
and recreate).
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/686124 Signed-off-by: Karel Zak <kzak@redhat.com>