GRUB2 Quick Start

This article provides information on how to get up and running with GRUB2 in the simplest configurations. For more comprehensive information, see GRUB2.

Gentoo GRUB Legacy (0.97) to GRUB2 Migration Guide
The guide is available here.

GRUB Slots
The package is slotted; both grub-0.97 and grub-2.00 may be installed at the same time.

If you want to install grub-0.97 or keep it installed after an upgrade, call emerge with the "0" slot on the end of the package atom. This will add sys-boot/grub:0 to the system's world file. For example:

Installing the Software
First set the  variable in  (optional). If unset, GRUB2 will guess which platform you want. It guesses "pc" (which is not UEFI; see examples below) for X86/AMD64 architecture.

After the variable is get, then emerge the software:

Installing a Bootable Image
Mount your volume if you have one.

If you are using an EFI platform, mount your EFI system volume at. This should be a FAT formatted volume containing an EFI subdirectory.

Run the grub2-install utility to copy the relevant files to. On the PC platform, this also installs a boot image to the Master Boot Record (MBR) or a partition's boot sector.

The grub2-install command accepts a --target option to specify which CPU/Platform to install. If unspecified, grub2-install will make a guess; on X86/AMD64 it will use "i386-pc" by default.

Installing GRUB2 to the MBR:

Installing GRUB2 to a partition (not recommended):

Installing GRUB2 on an EFI capable system:

Automatic Configuration
GRUB2 is traditionally configured by using the grub2-mkconfig program to generate a configuration file.

grub2-mkconfig generates the configuration file based on template sections located in. The default templates should cover most common boot setups.

The behavior of these templates can be controlled by setting variables in. See the GRUB manual for reference.

Kernel Naming Schemes
In order for grub2-mkconfig to detect your Linux kernel(s), they must be named vmlinuz-version or kernel-version.

For example: /boot/vmlinuz-3.4.3 /boot/kernel-2.6.39-gentoo /boot/kernel-genkernel-x86_64-3.17.1-gentoo-r1

If you use an initramfs, it should be named initramfs-version.img or initrd-version.img. File names generated by genkernel will also work.

For example: /boot/initramfs-3.4.3.img /boot/initramfs-genkernel-x86_64-2.6.39-gentoo

Generate the file:

Silent Kernel Decompression
To silence kernel decompression make your line in look like this.

Systemd
To boot systemd while using GRUB2 make the  variable look like this:

Loading Another Operating System
grub2-mkconfig can also generate configurations to load other operating systems. To do this requires the package.

To boot Windows, the also needs to be installed. It allows for the grub2-mkconfig utility to probe NTFS filesystems.

Manual Configuration
Instead of using grub2-mkconfig, a typical simple (the configuration file used for GRUB) can easily be converted to be suitable for use in.