Introduction
Recently, I set up a new virtual private server using YunoHost, which runs Debian 12. During the initial setup, I declared my main drives and a secondary drive (Local Block). However, I encountered issues with the Grub/UEFI boot settings.
Understanding Grub and UEFI
Grub (GNU GRUB) is a popular bootloader used in Linux systems. UEFI (Unified Extensible Firmware Interface) is a newer replacement for the traditional BIOS. When using UEFI, the bootloader is stored in the EFI system partition instead of the MBR (Master Boot Record).
Booting into the Grub Menu
To access the Grub menu in UEFI mode, you need to press the Shift key during the boot process. This will bring up the Grub menu, where you can select your desired operating system to boot.
Checking Grub Configuration
If you encounter issues with the Grub boot settings, you can check the configuration files using the terminal. Open a terminal session and type:
sudo grub-edit-config --file /etc/default/grub
This command will open the Grub configuration file in a text editor, allowing you to make any necessary changes.
Repairing Grub
Boot Repair Tool
One popular tool for repairing Grub issues is the Boot Repair tool. You can install it using the following command:
sudo add-apt-repository ppa:yannubianchi/boot-repair && sudo apt update
Once installed, run the tool with:
sudo boot-repair
The tool will automatically detect and repair any issues with your Grub configuration.
Manually Repairing Grub
If the Boot Repair tool fails to repair your Grub configuration, you may need to repair it manually. First, you need to reinstall Grub:
sudo grub-install /dev/sda
Replace /dev/sda with your actual device name. Next, you need to regenerate the Grub configuration:
sudo update-grub
Rebooting and Testing
After repairing the Grub configuration, reboot your system and test the boot process. If you still encounter issues, you may need to check your partition table and file system.