
78 Chapter 4. GRUB
Note
Some filesystems, as well as filesystem configurations, may require a Stage 1.5 file that essentially
bridges the gap between the primary and secondary boot loaders.
For example, if the Stage 2 boot loader file is on a partition using a filesystem that the Stage 1 boot
loader cannot access, it is possible to direct the Stage 1 boot loader to load additional instructions
from the Stage 1.5 file that allows it to read the Stage 2 boot loader file. For more information, refer
to the GRUB info page.
The aforementioned boot method is called direct loading, because instructions to directly load the
operating system are used, with no intermediary code between the boot loaders and the operating sys-
tem’s main files (such as the kernel). The boot process used by different operating systems may differ
slightly from the above, however. For example, Microsoft’s DOS and Windows operating systems
tend to completely overwrite anything on the MBR when they are installed without incorporating any
of the current MBR’s configuration. This destroys any other information stored in the MBR by other
operating systems, such as Red Hat Linux. The Microsoft operating systems, as well as various other
proprietary operating systems, are loaded using a chain loading boot method. With this method, the
MBR simply points to the first sector of the partition holding the operating system, where it finds the
special files necessary to actually boot that operating system.
GRUB supports both direct and chain-loading boot methods. It is possible to use it with almost any
operating system, most popular filesystems, and almost any hard disk the system BIOS can recognize.
4.1.2. GRUB Features
GRUB contains a number of features that make it preferable to other available boot loaders. These are
some of the most important:
• GRUB provides a true command-based, pre-OS environment on x86 machines to allow maximum
flexibility in loading operating systems with certain options or gathering information about the sys-
tem. Many non-x86 architectures have employed pre-OS environments for years that allows control
over how the system boots from a command line. While some command features are available with
LILO and other x86 boot loaders, GRUB contains a greater number of features.
• GRUB supports Logical Block Addressing (LBA) mode. LBA places the addressing conversion used
to find files on the drive in the drive’s firmware, and it is used on many IDE and all SCSI hard disks.
Before LBA, hard drives could encounter a 1024-cylinder limit, where the BIOS could not find a file
after that point, such as a boot loader or kernel files. LBA support allows GRUB to boot operating
systems from partitions beyond the 1024-cylinder limit, so long as the system BIOS supports LBA
mode (most do).
• GRUB’s configuration file is read from the disk every time the system boots, preventing the user
from having to write over the MBR every time a change the boot options is made. Most boot load-
ers are not sophisticated enough to read configuration files and use them to set up boot options.
For example, to change a LILO boot configuration, such as changing the default operating system
to boot, users must change a LILO configuration file and run a command that overwrites the sys-
tem’s MBR with the new configuration data. This is more risky than GRUB’s method, because a
misconfigured MBR would leave the system unbootable. With GRUB, if the configuration file is
erroneously configured and rebooted, it will simply default to a command line and allow the user
to manually type commands that will launch the operating system. The MBR is not touched except
to update the Stage 1, Stage 2, or menu configuration file locations, and this is rarely necessary.
Commenti su questo manuale