Unix & Linux Asked by neydroydrec on February 5, 2021
I would like to reduce the size of the font of GRUB boot loader. Is it possible and so how?
I whipped up a little script to automatically scale font size to monitor/screen width.
SCREEN_WIDTH=$(xdpyinfo | grep dimensions | cut -d ':' -f 2 | cut -d 'x' -f 1)
FONT_SIZE=$((${SCREEN_WIDTH} / 80))
sudo grub-mkfont -s ${FONT_SIZE} -o /boot/grub/DejaVuSansMono.pf2 /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
printf "nGRUB_FONT=/boot/grub/DejaVuSansMono.pf2" | sudo tee -a /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
A few caveats
grub2
instead of grub
Enjoy!
Answered by xjcl on February 5, 2021
If you are looking for a simpler GUI alternative, you can use Grub Customiser to change the font size, colors and background of GRUB.
Answered by Juan C. Roldán on February 5, 2021
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 $EDITOR /etc/default/grub
GRUB_GFXMODE
entry to suit your resolution e.g. 800x600sudo update-grub
Answered by arunk on February 5, 2021
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.
sudo grub2-mkfont -s 14 -o /boot/grub2/DejaVuSansMono.pf2 /usr/share/fonts/dejavu/DejaVuSansMono.ttf
GRUB_FONT=/boot/grub2/DejaVuSansMono.pf2
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo grub2-mkconfig -o /boot/efi/EFI/{distro}/grub.cfg # distro on RHEL8 is {'redhat'}
The resolution of GRUB display may also affect the size of the font, more on resolution etc. on the ubuntuforums link above.
Answered by neydroydrec on February 5, 2021
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.
Answered by fpmurphy on February 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP