Grub2 Boot – Changing Boot Parameters in Ubuntu Grub



My PC wont boot every second time I try to boot ubuntu. But I seem to have found a fix, which is editing setparams by pressing 'e' in grub.

I edit the

"gfxmode #linux_gfx_mode" 


"gfxmode nomodeset"

and can then boot ubuntu as normal. So I wanted to make this change permanent. I tried changing grub command in the /etc/default/grub with


This is added to the linux boot command in setparams in the grub, but makes my computer hang up instead and does not change the line with

"gfxmode #linux_gfx_mode"

How do I make change the gfxmode permanent so my computer can boot properly every time?

Best Answer

It seems that /boot/grub/grub.cfg is generated from files in /etc/grub.d

I managed to make the change permanent by replacing in this file /etc/grub.d/10_linux the line:

echo "  gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"

with this:

echo "  gfxmode nomodeset" | sed "s/^/$submenu_indentation/"

Afterwards I ran:

sudo update-grub

to generate the new grub.cfg

Related Question