Using UEFI for RHEL VM Instead of BIOS questions

Latest response

Getting ready to move away from RHEL5 and to RHEL6 and I want to take advantage of tools like gdisk Vs fdsik, and I believe if I were to enable UEFI when building out the new RHEL6 systems will allow me to do this, correct?

I've noticed when that I've enabled UEFI for the RHEL6 VM, that there is a partition that appears when building out, called /boot/efi. Typically when building and using BIOS, and creating a /boot partition, I never placed this under LVM, would this still be the same, or can we pub /boot/efi under LVM?

Also I wondering if anyone has had issues where they might have a RHEL VM that was created with BIOS or maybe with UEFI and then they had to swing disks to the opposite boot loader and if there were any issues?

The reason I'm asking is that I googled around and wasn't able to find any exact info on this topic, or I wasn't searching with the correct terms.

thanks

Responses

The EFI spec mandates that a firmware implement the ability to read/write the FAT32 ESP. No more than that, so a firmware doesn't need to implement Linux LVM or any other filesystem type.

I don't know if any virtual implementation of EFI firmware has the ability to read Linux LVM, but I doubt any hardware vendor is implementing that, so it doesn't sound like a good habit to get into.

Ok, so to me it sounds like if using UEFI, have to setup like a /boot partition. It has to fall outside of an LVM scheme. I don't place /boot in any LVM when using BIOS.

thanks

Just noticed that I created /boot/efi not under LVM, I keep getting a Bootable partitions cannot be on a logical volume error.

This is a RHEL6 VM in vCenter.

So do I still need a /boot as well in addition to /boot/efi too, in order to make this work?

For the heck of it, I gave it /boot as well as /boot/efi and I was able to move forward with the RHEL6 install, however this seems odd to me.

Yes, you still need a (ext2/3/4) /boot partition and a FAT /boot/efi ESP.

Have a look at: RHEL6 - Installation Guide - ⁠E.2.2. GRUB and the Boot Process on UEFI-based x86 Systems

Notice the EFI binary run is actually the GRUB bootloader, so the firmware reads grub.efi from the ESP, then GRUB loads and reads its bootloader entries from /boot and then we boot into the kernel (or memtest or an ISO or whatever other options you have in GRUB). That's why you need both.

It is also possible to launch directly into Linux kernel from the EFI firmware by running the kernel as an EFI executable, but this requires EFISTUB which was added in kernel 3.3. Reading https://wiki.archlinux.org/index.php/EFISTUB that implies you only need the ESP containing the kernel and the initramfs, not the bootloader partition.

I haven't setup EFI boot on RHEL7, but from RHEL7 - Installation Guide - ⁠6.14. Installation Destination it doesn't look like we've used EFISTUB, we still boot into GRUB and let it load the kernel, so you'd still need both /boot and /boot/efi there too.

The /boot/efi will auto format itself as FAT correct? I don't remember seeing this, however I can check again to be certain.

The installer will default to FAT for the ESP. I don't know if any firmware supports formatting an ESP, I wouldn't expect so. It's our job as system administrator to setup the ESP properly so the firmware can read it.

You are quite right. UEFI requires both. Here is an example from built HP BL460c Gen9 servers (running RHEL 7.2 and 7.3):

$ lsblk
NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                       8:0    0   512M  1 disk
└─sda1                    8:1    0 509.9M  1 part
sdb                       8:16   0 223.6G  0 disk
├─sdb1                    8:17   0   512M  0 part /boot/efi
├─sdb2                    8:18   0     2G  0 part /boot
├─sdb3                    8:19   0    39G  0 part
│ ├─os-swap             253:0    0     2G  0 lvm  [SWAP]
│ ├─os-usr              253:1    0     8G  0 lvm  /usr
│ ├─os-root             253:2    0     2G  0 lvm  /
│ ├─os-home             253:3    0     1G  0 lvm  /home
│ ├─os-var              253:4    0     8G  0 lvm  /var
│ ├─os-opt              253:5    0     8G  0 lvm  /opt
│ ├─os-var_log          253:6    0     4G  0 lvm  /var/log
│ ├─os-var_log_audit    253:7    0     4G  0 lvm  /var/log/audit
│ └─os-tmp              253:8    0     2G  0 lvm  /tmp

For HP blades with P140 controller it is even a bit messier because one needs to load driver for RAID controller before installing the O/S. It means enabling "Virtual floppy" in UEFI as well as "Virtual DVD/CD"...

RHEL 7 doesn't required the EFI to be formated vfat. I believe that the 3.10 kernel has the stub code to support various file systems other then vfat. Every system I have built using efi uses either ext4 or xfs. I hope others have had that same experience.

Here's from my RHEL7 test VM on VirtualBox 5.1.26, set up to use UEFI:

[root@rhel7test-localdomain ~]# mount |grep sda
/dev/sda2 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)

[root@rhel7test-localdomain ~]# lsblk --fs
NAME          FSTYPE     LABEL UUID                                   MOUNTPOINT
sda                                                                   
├─sda1        vfat             9420-D70C                              /boot/efi
├─sda2        xfs              ec1f7fe7-f00a-423e-a0d9-01a295538d49   /boot
└─sda3        LVM2_membe       fEXQQ7-i1H4-fVN2-SU39-Myop-vjxV-2xfgf9 
  ├─rhel-root xfs              62c187a5-70e3-4655-a889-c475fb4d7e7f   /
  └─rhel-swap swap             f6358cac-e066-442f-8d8f-41784afa3dfe   [SWAP]

The ESP partition mounted at /boot/efi is clearly FAT, but the /boot partition can be anything the kernel+initrd can support.

In order to use non-FAT filesystem on the ESP partition, the installer would have to have specific knowledge about filesystem support of specific system models/firmware versions, since the UEFI specification says that FAT is the only filesystem type that must be supported by the UEFI firmware.

If you are saying you have systems with /boot/efi being an ext4 or xfs filesystem, I would REALLY want to know the make and model of those systems.

jamie++

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.