Description of problem: When specifying partition begin and end points using si units, parted fails to create a logical partition. Version-Release number of selected component (if applicable): parted-3.2-36.fc29.x86_64 (unsure how far back bug goes) How reproducible: always Steps to Reproduce: 1. create 10G media: file or usb 2. while read l ; do sudo parted -s /dev/sda -- $l ; done <<EOF mklabel msdos mkpart extended 0GiB -1s mkpart logical ext4 0GiB 6GiB EOF Actual results: Error: You requested a partition from 0.00B to 6442MB (sectors 0..12582911). The closest location we can manage is 1024B to 6442MB (sectors 2..12582911). FAIL Expected results: partition should be created a next sector Additional info: This happens at any boundary particularly and with an alignment option and is specific to SI unit specification. Additional failure runs and successes: In each of these, changing the beginning of the start position to a non-SI unit causes the program to complete without errors. $ while read l ; do sudo parted -a none -s /dev/sda -- $l ; done <<EOF mklabel msdos mkpart extended 0GB -1s mkpart logical ext4 0GiB 6GiB set 1 boot on EOF Error: You requested a partition from 0.00B to 6442MB (sectors 0..12582911). The closest location we can manage is 1024B to 6442MB (sectors 2..12582911). FAIL $ while read l ; do sudo parted -a none -s /dev/sda -- $l ; done <<EOF mklabel msdos mkpart extended 0GB -1s mkpart logical ext4 0GB 6GiB set 1 boot on EOF SUCCESS $ while read l ; do sudo parted -a none -s /dev/sda -- $l ; done <<EOF mklabel msdos mkpart pri ext4 1MiB 1GiB mkpart pri ext4 1GiB 2GiB mkpart pri linux-swap 2GiB 4GiB mkpart extended 4GiB -1s mkpart logical ext4 4GB 6GiB set 1 boot on set 5 lvm on EOF SUCCESS
This actually isn't a bug. SI units are treated as an exact request, and snapping to the next valid sector is disabled. This was changed in https://git.savannah.gnu.org/cgit/parted.git/commit/?id=552805a03a79f7b6badaf26536d86db580360f98 And has been present since parted 2.4