]> git.ipfire.org Git - thirdparty/util-linux.git/commit - libfdisk/src/dos.c
libfdisk: (dos) allow to maximize partition
authorKarel Zak <kzak@redhat.com>
Thu, 20 Nov 2014 12:11:38 +0000 (13:11 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 20 Nov 2014 12:11:38 +0000 (13:11 +0100)
commit333c3761383d6dd166f032080055e9333b09628c
treef8d1552c10c100c40411edc9bf8da2e1a0ca60cb
parent8410cdd38ad06d0904ec3ba252336fecc4aff067
libfdisk: (dos) allow to maximize partition

The struct fdisk_partition has special flag "end_follow_default" to
make the partition large as much as possible. This patch makes this
flag usable for fdisk_set_partition() function.

Command line example (enlarge the first partition):

# echo ',+' | ./sfdisk -N1 /dev/sdb
...
Disk /dev/sdb: 100 MiB, 104857600 bytes, 204800 sectors
...
Old situation:
Device     Boot Start   End Sectors Size Id Type
/dev/sdb1        2048 22527   20480  10M 83 Linux
      ^^^^^
New situation:
Device     Boot Start    End Sectors Size Id Type
/dev/sdb1        2048 204799  202752  99M 83 Linux
      ^^^^^^

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c
libfdisk/src/dos.c