]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: Detect out-of-space when adding new primary partition
authorIan Wienand <iwienand@redhat.com>
Thu, 8 Oct 2015 04:00:44 +0000 (15:00 +1100)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Oct 2015 11:07:41 +0000 (13:07 +0200)
commit240ddd3a5fc67529c5ad9ef38f8597305393f0a7
treeb2a212b96dec0e5348f991c678f01119fa2b325a
parent3e9a2bbb94b9f0a2f265ac0c59ffd3b94007b2c8
libfdisk: Detect out-of-space when adding new primary partition

I got a bit confused with the interaction below:

  Command (m for help): p
  Disk /dev/sda: 41 GiB, 43965677568 bytes, 85870464 sectors
    ...
  Device     Boot   Start      End  Sectors  Size Id Type
  /dev/sda1  *       2048  1026047  1024000  500M 83 Linux
  /dev/sda2       1026048 85868543 84842496 40.5G 8e Linux LVM

  Command (m for help): n
  To create more partitions, first replace a primary with an extended partition.

I knew I should have had two primary partitions available, but I did
not notice that the disk was seen as full (I was trying to grow it)

This change detects available primary partitions, and if so indicates
we are out of space, rather than out of partitions.

Signed-off-by: Ian Wienand <iwienand@redhat.com>
libfdisk/src/dos.c