What boot technology is this system using?

Context

  • Windows 10 Home 21H1
  • Virtualbox 6.1
  • CentOS 8 VM
  • BIOS mode:

VirtualBox BIOS setting

Question

What boot technology is being used on this VM?

I suspect BIOS is loading a stage 1 MBR boot loader, which loads GRUB2. What's confusing is the far more modern layout of the /boot partition.

It feels like a hybrid of a systemd-boot prepped /boot, with systemd-boot style config, but BIOS, MBR and GRUB2 in control.

Analysis

I believe systemd-boot can only be used on UEFI systems with GPT disks that contain a FAT-based filesystem for /boot.

My installer hasn't created a legitimate systemd-boot Extended Boot Loader Partition (XBOOTLDR) as /dev/sda1 is XFS not FAT-based.

Given my VM is set to NOT use EFI (so has defaulted to BIOS), I believe CentOS 8 has created the correct directory structure for systemd-boot (/boot/loader/entries/), but on an incorrect partition type (XFS on non-ESP/XBOOTLDR). This is not a problem since I am using BIOS.

As far as I can tell, GRUB2 is being loaded by the MBR boot sector. GRUB2 is then picking up the boot menu fragments in /boot/loader/entries/?

/boot/efi/* are empty directories - I usually see them populated with a grub config file and EFI images.

/boot/grub2/ contains grub.cfg, device.map and i386-pc/*.mod - good signs of a healthy GRUB2 install.

There are entries indicating the system is using systemd-boot style config rather than plain GRUB:

[root@c8 ~]# cat /boot/loader/entries/7d05af5fc5db47fbb5e0c5c6d5bdece7-4.18.0-305.10.2.el8_4.x86_64.conf
title CentOS (4.18.0-305.10.2.el8_4.x86_64) 8
version 4.18.0-305.10.2.el8_4.x86_64
linux /vmlinuz-4.18.0-305.10.2.el8_4.x86_64
initrd /initramfs-4.18.0-305.10.2.el8_4.x86_64.img $tuned_initrd
options $kernelopts $tuned_params
id centos-20210720173403-4.18.0-305.10.2.el8_4.x86_64
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel

Disk inspection

MBR disk and msdos partition table:

[root@c8 ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   80G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   79G  0 part
  ├─cl-root 253:0    0 49.8G  0 lvm  /
  ├─cl-swap 253:1    0    5G  0 lvm  [SWAP]
  └─cl-home 253:2    0 24.3G  0 lvm  /home
sr0          11:0    1 1024M  0 rom

[root@c8 ~]# parted -l /dev/sda
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 85.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  xfs          boot
 2      1075MB  85.9GB  84.8GB  primary               lvm


[root@c8 ~]# file -sL /dev/{sda,sda1}
/dev/sda:  DOS/MBR boot sector
/dev/sda1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)

[root@c8 ~]# df -hTP
Filesystem          Type      Size  Used Avail Use% Mounted on
/dev/mapper/cl-root xfs        50G  6.1G   44G  13% /
/dev/sda1           xfs      1014M  407M  608M  41% /boot

Unable to inspect the image loaded by the firmware - another sign BIOS is in charge:

[root@c8 ~]# bootctl status
Couldn't find EFI system partition. It is recommended to mount it to /boot or /efi.
Alternatively, use --path= to specify path to mount point.
System:
    Not booted with EFI

[root@c8 ~]# efibootmgr -v
EFI variables are not supported on this system.

As of Fedora 30, the distribution's GRUB2 package comes with a new "blscfg" module which reads Boot Loader Specification config files and produces GRUB menu items.


In general, GRUB configuration can come from many sources. The standard grub.cfg is generated through extensible scripts, some of which are installed by separate packages (such as os-prober), and is not limited to just collecting a list of kernels from /boot – there would be nothing particularly unusual if your distro instead had grub-mkconfig that transformed /boot/loader/entries into a grub.cfg.