Change grub default boot option on Linux Ubuntu/Mint

Grub's default boot option is stored within a config file found on the partition where your Master Boot Record is located (if you had it installed previously, there may also be grub.cfg files on other partitions, but these won't affect boot sequence). Its direct path is /boot/grub/grub.cfg and it has to be opened as root, so enter the following into a terminal:

sudo gedit /boot/grub/grub.cfg

The important parts of the file is the line saying set default="0" and the blocks beginning with menuentry:

[...]
menuentry 'Linux Mint 20 64-bit, 3.0.0-12-generic (/dev/sda5)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=7df91f6c-5351-4336-a3c5-eac1cf58efca ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
[...]

These blocks are the entries that are displayed in the boot menu - they are indexed from 0 to n-1, n being the number of entries. To set the default entry, take its index and enter it into the set default="0" line, replacing 0 with the desired index. Afterward save the file.

Leave a Comment