RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1284535 - parted does not always optimally align partitions when possible
Summary: parted does not always optimally align partitions when possible
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: parted
Version: 7.1
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: pre-dev-freeze
: 7.3
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-23 14:33 UTC by Matthew Whitehead
Modified: 2023-09-14 03:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-29 16:52:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matthew Whitehead 2015-11-23 14:33:01 UTC
Description of problem: parted makes a very simple attempt to align partitions to a multiple of /sys/block/sda/queue/optimal_io_size. It often fails to align but does not report this.

Version-Release number of selected component (if applicable): parted-2.1-17


How reproducible: 100%


Steps to Reproduce:
1. On a system with a 2.5MiB (1310720 bytes) optimal_io_size create a partition with parted.
2. type 'units MiB'
3. type 'mkpart primary 1MiB 100%

Actual results: It will not align at 2.5MiB, nor print an error.


Expected results: It should align to optimal_io_size of 2.5MiB.


Additional info: There is a patch that prints out when parted fails to align: 

https://github.com/bcl/parted/commit/94071357e18435002f4465e42bffcb471553d166.patch

The root cause seems to be the rounding functions in libparted/cs/natmath.c, called in  _closest_inside_geometry().

If the units are not large enough (using 'KiB' or'MiB' instead of 'GiB' or 'cyl'), it doesn't have enough room for the ped_round_up_to() calls to align cleanly.

Using larger units does align, but wastes space.

Comment 2 Brian Lane 2015-11-23 17:45:27 UTC
This doesn't match what I remember from our IRC conversations. I thought the 1MiB was working and the problem was 1024KiB didn't align correctly.

Please paste the text from a session using the patch that prints the alignment math, this is difficult to duplicate without this specific device.

The only behavior here that I would consider a bug is if it doesn't align AND doesn't tell you that it couldn't align. Also, 1310720 bytes isn't 2.5MiB.

Comment 3 Red Hat Bugzilla 2023-09-14 03:13:33 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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