Skip to content


Configuring the Grub2 boot loader

I had to use Linux for work the last few days, and my previous installation was completely outdated so I reinstalled from scratch, switching distribution in the process (from OpenSUSE to Kubuntu).
Part of the fun in installing Linux on a computer where I still want to mainly use Windows is configuring the bootloader. Apparently, it’s 2017 yet it still has to be done 100% via manually editing configuration files.

The file you want to edit is /etc/default/grub, so:

sudo nano /etc/default/grub

Then the interesting things to change are among those lines:
GRUB_DEFAULT=4 : boot the 5th item in the list (numbering starts at 0, so 5th item is 4, not 5)
GRUB_DEFAULT="Windows 7 (loader)" : boot the item named “Windows 7 (loader)”. NB: for me, for some reason it didn’t work
GRUB_DEFAULT=saved : boot the last operating system you chose (requires to also set GRUB_SAVEDEFAULT=true). NB: for me, the saving failed for some reason so it always loaded the first item :/
GRUB_CMDLINE_LINUX_DEFAULT="" : show console log output when starting up, instead of the static splashscreen (which is the default "quiet splash") (link https://askubuntu.com/questions/477821/how-can-i-permanently-remove-the-boot-option-quiet-splash)

After you’ve saved your modifications, you have to run sudo update-grub to apply them, as /etc/default/grub isn’t directly used by Grub but it used to automatically generate Grub’s configuration files (which is /boot/grub/grub.cfg and shouldn’t be manually modified)

More details there: https://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/

Bonus 1 my /etc/default/grub file

#GRUB_DEFAULT="Windows 7 (on /dev/sdb1)"
GRUB_DEFAULT=4
#GRUB_DEFAULT=saved
#GRUB_SAVEDEFAULT=true
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

Bonus 2: if you happen to have damaged RAM, you can use Grub to enable BadRAM filtering. Not sure how this works exactly, but the setting is called GRUB_BADRAM

Bonus 3: since you’re here, I assume you’re dual booting. Maybe you’re having an issue with Windows and Linux both messing up your system date. Long story short, run "timedatectl set-local-rtc 1" to make Linux store local time instead of UTC in the hardware clock (well at least that’s how it is for Ubuntu). More details: https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts

Posted in Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA