#1135681 --force gets ignored

Package:
fdisk
Source:
fdisk
Description:
collection of partitioning utilities
Submitter:
Philipp Marek
Date:
2026-05-05 14:05:02 UTC
Severity:
normal
Tags:
#1135681#5
Date:
2026-05-04 13:50:53 UTC
From:
To:
The man page and online help shows "--force":

     # sfdisk --help
     ...
      -f, --force               disable all consistency checking

but it doesn't do what it says.

Create some space:

     # dd if=/dev/zero of=/tmp/partition count=1
     1+0 records in
     1+0 records out
     512 bytes copied, 3.4976e-05 s, 14.6 MB/s

(Try to) create a partition:

     # echo 1 2 7 - | sfdisk --force /tmp/partition
     Checking that no-one is using this disk right now ... OK

     Disk /tmp/partition: 512 B, 512 bytes, 1 sectors
     Units: sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes

     >>> Created a new DOS (MBR) disklabel with disk identifier
0xc81d61b0.
     /tmp/partition1: All space for primary partitions is in use.
     Failed to add #1 partition: Invalid argument
     Leaving.

Verify that nothing was written:

     # hd /tmp/partition
     00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................|
     *
     00000200


Please make --force work as expected -- "just do what I say".

Thanks!

#1135681#14
Date:
2026-05-05 14:02:46 UTC
From:
To:
[..]
[..]

Please follow up with upstream's comments, see here: https://github.com/util-linux/util-linux/issues/4320

C.