Description of problem: When user create partition with all free space this traceback will raise. How reporoducible: Always Steps to reproduce: 1) Click + to create partition 2) Set some Filesystem (for example ext4) 3) Leave used space slider to maximum 4) Confirm and crash will arise Version-Release number of selected component: blivet-gui-0.3.4-1.fc24.noarch Additional info: reporter: libreport-2.6.0 blivet-gui.log: cmdline: /usr/bin/python3 /bin/blivet-gui executable: /bin/blivet-gui hashmarkername: blivet-gui kernel: 4.0.7-300.fc22.x86_64 product: Fedora release: Fedora release 22 (Twenty Two) type: Python version: 22 Truncated backtrace: Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/blivetgui/blivetgui.py", line 409, in add_partition self._reraise_exception(result.exception, result.traceback) File "/usr/lib/python3.4/site-packages/blivetgui/blivetgui.py", line 227, in _reraise_exception raise type(exception)(str(exception) + "\n" + traceback) blivet.errors.PartitioningError: Unable to allocate requested partition scheme. Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/blivetgui/utils.py", line 967, in add_device blivet.partitioning.doPartitioning(self.storage) File "/usr/lib/python3.4/site-packages/blivet/partitioning.py", line 549, in doPartitioning allocatePartitions(storage, disks, partitions, free) File "/usr/lib/python3.4/site-packages/blivet/partitioning.py", line 869, in allocatePartitions raise PartitioningError(_("Unable to allocate requested partition scheme.")) blivet.errors.PartitioningError: Unable to allocate requested partition scheme.
Created attachment 1053789 [details] File: backtrace
Created attachment 1053791 [details] File: blivet-gui-com.log
Created attachment 1053792 [details] File: blivet-gui-tb
Created attachment 1053793 [details] File: blivet.log
Created attachment 1053794 [details] File: description
Created attachment 1053795 [details] File: environ
Created attachment 1053796 [details] File: program.log
Changing to python-blivet and rawhide. Reproducer for blivet: ---------------- import blivet b=blivet.Blivet() b.reset() sdb = b.devicetree.getDeviceByName("sdb") # assuming sdb is an empty disk free_regions = blivet.partitioning.getFreeRegions([sdb]) free_space = free_regions[0].length*free_regions[0].device.sectorSize free_size = blivet.size.Size(free_space) new_part = b.newPartition(size=free_size, parents=[sdb]) b.createDevice(new_part) blivet.partitioning.doPartitioning(b) ----------------
This is probably caused by this change in blivet -- https://github.com/rhinstaller/blivet/commit/a64a0ef72d6d1fdd72581a5ac0ff2306dbeb3fcc
You'll have to either do the alignment yourself to get the maximum aligned partition size or specify the start and end sectors explicitly, like this: free = blivet.partitioning.getFreeRegions([sdb])[0] new_part = b.newPartition(start=free.start, end=free.end, parents=[sdb])
(In reply to David Lehman from comment #10) > You'll have to either do the alignment yourself to get the maximum aligned > partition size or specify the start and end sectors explicitly, like this: > > free = blivet.partitioning.getFreeRegions([sdb])[0] > new_part = b.newPartition(start=free.start, end=free.end, parents=[sdb]) I can definitely do this in blivet-gui, but I still think blivet shouldn't fail in this situation -- the size is valid, just not aligned and blivet shouldn't align it to size larger than actually available free space.
I think aligning the free region causes it to become smaller and no longer able to fit the partition (whose size is unchanged).
I'm open to changing getFreeRegions so it returns aligned regions or perhaps raising a better exception in the current code. Changes to getFreeRegions will have to wait until blivet-2.0 since it changes API.
anaconda-23.19.1-1.fc23, python-blivet-1.12.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update anaconda python-blivet'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-13831
anaconda-23.19.1-1.fc23, python-blivet-1.12.1-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.