Red Hat Bugzilla – Bug 837111
The resize fails to run if the device does not have exactly two partitions.
Last modified: 2012-11-25 13:43:03 EST
Description of problem:
When installing F17 on a Trim Slice, the shipped version of U-Boot requires an ext3 or VFAT /boot partition (or wherever the U-Boot images are located), but F17 wants ext4 for the / (root) partition. If a swap partition is also added, we have three partitions, and rootfs-resize refuses to run.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create an F17 image with the following partitions:
- /boot ext3
- / ext4
- swap swap
2. install rootfs-resize and ensure /.rootfs-resize exists
Partition count on /dev/sda is not 2, exiting.
The root (/) partition on /dev/sda is resized
Please enable rootfs-resize to run on devices with an arbitrary number of partitions.
The script only performs resizing -- not partition moves. In the scenario that you've outlined, I would assume that the swap partition immediately follows the root filesystem, and therefore a move would be required. The design assumption was that an experienced user who is creating swap partitions would be easily able to resize the root partition first.
Moving a swap (or other) partition while the system is live is probably not possible, and would be very slow.
As an alternative, we're experimenting with a firstboot module which asks the user for a swap space size, which rootfs-resize picks up and creates as a swap file on the rootfs after resizing (instead of a swap partition).
I understand the issue, but the partition layout on the rootfs I'm using is:
so there is nothing after '/', and a resize is all that is required. I have performed the resize manually to verify this.
What about changing the check in rootfs-resize to ensure the '/' partition is on the the last partition on the device, rather than ensuring the number of partitions is exactly '2'? That way it would work for any number of partitions, as long as the root parition ('/') was on the last the last partition on the device.
Chris, in light of David's partition scheme please reconsider this restriction. There is almost no gain whatsoever in the arbitrary limitation of 2 partitions. It's just as likely that there will be 1 partition (Trimslices can boot to an ext3 /), 3 partitions (David's example), 4 partitions (Add a /home directory) and so forth. Working when the partition count is 2 and not otherwise is completely arbitrary.
I agree, resize-if-last makes sense - will implement.
Created attachment 626991 [details]
Make rootfs-resize work for number of partitions not equal 2.
I have a fix for rootfs-resize that works on the Panda and Trim Slice devices with more than two partitions. This has been tested on Panda, Trim Slice, and and Raspberry Pi, and they all worked as expected.
The have uploaded the patch to this BZ and I have put a copy of my git tree on fedorapeople.org:
rootfs-resize-0.9-2.fc18 has been submitted as an update for Fedora 18.