[NTLUG:Discuss] GRUB boot process
Jerome Haltom
wasabi at larvalstage.net
Sun Oct 28 13:23:33 CDT 2007
On Sat, 2007-10-27 at 21:14 -0500, Robert Citek wrote:
> On 10/27/2007 04:59 PM, Jerome Haltom wrote:
> > 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
>
> I'm still not quite clear about this. If I understand you correctly:
>
> - stage 1 is in the first 512 of the drive (e.g. /dev/hda)
> - stage 1.5 is in the first 512 bytes of the partition (e.g. /dev/hda1)
> - stage 2 is in the /boot/grub directory (e.g. on /dev/hda1/ mounted at /)
>
> I was under the impression that any boot loading code had to be smaller
> than 446 bytes[1]. Yet, stage1 is larger at 512 bytes, which doesn't
> leave any room for a partition table:
When installing the MBR, grub overlays the important parts of the
existing MBR (the partition tables).
>
> -rw-r--r-- 1 root root 512 2007-09-25 13:42 /boot/grub/stage1
>
> Also, I was under the impression that the boot sector was also limited
> to 512 bytes, which wouldn't be enough room for any of these stage1_5 files:
The boot sector is not. The boot sector is limited to "however much the
file system gives you". We are talking about writing data at the
beginning of a file system. The file system itself has to be smart
enough to leave enough space, and to not get clobbered by arbitrary
people writing data there. Traditionally they leave enough that it's not
going to cause a problem.
For example, XFS does not leave room for a boot sector.
>
> -rw-r--r-- 1 root root 7776 2007-09-25 13:42 /boot/grub/e2fs_stage1_5
> -rw-r--r-- 1 root root 7504 2007-09-25 13:42 /boot/grub/fat_stage1_5
> -rw-r--r-- 1 root root 8320 2007-09-25 13:42 /boot/grub/jfs_stage1_5
> -rw-r--r-- 1 root root 7008 2007-09-25 13:42 /boot/grub/minix_stage1_5
> -rw-r--r-- 1 root root 9216 2007-09-25 13:42 /boot/grub/reiserfs_stage1_5
> -rw-r--r-- 1 root root 9288 2007-09-25 13:42 /boot/grub/xfs_stage1_5
>
> What am I missing? Are my understanding of the MBR and boot sector
> incorrect? Did I misunderstand what you wrote? Or something else?
>
> [1] http://en.wikipedia.org/wiki/Master_boot_record
>
> Regards,
> - Robert
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
More information about the Discuss
mailing list