GRUB2 Quick Start

This article provides information on how to get up and running with grub:2 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 your world file. For example:

Only one version may be installed in your MBR at one time.

Installing the software
Set GRUB_PLATFORMS in make.conf (optional). If unset, grub will guess which platform you want. It guesses "pc" for x86/amd64.

Run emerge.

Installing a bootable image
Mount your /boot volume if you have one.

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

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

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

Installing to the MBR:

Installing to a partition (not recommended):

Installing on EFI:

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

grub2-mkconfig generates the config file based on template sections in /etc/grub.d. The default templates should cover most common boot setups.

The behavior of these templates may be controlled by setting variables in /etc/default/grub. See the GRUB manual for reference.

Kernel naming
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

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

Generate the grub.cfg file:

Silent Kernel Decompression
To silence kernel decompression make your line in /etc/default/grub look like this.

systemd
to boot systemd with grub2 make your line look like this

Loading another operating system
grub2-mkconfig can generate a configuration to load other operating systems. This requires the package.

To boot Windows, you should also install to allow grub2-mkconfig to probe NTFS filesystems.

Manual Configuration
Instead of using, a typical simple   can easily be converted to be suitable for use in.