I have read that GRUB can read ext2 filesystems and has modules for doing this. What is the location of the mod on a Redhat system and how about if the /boot partition is ext3/ext4 or other filesystem type?
How is GRUB able to read it’s config file on ext3 fileystem
bootfilesystemsgrub
Related Solutions
US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-grub-whatis.html
GRUB loads itself into memory in the following stages:
The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR[1]. The primary boot loader exists on less than 512 bytes of disk space within the MBR and is capable of loading either the Stage 1.5 or Stage 2 boot loader.
The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader, if necessary. Some hardware requires an intermediate step to get to the Stage 2 boot loader. This is sometimes true when the /boot/ partition is above the 1024 cylinder head of the hard drive or when using LBA mode. The Stage 1.5 boot loader is found either on the /boot/ partition or on a small part of the MBR and the /boot/ partition.
The Stage 2 or secondary boot loader is read into memory. The secondary boot loader displays the GRUB menu and command environment. This interface allows selection of the kernel or operating system to boot, pass arguments to the kernel, or look at system parameters.
It seems rather obvious stage 2 is the actual grub binary. In fact, the documentation states grub 2 is loaded by name.
I would try to do:
dd if=/dev/zero of=/boot/stage2
Additional data:
Inspecting /boot/grub:
copy of stage1 bootloader:
stage1
Files for stage1_5:
e2fs_stage1_5
fat_stage1_5
jfs_stage1_5
minix_stage1_5
reiserfs_stage1_5
xfs_stage1_5
File for stage2:
stage2
Link to grub image:
After using ghex to examine my "BOOTX64.EFI" file in the efi partition I found this line.
search.fs_uuid a43d1f11-6ebe-477d-8be3-321a33bc37f9 root hd2,gpt4
set prefix=($root)'/boot/grub'
This shows that the information for the location of grub (the boot partition) has been embedded by grub2-install into the BOOTX64.EFI file generated for the system.
Grub2 is then executed by the EFI loader and you get the grub interface to choose the operating system (kernel) to boot into or the default kernel is loaded.
Just to expand a bit: ".EFI" files are kind of like applications that the UEFI subsystem can execute. Intended to be used to both boot the system and provide a convenient place to run execution protection and anti-virus type programs.
They put the extensible in "Unified Extensible Firmware Interface"
Best Answer
The grub ext2 module also understands ext3 and ext4, as the differences are minimal. The module itself is built into the grub
core.img
file ( when you are using ext[234] for /boot ), which is normally copied into the sectors following the master boot record, before any partitions start, and the code in the master boot record just loads those subsequent sectors.