|
From: | Chris Murphy |
Subject: | Re: bootloader question about GRUB |
Date: | Sat, 1 Dec 2012 12:45:03 -0700 |
The bulk of GRUB Legacy and GRUB 2 is placed into the MBR gap, from LBA 1 to 62. But sometimes GRUB2's core.img is bigger which is why it's better to have a larger gap. Most partition tools now start partition 1 at LBA 2048, leave 2047 sectors for GRUB in the gap. For GPT disks, and BIOS which can support GPT, it's better to have a 1MB partition with the partition type of BIOS Boot, which GRUB 2's installer finds automatically and installs diskboot.img and core.img. This is the safest approach. The block list approach you seem to be referring to isn't guaranteed to not conflict with an existing filesystem, or more correctly while GRUB probably won't step on anything the file system has reserved for itself, the file system can't know about about GRUB's usage, so the file system could step on GRUB and make the system unbootable. This is why blocklists are discouraged. More here in the section for GRUB Legacy users:
This is part of installing GRUB to the disk or partition, you won't find hints in the config file at all. All of this happens before the config file is produced or read by GRUB.
Realize that partition boot sectors are a myth. For example XFS doesn't have one. ext[234]'s boot sector is only 512 bytes so it's essentially unusable. This is not big enough for GRUB to be installed onto a partition, which is why it's not recommended. But some people are stubborn and do things that aren't a good idea anyway, and in that case block lists are used.
Check out GRUB documentation on block lists. That should answer your question. It basically splits itself into pieces, with code to chain load those pieces sequentially until enough is loaded that it can then find grub.conf (or now grub.cfg for GRUB 2). It does not notify the file system of these pieces, it does not adjust the partition table. The pieces are subject to being overwritten at anytime by the host file system. Chris Murphy |
[Prev in Thread] | Current Thread | [Next in Thread] |