Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 837111 - The resize fails to run if the device does not have exactly two partitions.
Summary: The resize fails to run if the device does not have exactly two partitions.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rootfs-resize
Version: 17
Hardware: arm
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Chris Tyler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2012-07-02 20:06 UTC by D. Marlin
Modified: 2012-11-25 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-25 18:43:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Make rootfs-resize work for number of partitions not equal 2. (967 bytes, patch)
2012-10-14 14:18 UTC, D. Marlin
no flags Details | Diff

Description D. Marlin 2012-07-02 20:06:23 UTC
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):
  rootfs-resize-0.3-3.fc17

How reproducible:
  always.

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
3.  reboot
  
Actual results:
  Partition count on /dev/sda is not 2, exiting.

Expected results:
  The root (/) partition on /dev/sda is resized

Additional info:
  Please enable rootfs-resize to run on devices with an arbitrary number of partitions.

Comment 1 Chris Tyler 2012-07-05 07:00:32 UTC
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).

Comment 2 D. Marlin 2012-07-05 15:09:08 UTC
I understand the issue, but the partition layout on the rootfs I'm using is:

  /dev/sda1   /boot
  /dev/sda2   swap
  /dev/sda3   /

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.

Comment 3 Brendan Conoboy 2012-07-07 04:21:22 UTC
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.

Comment 4 Chris Tyler 2012-07-07 04:44:43 UTC
I agree, resize-if-last makes sense - will implement.

Comment 5 D. Marlin 2012-10-14 14:18:07 UTC
Created attachment 626991 [details]
Make rootfs-resize work for number of partitions not equal 2.

Comment 6 D. Marlin 2012-10-14 14:18:56 UTC
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:

   git://fedorapeople.org/~dmarlin/rootfs-resize.git

Comment 7 Fedora Update System 2012-10-24 21:34:16 UTC
rootfs-resize-0.9-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/rootfs-resize-0.9-2.fc18


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