I would like to reduce the size of the font of GRUB boot loader. Is it possible and so how?
After some research based on the answers of @fpmurphy and @hesse, also based on a comprehensive thread at ubuntuforums and on Fedora Wiki, I found out how to reduce the font size of GRUB2.
- Choose a font, in this example I chose DejaVuSansMono.ttf
- Convert the font in a format GRUB understands:
sudo grub2-mkfont -s 14 -o /boot/grub2/DejaVuSansMono.pf2 /usr/share/fonts/dejavu/DejaVuSansMono.ttf - Edit the /etc/default/grub file adding a line:
GRUB_FONT=/boot/grub2/DejaVuSansMono.pf2 - Update GRUB configuration with:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg - reboot.
The resolution of GRUB display may also affect the size of the font, more on resolution etc. on the ubuntuforums link above.
-
5That's cool. With 36px size, the bootloader finally looks good on a high-res display. Works also with grub (
grub-mkfont) instead of grub2. – BurninLeo Sep 16 '14 at 17:38 -
4Thanks!
grub-mkfontandgrub-mkconfigin my case (though I do have grub2). – Deleplace Apr 1 '15 at 21:22 -
when I try to execute the
grub-mkfontcommand I get:Freetype Error 21 loading glyph 0x2c7 for U+0x33f: invalid composite glyph– Aaron N. Brock Oct 16 '17 at 19:10 -
1
grub-mkfontandsudo update-grubfor me on Ubuntu. Perfect for HiDPI/4k screens – aidan Dec 22 '17 at 10:49 -
1On UEFI system one would use
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg– scrutari Mar 13 '19 at 15:32
Yes, both the font and the font size can be customised. See the grub-mkfont utility. Bitmap (.pf2) and Truetype (.ttf) fonts are supported.
Just do an Internet search on grub-mkfont and you will quickly come across a number of examples of the necessary steps.
-
1Nice indeed I found this documentation but somehow I need to
update-grub, which command I don't seem to have on Fedora 16 (?). – Benjamin Feb 15 '12 at 12:49 -
In Debian/Ubuntu you can change the default GRUB resolution, thereby resulting in larger fonts on the GRUB menu:
- sudo cp -a /etc/default/grub /etc/default/grub.bak
- sudo vi /etc/default/grub
- Edit the "GRUB_GFXMODE" entry to suit your resolution e.g. 800x600
- sudo update-grub
- Reboot - the GRUB will display in the mode you set e.g. 800x600
-
1
-
1
-
1This kind of works at the grub level, but then my X display also has a size of 800x600, urgh. (Intel videocard, FBDEV driver, OpenSUSE Leap 15.0) – David Faure Dec 10 '18 at 17:40
If you are looking for a simpler GUI alternative, you can use Grub Customiser to change the font size, colors and background of GRUB.