Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1181494

Summary: Do not crash when creating small partitions
Product: Red Hat Enterprise Linux 7 Reporter: Jan Stodola <jstodola>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-blivet-0.61.15.9-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1077250 Environment:
Last Closed: 2015-11-19 08:46:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
parted log
none
reproducer none

Description Jan Stodola 2015-01-13 10:09:23 UTC
+++ This bug was initially created as a clone of Bug #1077250 +++

Retested with python-blivet-0.61.0.20-1.el7 and I got following traceback:

Traceback (most recent call last):
  File "create_extended.py", line 36, in <module>
    blivet.partitioning.doPartitioning(storage=b)
  File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 929, in doPartitioning
    allocatePartitions(storage, disks, partitions, free)
  File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 1249, in allocatePartitions
    _part.req_start_sector, _part.req_end_sector)
  File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 792, in addPartition
    end=end)
  File "/usr/lib64/python2.7/site-packages/parted/decorators.py", line 41, in new
    ret = fn(*args, **kwds)
  File "/usr/lib64/python2.7/site-packages/parted/geometry.py", line 63, in __init__
    raise parted.GeometryException, "must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)"
_ped.GeometryException: must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)

Whole log will be attached.
Moving to ASSIGNED.


--- Additional comment from David Lehman on 2015-01-12 18:22:35 CET ---

The reproducer needs to be updated to request a partition with size Size("128 MiB") instead of 128. The 128 is being interpreted as 128 bytes, which is not what you want.

You could open a new bug since we should probably handle a size of 128 bytes by allocating a partition the size of the optimal io size (probably 1MiB) instead of crashing.

Comment 1 Jan Stodola 2015-01-13 10:09:54 UTC
Created attachment 979530 [details]
parted log

Comment 2 Jan Stodola 2015-01-13 10:11:01 UTC
Created attachment 979532 [details]
reproducer

Comment 4 Jan Stodola 2015-08-17 11:41:15 UTC
Retested with python-blivet-0.61.15.15-1.el7 using script from comment 2, one small partition was created successfully:

[root@localhost ~]# parted /dev/vdb print
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  2097kB  1049kB  primary

[root@localhost ~]#

Moving to VERIFIED.

Comment 5 errata-xmlrpc 2015-11-19 08:46:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2232.html