GRUB illustration by Karol Kreński.
|Original author(s)||Erich Boleyn|
|Written in||C, assembler|
|Operating system||Can load Linux, macOS, BSD, Windows, Solaris|
|Platform||IA-32, x86-64, IA-64, ARM, PowerPC, s390x, MIPS and SPARC|
GNU GRUB (short for GNU GRand Unified Bootloader) is the most common boot loader on modern GNU/Linux operating systems. It can be loaded from older computers with a BIOS that loads the bootloader off the first sector on a HDD or modern machines UEFI firmware that load boot loaders off a special EFI partition.
There have been three major versions released by the GNU Project. GRUB 2 is the modern versions most machines using GRUB use today.
The GRUB2 bootloader is (typically) configured in either
/boot/efi/EFI/<distribution>/grub.cfg. This is the file GRUB loads when it looks to see how it is configured. However, it is typically not the file end users should use to configure it.
End-user GRUB2 configuration is typically done with a configuration file with variables in
/etc/default/grub. There may or may not be a symbolic link to that file in
/etc/sysconfig/grub. That file should be a POSIX compliant list of variables such as:
The GRUB2 configuration utility
grub2-mkconfig can be used to generate GRUB2 configuration files using the settings in the
/etc/default/grub configuration file together with a series of POSIX compliant shell scripts in
/etc/grub.d/. Special menu entries, GRUB2 themes and other custom GRUB2 configuration can be done by adding custom scripts that add custom settings in
Most GNU/Linux distributions will call
grub2-mkconfig semi-regularly. Some will call it when GRUB2 packages are updated, some call it every time a new kernel is installed. Some modern GNU/Linux distributions keep a mostly static GRUB2 configuration file and add kernel-specific loader entries as files in
You should configure GRUB2 using the
/etc/default/grub configuration file and optionally scripts dropped into in
/etc/grub.d/ and run
grub2-mkconfig -o /boot/efi/EFI/<distribution>/grub.cfg (some distributions like to rename
grub-mkconfig for historical compatibility).
You can just go right ahead and make your custom changes to
/boot/efi/EFI/<distribution>/grub.cfg if you really want to, but you can't expect those changes to last; your distribution will update/re-generate it automatically sooner or later and your changes will be lost.
Adding Custom Fonts
GRUB2 may end up showing you really tiny text in the boot loader menu. That is specially true if you have something like a 13.3" 1080p screen on a laptop or notebook. You can change the font, and font size, but it requires some shell work.
The first thing you need to do if you want GRUB2 to show special fonts is to change the way it outputs information. Most distributions default to using what GRUB2 calls "native platform console" output. That's usually a simple text-mode. GRUB2 has another output mode available called
gfxterm that is described in the GRUB2 manual as "graphics-mode output". This is want you want, and you can use
GRUB_TERMINAL_OUTPUT to get it.
You can make the
gfxterm use any PFF2 font format bitmap font by adding a
GRUB_FONT= (not what ends up in the
grub.cfg files) line to
You probably don't have any PFF2 font files. That's fine, there is a utility called
grub-mkfont one some distributions). It can take any standard TrueType font and convert it to a .pf2
--output= in a specific
--size=. You will font a lot of TrueType fonts in
/usr/share/fonts/. You will want to use one of the "monospace" fonts (
find /usr/share/fonts/ -iname "*mono*").
grub2-mkfont can be used to create a font like this (be
root or use
grub2-mkfont --output=/boot/grub2/fonts/LiberationMono-Regular-36.pf2 \ --size=32 /usr/share/fonts/liberation-mono/LiberationMono-Regular.ttf
Notice that you can only have one size in
pf2 font files; they are bitmap font files, not scalable fonts.
grub2-mkconfig will make GRUB2 configuration files using
pf2 fonts if you specify a font files with the
|Note: Make sure to place font files on the EFI partition (|
- GNU GRUB website: https://www.gnu.org/software/grub/index.html
- Documentation: https://www.gnu.org/software/grub/grub-documentation.html
- Arch Wiki: GRUB
- Debian Wiki: Grub2