Originally written: 9/23/2011; last update: 7/7/2018
This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!
|Donate $1.00||Donate $2.50||Donate $5.00||Donate $10.00||Donate another value|
This page is part of my Managing EFI Boot Loaders for Linux document. If a Web search has brought you to this page, you may want to start at the beginning.
The GRand Unified Bootloader (GRUB) is actually two boot loaders. This page describes GRUB Legacy, which is the first, and now officially discontinued, version of the boot loader. The next page, Using GRUB 2, describes the current version of the boot loader. The official version of GRUB Legacy doesn't support EFI booting; however, through version 17, Fedora used a greatly modified version that includes EFI support. This page therefore describes this variant of GRUB Legacy.
GRUB Legacy is, in some respects, a step up from ELILO and SYSLINUX, in that it provides some valuable extra features. It has, however, been discontinued in favor of GRUB 2.
Overall, conditions when you might want to consider using GRUB Legacy include:
Conditions in which you should almost certainly not use GRUB Legacy include:
As a general rule, GRUB Legacy proved reliable to me; however, I have not used it since 2013 or thereabouts. I have encountered significant system-to-system differences in how well it has worked. Specifically:
Because Fedora's version of GRUB Legacy is so heavily modified, installing it on other distributions can be a challenge. I provide links to both RPMs and tarballs below to help overcome this problem.
Overall, in 2018 GRUB Legacy is probably best left unused, and this page should be considered mainly of historical interest. Its main advantage at this point is that it's a simple boot loader that can both chainload to other EFI boot programs and load a Linux kernel from a supported Linux-native filesystem. Neither ELILO nor SYSLINUX can do these things; and although GRUB 2 can do them, it's much more complex to set up if you must do so manually.
GRUB Legacy installation works just as described in EFI Boot Loader Installation. If you're using a Fedora 17 or earlier system, GRUB Legacy should have been automatically installed for you, so you might not need to do anything else. (Fedora 18 has switched to GRUB 2 for EFI-mode booting.) If you're not using a Fedora system, here are links to some relevant package files from Fedora 17:
Fedora 17's grub package installs only the EFI version of GRUB Legacy. This package places the grub.efi file in the /boot/efi/EFI/redhat directory. Thus, if you installed this package with the ESP unmounted, you should copy this file out before you mount the ESP at /boot/efi, then copy it back to its proper location.
GRUB Legacy normally installs a grub.efi file to the ESP and reads its configuration file, grub.conf, from the same directory as the grub.efi file. (The configuration file's name should be the same as the boot loader's filename but with a .conf extension, so if you rename the boot loader, you should rename its configuration file, too.) GRUB Legacy reads the Linux kernel, the initial RAM disk, and other support files from Linux's /boot directory. This directory must be on a filesystem that GRUB Legacy supports, such as ext2fs, ext3fs, ext4fs, ReiserFS, XFS, JFS, Btrfs, or FAT. If your computer uses a Linux RAID or Logical Volume Manager (LVM) setup, you must place the /boot directory on a regular partition outside of the RAID or LVM setup.
GRUB Legacy's configuration file, grub.conf (or menu.conf for some versions, although not for Fedora's modified version), provides global options and a series of stanzas describing individual kernels or chainload options. This file's format is nearly identical on EFI systems as on BIOS systems, so if you're used to configuring GRUB Legacy on BIOS systems, you should have no problems on EFI computers. (An exception is how you chainload another boot loader.) An example file looks like this:
default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz #hiddenmenu title Fedora (3.5.4-1.fc17.x86_64) root (hd0,3) kernel /vmlinuz-3.5.4-1.fc17.x86_64 ro root=/dev/sda5 rhgb quiet initrd /initramfs-3.5.4-1.fc17.x86_64.img title Fedora (3.5.1-1.fc17.x86_64) root (hd0,3) kernel /vmlinuz-3.5.1-1.fc17.x86_64 ro root=/dev/sda5 rhgb quiet initrd /initramfs-3.5.1-1.fc17.x86_64.img title Windows 7 root (hd0,0) chainloader /EFI/Microsoft/Boot/bootmgfw.efi
You can cut and paste this example and modify it for your own needs. Some key points when you make your modifications include the following:
When GRUB Legacy is launched, you'll see a menu of boot options, each named after a title line in the configuration file. Select one and the associated kernel or EFI boot loader should launch. An example is shown below (note that it doesn't match the example configuration file earlier).
Distributions that ship with GRUB Legacy generally include scripts that update its configuration whenever you install a new kernel. Thus, you shouldn't have to do much to keep GRUB Legacy working in normal operation, at least not on a Linux-only installation and if you use the version of GRUB Legacy that shipped with your distribution. (I've not tested these scripts with modern distributions, though.) If you multi-boot several OSes, you may need to re-adjust your configuration whenever you upgrade your kernel, since the scripts might not get these details right. Likewise if you installed Fedora's GRUB Legacy on another distribution, since that distribution might try to modify grub.conf or menu.lst in /boot/grub rather than in /boot/efi/EFI/grub (or wherever you install the grub.efi file). You may also need to add, delete, or modify stanzas as you make changes to other OSes.
Go on to "Using GRUB 2"
Return to "Managing EFI Boot Loaders for Linux" main page
copyright © 2011–2018 by Roderick W. Smith
If you have problems with or comments about this web page, please e-mail me at firstname.lastname@example.org. Thanks.
Return to my main Web page.