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 1383817 - --percent option in kickstart does not properly utilize the available free space
Summary: --percent option in kickstart does not properly utilize the available free space
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda
Version: 6.7
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: David Lehman
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-11 20:50 UTC by jcastran
Modified: 2020-04-15 14:43 UTC (History)
8 users (show)

Fixed In Version: anaconda-13.21.256-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 11:09:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0720 0 normal SHIPPED_LIVE anaconda bug fix update 2017-03-21 12:41:58 UTC

Description jcastran 2016-10-11 20:50:59 UTC
Description of problem:
Using the "logvol" command in kickstart, with "--grow" and "--percent" does not utilize a large portion of the free space in the volume group.

Example:
logvol /              --fstype ext4 --name rootfs  --vgname=vg_sys --size 250 --grow --percent=20

RHEL 6.6  "vgs"
  vg_sys   1   8   0 wz--n- 31.97g 320.00m

          "lvs"
  rootfs vg_sys -wi-ao----  5.62g                                                    


RHEL 6.7+ "vgs"
  vg_sys   1   8   0 wz--n- 31.97g 9.25g

          "lvs"
  rootfs vg_sys -wi-ao----   4.00g                                                    



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

How reproducible:
   Customer experiences this every time

Actual results:
   RHEL 6.7+ leaves 9.25G free on a 31.97G Volume Group

Expected results:
   --percent properly divides the free space in the VG and the VG consumes the free space on the drive

Additional info:
Below is our kickstart partitioning snippet:

part /boot --asprimary --fstype ext4 --label boot --size=500
part pv.01 --size 32768 
volgroup vg_sys --pesize=32768 pv.01
logvol /              --fstype ext4 --name rootfs  --vgname=vg_sys --size 250 --grow --percent=20
logvol /home          --fstype ext4 --name home    --vgname=vg_sys --size 100 --grow --percent=10
logvol /opt           --fstype ext4 --name opt     --vgname=vg_sys --size 1   --grow --percent=10
logvol /tmp           --fstype ext4 --name tmp     --vgname=vg_sys --size 1   --grow --percent=10
logvol /var           --fstype ext4 --name var     --vgname=vg_sys --size 384 --grow --percent=30
logvol /var/log       --fstype ext4 --name log     --vgname=vg_sys --size 1   --grow --percent=10
logvol /var/log/audit --fstype ext4 --name audit   --vgname=vg_sys --size 1   --grow --percent=10
logvol swap           --fstype swap --name swap    --vgname=vg_sys --size 4096

With RHEL 6.6 final partitioning after installation is:

[root@]# vgs
  VG     #PV #LV #SN Attr   VSize  VFree  
  
vg_sys   1   8   0 wz--n- 31.97g 320.00m

[root@]# lvs
  LV     VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
                                                      
  audit  vg_sys -wi-ao----  2.69g                                                    
  home   vg_sys -wi-ao----  2.78g                                                    
  log    vg_sys -wi-ao----  2.69g                                                    
  opt    vg_sys -wi-ao----  2.69g                                                    
  rootfs vg_sys -wi-ao----  5.62g                                                    
  swap   vg_sys -wi-ao----  4.00g                                                    
  tmp    vg_sys -wi-ao----  2.69g                                                    
  var    vg_sys -wi-ao----  8.50g


Starting form RHEL 6.7 (6.8) with the same snippet we get completely different partitioning schema:

[root@]# vgs
  VG     #PV #LV #SN Attr   VSize  VFree

  vg_sys   1   8   0 wz--n- 31.97g 9.25g

[root@]# lvs
  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
                                                  
  audit  vg_sys -wi-ao---- 992.00m                                                    
  home   vg_sys -wi-ao----   1.59g                                                    
  log    vg_sys -wi-ao----   1.09g                                                    
  opt    vg_sys -wi-ao----   1.34g                                                    
  rootfs vg_sys -wi-ao----   4.00g                                                    
  swap   vg_sys -wi-ao----   4.00g                                                    
  tmp    vg_sys -wi-ao----   1.22g                                                    
  var    vg_sys -wi-ao----   8.50g

Comment 4 David Lehman 2016-10-13 18:35:02 UTC
From the RHEL6 Installation Guide (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html):

--percent= — Specify the amount by which to grow the logical volume, as a percentage of the free space in the volume group after any statically-sized logical volumes are taken into account. This option must be used in conjunction with the --size and --grow options for logvol.



The behavior of --percent is different from RHEL7 forward, where it is a mutually-exclusive alternative to --size.

Comment 10 David Lehman 2016-11-03 18:25:44 UTC
My initial assessment was wrong. There is a simple bug in the code.

Comment 11 David Lehman 2016-11-04 18:22:18 UTC
Upstream pull request:

  https://github.com/rhinstaller/anaconda/pull/860

Comment 14 Marek Hruscak 2016-11-30 16:29:00 UTC
Issue is fixed, partitioning using --percent option in ks behave same as before in RHEL-6.6.

Comment 16 errata-xmlrpc 2017-03-21 11:09:39 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.

https://rhn.redhat.com/errata/RHBA-2017-0720.html


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