For many users, the default font size in the GRUB (GRand Unified Bootloader) menu can strain their eyes, especially on high-resolution displays or for those with visual impairments.
This guide is designed to walk you through the process of enlarging the font size in your GRUB bootloader, enhancing not just the aesthetics of your boot menu but also its accessibility and usability.
This change caters to your personal preferences and ensures you can comfortably navigate your boot options, a crucial aspect of troubleshooting and system management. So, without further ado, letโs dive in and give your Linux boot menu the facelift it deserves with larger, clearer fonts!
Step 1: Font Conversion to GRUB Readable Format
Given the limitations of the preboot environment, GRUB fonts are optimized for readability and simplicity. They do not have the same anti-aliasing or typographic refinement level found in fonts used within a fully loaded operating system.
In other words, you canโt just take a font in the familiar TTF, OTF, WOFF, and so on formats and use it in GRUB. Instead, it uses its one with the extension PF2. Itโs designed explicitly for preboot environments where standard operating system services and drivers are unavailable.
Fortunately, users can convert almost any font into the GRUB-compatible format with the help of the grub-mkfont
command. So, our first step is to create one.
DejaVu Sans is a great candidate for this, offering a full range of character support. So go to its official website, download it (โdejavu-fonts-ttf-2.37.zipโ), and unzip the file. You will find many font varieties in the resulting โttfโ folder, but the file we are interested in is โDejaVuSansMono.ttf.โ
First, ensure you have the “freetype2” package installed on your system. If you don’t have it, install it using the package manager for your distribution.
Next, run the command below to convert the font to PF2, with the last argument being the full path to our TTF file:
sudo grub-mkfont -s 24 -o /boot/grub/dejavu-sans-mono.pf2 ./Downloads/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf
Code language: Bash (bash)
- -s: Sets the size of the generated font
- -o: Sets the commandโs output to a file, providing the full path to the directory we want to create.
Let’s now list the contents of “/boot/grub” to ensure that the newly generated font was successfully created there.
ls -l /boot/grub/
Code language: Bash (bash)
Step 2: Modify GRUB Config File
We must change the bootloader configuration to tell GRUB to use the newly generated โdejavu-sans-mono.pf2โ font file.
GRUB’s default values are typically in the “/etc/default/grub” file. But before acting, I strongly recommend creating a backup of this file:
sudo cp /etc/default/grub /etc/default/grub.bak
Code language: Bash (bash)
Then open the file with your preferred terminal text editor:
sudo nano /etc/default/grub
Code language: Bash (bash)
Add the following line at the end specifying the absolute path to the PF2 font file:
GRUB_FONT=/boot/grub/dejavu-sans-mono.pf2
Code language: Bash (bash)
Furthermore, the resolution of GRUB can be adjusted for enhanced visual appeal, creating ample space for the menu display. We will opt for 1600x1200px, which can be set through the โGRUB_GFXMODEโ parameter.
GRUB_GFXMODE=1600x1200
Code language: Bash (bash)
Save the file and exit.
Always keep something in mind, though – the font size in the GRUB menu will appear smaller when a higher resolution is chosen. So, it’s essential to recognize this relationship between resolution size and font appearance.
Step 3: Update the GRUB Configuration
As the last step, you need to update GRUB for the changes to take effect. This is typically done with the following command:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Code language: Bash (bash)
Finally, reboot your system to see the changes take effect.
Itโs time for some self-congratulationsโyouโve successfully expanded the size of your GRUB menu, which now features a noticeably larger and more easily readable font.
Conclusion
Enhancing the appearance of your Linux boot menu by increasing the font size in the GRUB menu is a straightforward yet impactful modification.
This guide has walked you through the steps necessary to achieve a clearer, more readable startup display, adding an element of customization and improved usability to your system.
Thanks for your time! As always, your feedback and comments are most welcome.