Bug 998710

Summary: Add LVM support for /boot.
Product: Red Hat Enterprise Linux 7 Reporter: Alasdair Kergon <agk>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
lvm2 sub component: Activating existing Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: medium CC: adshaikh, agk, amote, aperotti, baumanmo, bmarzins, bmr, chorn, christoph.karl, coughlan, dconsoli, dlehman, dwysocha, heinzm, jbrassow, jonathan, loberman, lsmid, lvm-team, mrichter, msnitzer, mthacker, ngompa13, pablo.iranzo, pdwyer, prajnoha, prockai, robine, rvdwees, rvokal, tbowling, vanhoof, zkabelac
Version: 7.0Keywords: FutureFeature, Triaged
Target Milestone: rc   
Target Release: 7.3   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 872576
: 1243449 (view as bug list) Environment:
Last Closed: 2017-07-26 14:42:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 760243, 760258, 1496229    
Bug Blocks: 1164947, 794823, 1008418, 1205796, 1243449, 1298243, 1411715, 1469559    

Description Alasdair Kergon 2013-08-19 20:28:32 UTC
Add LVM support for /boot.

LVM already added pvcreate --embeddingareasize and pvs -o +ea_start,ea_size to create an embedding area within a PV and reports it via pvs (the embedding area start is subject to alignment and it's calculated by LVM tools).

Grub can use this space that is specifically reserved for external tools to embed their data/metadata. The aim is to remove a need for partitions (also GPT's "boot" type partition) and also have a way to reserve a space that LVM will not touch at all and which can be exclusively used by external tools.

This bug covers the remaining work needed on the LVM/grub interface for full /boot support.

Comment 7 Mark Thacker 2016-11-30 21:10:28 UTC
Would like to see this as well. Also, would this be an enabler for other activities such as booting from a snapshot with a grub menu item?

Comment 8 Terry Bowling 2016-12-02 13:53:21 UTC
This would be a great feature allowing RHEL 7 to use only LVM and no old-school partitions.

This would provide much greater flexibility with disk imaging and our own RHEL cloud images which currently do not use lvm for /dev/sda.  So if I deploy a cloud image, I cannot easily resize the disk limiting my flexibility in use the cloud image as a gold image foundation for my deployments.

Comment 12 Mark Thacker 2017-02-01 19:09:57 UTC
Deferring to RHEL 7.5.

Comment 13 Bryn M. Reeves 2017-06-16 10:56:32 UTC
> This would provide much greater flexibility with disk imaging and our own RHEL 
> cloud images which currently do not use lvm for /dev/sda.  So if I deploy a 
> cloud image, I cannot easily resize the disk limiting my flexibility in use the 
> cloud image as a gold image foundation for my deployments.

I can understand the limitation here, in terms of conventional partitions not allowing straightforward resize, but it's not quite clear to me why being able to place /boot on LVM2 would fix it?

What's the restriction that prevents the cloud images from using LVM devices on sda in this scenario? (with a conventional partition for /boot as in a regular installation).

Comment 15 Jonathan Earl Brassow 2017-07-26 14:42:39 UTC
We would like to add more boot time features, like booting to a snapshot (or group of snapshots); but eliminating /boot is a tall order - especially with UEFI booting.  This may never happen and certainly won't happen in RHEL7.

Comment 16 Christoph Karl 2020-03-10 11:49:46 UTC
Currently I need two block devices to setup a VM.
One as a PV for LVM (without partioning for resize reasoning) and one only for /boot.
Would be a bit easier, if I only need one block device per VM.

Comment 17 Christian Horn 2020-03-11 00:09:26 UTC
(In reply to Christoph Karl from comment #16)
> Currently I need two block devices to setup a VM.
> One as a PV for LVM (without partioning for resize reasoning) and one only
> for /boot.
> Would be a bit easier, if I only need one block device per VM.

RHEL7 and 8 can still be installed with "everything on one partition", 
I think you are referring to that.

$ cat /proc/partitions 
major minor  #blocks  name

 253        0  150994944 vda
 253        1    8388608 vda1
  11        0    1048575 sr0

Comment 18 Christoph Karl 2020-03-11 07:27:09 UTC
Currently I have:
>lsblk                                                                                               
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                                    
vda           252:0    0    1G  0 disk 
└─vda1        252:1    0 1023M  0 part /boot
vdb           252:16   0   50G  0 disk 
├─rhel-root   253:0    0   40G  0 lvm  /
└─rhel-lvlogs 253:1    0    2G  0 lvm  /logs

Two block devices: vda und vdb.
The PV on vdb must be without partitioning so I can resize the PV.

I want to have:
>lsblk                                                                                               
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                                    
vda           252:0    0   50G  0 disk 
├─rhel-root   253:0    0   40G  0 lvm  /
└─rhel-lvlogs 253:1    0    2G  0 lvm  /logs

Only one block device: vda
Reasoning:
*) Only one block device per VM
*) I can online-resize any filesystem in this VM

Comment 19 Christoph Karl 2020-03-11 07:29:04 UTC
This would also be OK:
>lsblk                                                                                               
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                                    
vda           252:0    0   50G  0 disk 
├─rhel-root   253:0    0   40G  0 lvm  /
├─rhel-boot   253:1    0 1023M  0 lvm  /boot
└─rhel-lvlogs 253:2    0    2G  0 lvm  /logs

Comment 20 Christian Horn 2020-03-11 07:40:40 UTC
Both of the variants you aim at have /boot on LVM, which will for the time
being not become supported, the bugzilla state reflects this.

The next best thing for you might be:
- to have a single blockdevice into the guest
- to have /boot on a partition (which is not resizable in very
  flexible ways, so the size should be chosen carefully)
- to have a further partition, and inside LVM.
  In case you extend the blockdevice in the future, you can
  just add a further partition and use it to extend the VG.
  Alternatively, you can consider to extend the partition 
  and resize the existing PV.

$ lsblk
NAME                   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda                    252:0    0   72G  0 disk 
├─vda1                 252:1    0    1G  0 part /boot
└─vda2                 252:2    0   71G  0 part 
  └─rhel_rhel8u2b-root 253:0    0   45G  0 lvm  /

Comment 21 Christoph Karl 2020-03-11 08:02:36 UTC
AFAIK "adding further partitions" and "extending a partition" are not supported:
https://access.redhat.com/solutions/199573

I see this as a feature request not as a bug report.
Currently I stick to two block devices.

Comment 22 Christian Horn 2020-03-12 01:11:51 UTC
I think the bugzilla refers to resizing of a partition which is in use.

Following 2 variants should still be open:

- If really / of the guest should be resized (low chances this is
  required, I think), then one could boot a rescue system and
  do an offline resize of the partition.
- When the underlying blockdevice got enlarged, one could still
  add an additional partition, use pvcreate, extend an LVM volume
  and with this take usage of the additional space