[NTLUG:Discuss] GRUB boot process

Jerome Haltom wasabi at larvalstage.net
Sat Oct 27 16:59:10 CDT 2007


Honestly we're talking about a 2000 line code base. So it really is
easier to just read it. However.

On Mon, 2007-10-22 at 18:40 -0500, Leroy Tennison wrote:
> Got to thinking about the boot process and came up with a question which 
> wasn't clearly (at least to me) addressed in the documentation.
> 
> 'info grub' says that stage1 is placed in the MBR (or the boot sector of 
> the partition), the physical address of stage2 is embedded in stage1 and 
> that stage2 contains values for the partition (etc.) and "the name of a 
> configuration file"
> 
> My assumption (which is also my question) is that stage2 can determine 
> the file system type from the partition table, mount that filesystem 
> using filesystem-specific methods and then read the embedded 
> configuration file to either present a menu or determine the 
> kernel/initrd files to use for booting.  Is this correct?

Stage 1 goes on the MBR. Stage 1.5 goes in the boot sector. Stage 1.5
has a file system module embedded into it which is capable of reading
from /boot. Stage 2 is loaded from /boot by Stage 1.5. Stage 2 loads
menu.lst, has other file system drivers, and can finally display a
prompt and boot the system

> The reason for my question was that there seemed to be a gap in 
> explanation between how stage1 found/loaded stage 2 and how stage2 
> found/used the menu file

That gap is stage 1.5:

wasabi at kyoto:/boot/grub$ ls /boot/grub/*1_5
/boot/grub/e2fs_stage1_5  /boot/grub/minix_stage1_5
/boot/grub/fat_stage1_5   /boot/grub/reiserfs_stage1_5

> .
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list