I can not figure out how grub2, then initramfs, and kernel have been loaded without /boot?
Because all those things will have already happened before /etc/fstab is read.
- the firmware loads GRUB
- GRUB loads the kernel & initramfs;
- the kernel starts init;
- init reads /etc/fstab.
Therefore neither the firmware nor GRUB can depend on /etc/fstab – they use their own mechanisms:
BIOS firmwares always run the bootcode from the disk's 0th sector (where the MBR is). In your case, that 0th sector would have the GRUB stage1.
UEFI firmwares keep boot configuration in NVRAM – the RHEL installer configures it to look for grubx64.efi
in an "EFI system partition", which is detected by UUID.
Once GRUB is started, it already knows its own partition, finds grub.cfg
in it, and searches for the Linux kernel based on UUID defined there. (Of course, grub.cfg
is often generated based on fstab contents during installation.)
(GRUB has its own drivers for ext4 and even LVM. Some bootloaders, e.g. systemd-boot, use UEFI to access files in the "EFI system partition". LILO used to remember the kernel's sector position on disk, I think.)
The other reason is that /etc/fstab is an OS-specific configuration, therefore having GRUB directly depend on it would prevent it from correctly booting operating systems which don't have such a fstab.
(The same is even more important for the first step (firmware loading GRUB). Just think about it – if /etc/fstab was required for that, how would the firmware boot Windows?)
Note, however, that /boot
needs to be in fstab – or mounted some other way – for kernel updates to work correctly. If you forget to mount /boot, the next upgrade will install new modules but not the kernel itself. Since you cannot mix different kernel and module versions, the system won't boot correctly.