Bug 1659130 - parted failure when using SI units to specify start of logical partition
Summary: parted failure when using SI units to specify start of logical partition
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: parted
Version: 29
Hardware: All
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-13 16:18 UTC by thomas.swan
Modified: 2018-12-13 18:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-13 18:47:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description thomas.swan 2018-12-13 16:18:24 UTC
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

Comment 1 Brian Lane 2018-12-13 18:47:39 UTC
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


Note You need to log in before you can comment on or make changes to this bug.