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 1077250 - Extended partition consumes whole device
Summary: Extended partition consumes whole device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-blivet
Version: 7.0
Hardware: All
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: David Lehman
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-17 15:06 UTC by Jan Safranek
Modified: 2021-09-03 14:10 UTC (History)
1 user (show)

Fixed In Version: python-blivet-0.61.0.6-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1181494 (view as bug list)
Environment:
Last Closed: 2015-03-05 14:06:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer (1.05 KB, text/x-python)
2014-03-17 15:06 UTC, Jan Safranek
no flags Details
blivet log (116.19 KB, text/plain)
2014-03-17 15:07 UTC, Jan Safranek
no flags Details
python-blivet-0.61.0.20-1.el7 log (57.93 KB, text/plain)
2015-01-12 16:20 UTC, Jan Stodola
no flags Details


Links
System ID Private Priority Status Summary Last Updated
FedoraHosted OpenLMI 275 0 None None None Never
Red Hat Product Errata RHBA-2015:0313 0 normal SHIPPED_LIVE python-blivet bug fix and enhancement update 2015-03-05 17:35:49 UTC

Description Jan Safranek 2014-03-17 15:06:28 UTC
Created attachment 875520 [details]
reproducer

When I create an extended partition of fixed size, blivet ignores the size and creates the largest possible extended partition.

Version-Release number of selected component (if applicable):
python-blivet-0.18.32-1.el7.noarch
(also python-blivet-0.44-1.fc21.noarch)

How reproducible:
always

Steps to Reproduce:
1. create empty partition table on sdb:
   $ parted /dev/sdb mklabel msdos
2. create a 128MiB partition using blivet (see attachment)
   $ python create_extended.py
3. look at created partition
   $ parted /dev/sdb print

Actual results:
Number  Start   End     Size    Type      File system  Flags
 1      1049kB  1074MB  1073MB  extended

-> created parition has 1GiB (=size of my test disk)

Expected results:
-> created parition has 128 MiB

Comment 1 Jan Safranek 2014-03-17 15:07:32 UTC
Created attachment 875521 [details]
blivet log

Comment 3 Alexander Todorov 2014-08-11 09:21:11 UTC
qa_ack+

we should be able to make this into a test case using the provided Python script.

Comment 5 Jan Stodola 2015-01-12 16:20:13 UTC
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.

Comment 6 Jan Stodola 2015-01-12 16:20:57 UTC
Created attachment 979225 [details]
python-blivet-0.61.0.20-1.el7 log

Comment 7 David Lehman 2015-01-12 17:22:35 UTC
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 8 Jan Stodola 2015-01-13 10:16:36 UTC
The issue from comment 5 reported as bug 1181494.

OK, it works fine with the suggested modification:
size = blivet.Size("128 MiB")

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

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  135MB  134MB  extended

[root@localhost ~]# rpm -q python-blivet
python-blivet-0.61.0.20-1.el7.noarch
[root@localhost ~]#

Moving to VERIFIED.

Comment 10 errata-xmlrpc 2015-03-05 14:06:26 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-0313.html


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