For many users, the default font size in the GRUB (GRand Unified Bootloader) menu can be straining to the 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.โ
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
- -s: Sets the size of the generated font
- -o: Sets the commandโs output to a file, providing the full path to the directory where we want it to be created.
Let’s now list the contents of “/boot/grub” to ensure the newly generated font was successfully created in it.
ls -l /boot/grub/
Step 2: Modify GRUB Config File
We need to change the bootloader configuration to tell GRUB to use the newly generated โdejavu-sans-mono.pf2โ font file.
GRUB’s default values are typically located in the “/etc/default/grub” file. However, creating a backup of this file is advisable before making any changes.
sudo cp /etc/default/grub /etc/default/grub.bak
Code language: JavaScript (javascript)
Then open the file with your preferred terminal text editor:
sudo nano /etc/default/grub
Code language: JavaScript (javascript)
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: JavaScript (javascript)
Furthermore, for enhanced visual appeal, the resolution of GRUB can be adjusted, creating ample space for the menu display. We will opt for a 1600x1200px, which can be set through the โGRUB_GFXMODEโ parameter.
GRUB_GFXMODE=1600x1200
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
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, now featuring a noticeably larger and 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.