Bug 1162215
Summary: | partition resize does not check filesystem minimum size | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kamil Páral <kparal> | ||||||||||||||||
Component: | anaconda | Assignee: | Anaconda Maintenance Team <anaconda-maint-list> | ||||||||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||||
Severity: | unspecified | Docs Contact: | |||||||||||||||||
Priority: | unspecified | ||||||||||||||||||
Version: | 21 | CC: | amulhern, anaconda-maint-list, awilliam, cra, dlehman, g.kaviyarasu, jonathan, jskladan, kparal, robatino, vanmeeuwen+fedora, vpodzime | ||||||||||||||||
Target Milestone: | --- | Keywords: | Reopened | ||||||||||||||||
Target Release: | --- | ||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||
Whiteboard: | AcceptedBlocker | ||||||||||||||||||
Fixed In Version: | anaconda-21.48.21-1.fc21 | Doc Type: | Bug Fix | ||||||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||||||
Clone Of: | Environment: | ||||||||||||||||||
Last Closed: | 2014-12-05 03:26:33 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: | |||||||||||||||||||
Bug Depends On: | |||||||||||||||||||
Bug Blocks: | 1043129 | ||||||||||||||||||
Attachments: |
|
Description
Kamil Páral
2014-11-10 14:43:22 UTC
Created attachment 955842 [details]
bug video demonstration
Created attachment 955843 [details]
anaconda.log
Created attachment 955844 [details]
program.log
Created attachment 955845 [details]
storage.log
A summary of our findings from #anaconda: It seems that resize2fs in certain circumstances (maybe always?) requires e2fsck to be run first. Which anaconda doesn't seem to take into account at the moment. If you run e2fsck on the partition before starting anaconda, the resize works correctly, and anaconda gui does not allow you to set below-minimum target size. I guess this violates " Reject or disallow invalid disk and volume configurations without crashing. " criterion from https://fedoraproject.org/wiki/Fedora_21_Beta_Release_Criteria#Custom_partitioning . It did not crash per-say, but the end result is the same. Please note that in my case, I haven't lost any data. The resize operation, which failed, was the first one scheduled. So anaconda didn't touch my disk at all. But this might have been just a lucky situation, and in other cases some operations might run before shrinking. Anaconda devs can say more. well, we kind of explicitly worded the shrink criterion quite restrictively: "Any installer mechanism for resizing storage volumes must correctly attempt the requested operation." I think to exclude issues like this. It does try to check whether the volume needs fsck'ing in certain situations, I think, but I'm not sure we want to block on it. More information: "resize2fs -P" (to print the minimum filesystem size) does not require running e2fsck first only if a) the filesystem is mounted, or b) e2fsck was the *last operation* on it (mounting and unmounting after running e2fsck makes resize2fs request e2fsck again). So in real life, filesystem check will be most probably requested in 99% of cases. This might be a recent change in resize2fs, and anaconda has not adjusted yet. At the moment, if e2fsck is required, anaconda allows to set an arbitrary low value when resizing. David Lehman has a patch that simply disallows resizing in such a case, which is sub-optimal (the user has no idea why it can't be done), but still an improvement. At least this should be covered a blocker bug, I believe. And it seems to be this violates the criterion as written, because the resize operation is not correctly attempted at the moment (if you try to shrink a full 1 GB filesystem down to 1 MB, it's not a correct operation). David has a second patch which allows shrinking only down to the minimum size, but not lower, which is the optimal solution. But I've found a problem in it yesterday - I kept the lowest minimum size offered and resize2fs said it was too small. I guess there was some rounding problem. Waiting for David to find a bug and post an updated updates.img. Just FYI - I tried resizing with pure EXT4 partition (no LVM in play), and the guided partitioning. Created 5G partion with 1G file on it. The guided partitioning then allowed me to shrink the partition below 1G (selected 500M), which then resulted in an error in the installing process. Kamil, I need the storage.log and program.log showing the resize2fs failure in order to see exactly what happened. To be clear, this is a change to resize2fs. This worked correctly in F20 at least, and we did not force an fsck before obtaining min size there either. (In reply to David Lehman from comment #11) > To be clear, this is a change to resize2fs. This worked correctly in F20 at > least, and we did not force an fsck before obtaining min size there either. Looking at my IRC history, this should be it: http://paste.fedoraproject.org/149421/64036014/ http://paste.fedoraproject.org/149440/44178141/ If it wasn't, I can reproduce again. (In reply to Kamil Páral from comment #12) > (In reply to David Lehman from comment #11) > > To be clear, this is a change to resize2fs. This worked correctly in F20 at > > least, and we did not force an fsck before obtaining min size there either. > > Looking at my IRC history, this should be it: > http://paste.fedoraproject.org/149421/64036014/ > http://paste.fedoraproject.org/149440/44178141/ > If it wasn't, I can reproduce again. Please open a separate bug for that failure. I will have a patch for it soon. Discussed at today's blocker review meeting [1]. Accepted as a blocker. This bug is a clear violation of the Final criterion: "Any installer mechanism for resizing storage volumes must correctly attempt the requested operation." [2] [1] http://meetbot.fedoraproject.org/fedora-blocker-review/2014-11-12/ [2] https://fedoraproject.org/wiki/Fedora_21_Final_Release_Criteria#Storage_volume_resize I notice that on TC2 resize2fs does not require an e2fsck prior. (In reply to David Lehman from comment #15) > I notice that on TC2 resize2fs does not require an e2fsck prior. In my testing, it does: [root@localhost ~]# resize2fs -P /dev/vda1 resize2fs 1.42.11 (09-Jul-2014) Please run 'e2fsck -f /dev/vda1' first. [root@localhost ~]# e2fsck -f /dev/vda1 e2fsck 1.42.11 (09-Jul-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information data: 12/488640 files (0.0% non-contiguous), 323737/1953125 blocks [root@localhost ~]# resize2fs -P /dev/vda1 resize2fs 1.42.11 (09-Jul-2014) Estimated minimum size of the filesystem: 563802 [root@localhost ~]# mount /dev/vda1 /mnt [root@localhost ~]# umount /mnt [root@localhost ~]# resize2fs -P /dev/vda1 resize2fs 1.42.11 (09-Jul-2014) Please run 'e2fsck -f /dev/vda1' first. Maybe you had it mounted? anaconda-21.48.15-1.fc21, python-blivet-0.61.10-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/python-blivet-0.61.10-1.fc21,anaconda-21.48.15-1.fc21 Verified fixed with the update above. That update was already superseded, closing bug. python-blivet-0.61.10-1.fc21, anaconda-21.48.16-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. There are a couple problems with the fix for this: bug 1167959 is a side-effect of it, dosfsck is being run and getting stuck (it should use -n). But also we have e2fsck running with '-f -p -C 0' which tells it to fix the easy problems. I'm not sure it is a good idea to run this on every disk on the system, I think it should be limited to disks selected by the user. In addition to changing things unexpectedly it will slow things down on those systems with piles of small disks attached. Created attachment 961689 [details]
proposed patch
What about this patch? It should make sure that the FS check is run only if necessary.
(In reply to Vratislav Podzimek from comment #22) > Created attachment 961689 [details] > proposed patch > > What about this patch? It should make sure that the FS check is run only if > necessary. Link to an updates.img with the patch: http://vpodzime.fedorapeople.org/1162215_updates.img Kamil, could you please verify that it still works? Created attachment 961934 [details]
fixed version of the proposed patch
The new version of the proposed patch with a fix for a bug causing traceback ('errors' not being set if everything went fine).
I tested with https://vpodzime.fedorapeople.org/ultimate_f21_updates.img and unfortunately it breaks the possibility to shrink a partition in custom partitioning - the size field value is always reverted to the current size value. A new version of the patch (same url) fixed the problem. It seems to work OK now. Created attachment 962111 [details]
final version of the patch
Just for the record
anaconda-21.48.18-1.fc21,python-blivet-0.61.12-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/anaconda-21.48.18-1.fc21,python-blivet-0.61.12-1.fc21 pyparted-3.10.2-1.fc21, python-blivet-0.61.12-1.fc21, anaconda-21.48.18-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/FEDORA-2014-15910/pyparted-3.10.2-1.fc21,python-blivet-0.61.12-1.fc21,anaconda-21.48.18-1.fc21 Package pyparted-3.10.2-1.fc21, python-blivet-0.61.12-1.fc21, anaconda-21.48.18-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing pyparted-3.10.2-1.fc21 python-blivet-0.61.12-1.fc21 anaconda-21.48.18-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-15910/pyparted-3.10.2-1.fc21,python-blivet-0.61.12-1.fc21,anaconda-21.48.18-1.fc21 then log in and leave karma (feedback). This works well in RC1. anaconda-21.48.21-1.fc21, python-blivet-0.61.13-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. I think this change may be behind https://bugzilla.redhat.com/show_bug.cgi?id=1170803 . |