Bug 495520 - An end-disk partition can't be expand
An end-disk partition can't be expand
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
11
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
anaconda_trace_hash:477af5daf7979b6f1...
: Reopened
: 506877 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-13 12:20 EDT by Martin-Gomez Pablo
Modified: 2010-02-23 13:48 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-02-23 13:48:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Attached traceback automatically from anaconda. (129.64 KB, text/plain)
2009-04-13 12:20 EDT, Martin-Gomez Pablo
no flags Details

  None (edit)
Description Martin-Gomez Pablo 2009-04-13 12:20:27 EDT
The following was filed automatically by anaconda:
anaconda 11.5.0.38 exception report
Traceback (most recent call first):
  File "/usr/lib64/python2.6/site-packages/parted/geometry.py", line 50, in __init__
    self.__geometry = _ped.Geometry(self.device.getPedDevice(), start, length)
  File "/usr/lib/anaconda/storage/devices.py", line 1147, in _computeResize
    length=newLen)
  File "/usr/lib/anaconda/storage/devices.py", line 949, in _setTargetSize
    (constraint, geometry) = self._computeResize(self.partedPartition)
  File "/usr/lib/anaconda/storage/devices.py", line 420, in <lambda>
    lambda s, v: s._setTargetSize(v),
  File "/usr/lib/anaconda/storage/deviceaction.py", line 242, in __init__
    self.device.targetSize = newsize
  File "/usr/lib/anaconda/iw/partition_dialog_gui.py", line 243, in run
    actions.append(ActionResizeDevice(request, size))
  File "/usr/lib/anaconda/iw/partition_gui.py", line 1121, in editPartition
    actions = parteditor.run()
  File "/usr/lib/anaconda/iw/partition_gui.py", line 1082, in editCB
    self.editPartition(device)
CreateException: La partition ne peut pas être en dehors du disque !
Comment 1 Martin-Gomez Pablo 2009-04-13 12:20:39 EDT
Created attachment 339339 [details]
Attached traceback automatically from anaconda.
Comment 2 Martin-Gomez Pablo 2009-04-14 06:22:17 EDT
In English, the exception is something like "The partition can't be outside of the the disk!". In the same conditions, I was able to repeat it twice.

I have two disk : one for the data and one for the system. During the installation, I choose to create a personalised partitioning. As I have formatted my "/" partition in ext4, I created a little "/boot" partition (200MB), located at the end of the disk . Afterwards, I decided to decrease the size of the "/" in order to increase the "/boot" one. But when I tried to expand the "/boot" partition using the freed space (just next to /boot), anaconda give me this exception.
Comment 3 David Cantrell 2009-04-14 22:37:24 EDT
This will be fixed in pyparted-2.0.12
Comment 4 David Cantrell 2009-04-14 23:13:40 EDT
Scratch that, won't be fixed in pyparted-2.0.12.
Comment 5 Bug Zapper 2009-06-09 09:45:45 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 David Cantrell 2009-08-24 21:52:44 EDT
After investigating this problem in detail, I've found it's not a pyparted issue but rather a UI issue in anaconda.  The exception we get from libparted is correct.  Even though you have reduced the size of the first partition, you cannot resize the last partition on the disk to use part of that space because a resize operation only grows the filesystem, it does not move the filesystem.  To accomplish what you are trying to do, you would need to move the last partition to start within the free space you just created after resizing the first partition, then resize to expand to the end of the disk.

I have patched anaconda to prevent a resize operation that would violate boundary issues:

diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py
index f5650e9..fe28088 100644
--- a/iw/partition_ui_helpers_gui.py
+++ b/iw/partition_ui_helpers_gui.py
@@ -380,13 +380,17 @@ def createPreExistFSOptionSection(origrequest, maintable, 
         else:
             value = origrequest.size
 
-        reqlower = origrequest.minSize
+        reqlower = 1
         requpper = origrequest.maxSize
+
         if origfs.exists:
-            lower = reqlower
-        else:
-            lower = 1
-        adj = gtk.Adjustment(value = value, lower = lower,
+            reqlower = origrequest.minSize
+
+            geomsize = origrequest.partedPartition.geometry.getSize(unit="MB")
+            if (requpper != 0) and (requpper > geomsize):
+                requpper = geomsize
+
+        adj = gtk.Adjustment(value = value, lower = reqlower,
                              upper = requpper, step_incr = 1)
         resizesb = gtk.SpinButton(adj, digits = 0)
         resizesb.set_property('numeric', True)
Comment 7 David Cantrell 2009-08-24 22:46:13 EDT
*** Bug 506877 has been marked as a duplicate of this bug. ***
Comment 8 David Cantrell 2009-08-26 16:14:27 EDT
Fix will be in anaconda-12.18-1.

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