Bug 1343571

Summary: Need Support for Cloud Instances That Use LVM-hosted "/"
Product: [Fedora] Fedora EPEL Reporter: Thomas Jones <redhat>
Component: cloud-initramfs-toolsAssignee: Juerg Haefliger <juergh>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el6CC: aperotti, Jan.van.Eldik, juergh, loren
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1632777 (view as bug list) Environment:
Last Closed: 2020-11-30 15:02:35 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:

Description Thomas Jones 2016-06-07 13:30:32 UTC
Description of problem:
Current packaging of cloud-initramfs-tools only supports expansion of disk hosting "/" if "/" is hosted on a disk that is either wholly unpartitioned or is partitioned with standard (primary/logical/extended). Currently, there is no support for expansion of partitions containing an LVM-hosted "/".

Note: some security compliance suites (e.g., DISA STIGs) mandate the use of a specific minimum set of partitions implemented via LVM2. 

Version-Release number of selected component (if applicable):

dracut-modules-growroot version 0.20-2
cloud-utils-growpart version 0.27-10

Tested on RHEL 6.7 & 6.8 as well as CentOS 6.7 and 6.8 (hosted within AWS)

How reproducible:
Nothing to reproduce: it's in the package design

Steps to Reproduce:
1. Launch cloud instance with LVM-partitioned root filesystem - setting root disk size greater than template-size
2. Install dracut-modules-growroot
3. Reboot: 

Actual results:
When system comes back from reboot, partition hosting the root volume-group remains the same size

Expected results:
Partition containing the root volume group expands

Additional info:
A slight modification to the /usr/share/dracut/modules.d/50growroot/growroot.sh file to add logic for finding what partition hosts "/" will allow the final:

if out=$(growpart --update off "${rootdisk}" "${partnum}" 2>&1) ; then
                _info "${out}"

statement to function, correctly. As a quick-n-dirty work-around, I've changed the original snippet:

_growroot() {
        # Remove 'block:' prefix and find the root device
        rootdev=$(readlink -f "${root#block:}")


with:

> _growroot() {
> 	# Compute root-device
> 	if [ -z "${root##*mapper*}" ]
> 	then
> 		set -- "${root##*mapper/}"
> 		VOLGRP=${1%-*}
> 		ROOTVOL=${1#*-}
> 		rootdev=$(readlink -f $(pvs --noheadings | awk '/'${VOLGRP}'/{print $1}'))
> 		_info "'/' is hosted on an LVM2 volume: setting \$rootdev to ${rootdev}"
> 	else
> 		# Remove 'block:' prefix and find the root device
> 		rootdev=$(readlink -f "${root#block:}")
> 	fi


In mine. Obviously, it assumes that "/" will never span multiple PVs, so, probably wants some cleanup.

Further note: while the above code-change allows the grow-root against the partition containing the PV hosting "/" to succeed, it typically requires a reboot to fully-effect: first boot grows what is seen by sfdisk; second boot grows what is seen by lsblk (and pvresize).

Comment 1 Ben Cotton 2020-11-05 16:50:35 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is our policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged  change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.

Comment 2 Ben Cotton 2020-11-30 15:02:35 UTC
EPEL el6 changed to end-of-life (EOL) status on 2020-11-30. EPEL el6 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
EPEL please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.