RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1064970 - Root partition does not get resized to the available space
Summary: Root partition does not get resized to the available space
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rhel-guest-image
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Joey Boggs
QA Contact: Jaroslav Henner
URL:
Whiteboard:
Depends On: 1032831 977028 1052486
Blocks: 1052453
TreeView+ depends on / blocked
 
Reported: 2014-02-13 16:08 UTC by Jaroslav Henner
Modified: 2014-06-12 15:32 UTC (History)
12 users (show)

Fixed In Version: rhel-guest-image-7.0-20140227.0
Doc Type: Bug Fix
Doc Text:
With this update, the root file system of Red Hat Enterprise Linux guest images (in the qcow2 file format) is resized to the space that is available. Previously, the Red Hat Enterprise Linux guest images contained only a 6-GB root file, which could be insufficient under certain circumstances. Now, the scripts provided by the cloud-init packages can expand the partition and the file system automatically.
Clone Of: 977028
Environment:
Last Closed: 2014-06-12 15:32:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0754 0 normal SHIPPED_LIVE rhel-guest-image bug fix and enhancement update 2014-06-12 19:32:28 UTC

Comment 2 Jaroslav Henner 2014-02-13 16:48:45 UTC
To fix this, we need either be able to resize the mounted part and make sure kernel re-reads partition table, or we have to use the dracut-modules-growroot trick. Right now, the kernel seems to be unable to re-read the partition table if some partition on the device is mounted: 

sudo partprobe /dev/vda
Error: Partition(s) 1 on /dev/vda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

sudo kpartx /dev/vda -a
device-mapper: reload ioctl on vda1 failed: Invalid argument
create/reload failed on vda1


To grow the partiton, cloud-init uses growroot which currently is AFAIK not included in rhel-7 right now.

After those two problems above are solved, cloud-init should be able to grow the partition and filesystem automaticaly.


I think this is quite important feature of the cloud-image and we shouldn't release the image if this doesn't work.

Comment 4 Jaroslav Henner 2014-02-18 16:14:35 UTC
I can confirm that after installing the growpart and making the snapshot, the root FS and it's partition have been resized (on background) by cloud-init.

Comment 8 yuliu 2014-03-03 03:28:46 UTC
version: rhel-guest-image-7.0-20140227.0.x86_64.qcow2
Details:
1. emu-img info $version
image: rhel-guest-image-7.0-20140227.0.x86_64.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 363M
cluster_size: 65536

2. qemu-img resize $version +10G

3. qemu-img info $version
# qemu-img info rhel-guest-image-7.0-20140227.0.x86_64.qcow2 
image: rhel-guest-image-7.0-20140227.0.x86_64.qcow2
file format: qcow2


Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
cluster_size: 65536

4. Login to booted image:
#fdisk -l
virtual size: 20G (21474836480 bytes)
disk size: 364M# fdisk -l
...

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        20G  758M   20G   4% /

As the result we can tell that the root partition gets resized to available space.

Comment 10 errata-xmlrpc 2014-06-12 15:32:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0754.html


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