In this tutorial, we'll walk through the process of setting the default boot configuration on a Linux system. This is an essential skill for system administrators and users who need to manage multiple operating systems or kernel versions.
Understanding the Boot Process
Linux uses the GRUB (Grand Unified Bootloader) to manage boot options. The default boot entry is the one that gets selected automatically when the system starts.
Setting the Default Boot Entry
To change the default boot entry, you need to edit the GRUB configuration file. Follow these steps:
- Open the GRUB configuration file:
sudo nano /etc/default/grub
- Find the line
GRUB_DEFAULTand change its value to the desired entry. You can use a numeric index (starting from 0) or the exact menu entry name.
- For example, to boot the first entry by default, set
GRUB_DEFAULT=0. - To boot an entry named "Advanced options for Ubuntu", set
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-26-generic".
- Save the file and exit the editor.
- Update GRUB to apply the changes:
sudo update-grub
- Reboot to see the changes take effect.
Verifying the Change
After reboot, the system should automatically start the selected default option. You can also check the GRUB menu by holding Shift (or Esc on some systems) during boot.
Troubleshooting
If the changes don't take effect, ensure that GRUB_TIMEOUT is set to a positive value so the menu appears, and verify that you have run update-grub successfully.
This guide provides a simple way to control which operating system or kernel boots by default, making your Linux experience more efficient and tailored to your needs.