GRUB, short for Grand Unified Bootloader, is an essential Linux boot process. It manages the boot process, which enables the user to choose the operating system. Basic knowledge of how to install GRUB on Ubuntu is a fundamental and non-negotiable skill for all Linux administrators to ensure a seamless boot experience.
In this guide, we will walk through the easy process of installing GRUB on Ubuntu, making it easy to manage your operating systems.
Prerequisites to Install GRUB on Ubuntu
Before you start to install GRUB on Ubuntu, make sure that you complete the following checklist.
- A Bootable Ubuntu Live USB/DVD
- Administrative Privileges (Root or sudo access)
- An Existing Ubuntu Installation or Target Disk – Either an installed OS or a disk where GRUB will be installed.
- BIOS or UEFI Mode Awareness – Know whether your system uses BIOS or UEFI, as GRUB installation differs for each.
- Basic Linux Command-Line Knowledge – Familiarity with commands like grub-install, update-grub, and lsblk helps in troubleshooting.
- Backup of Important Data
Checking if GRUB is Installed on Ubuntu
Before you install GRUB on Ubuntu, you should check if it is already on your system.
- Check GRUB Installation with the Bootloader Directory
To check if the GRUB files already exist on your system, run the following command:
ls /boot/grub
Get exclusive access to all things tech-savvy, and be the first to receive
the latest updates directly in your inbox.
If the directory exists and contains files, GRUB is likely installed.
- Verify GRUB Installation with the grub-install Command
Execute the following command to verify GRUB installation:
grub-install –version
- Check Bootloader Location
To see if GRUB is installed on your disk’s Master Boot Record (MBR) or EFI partition, run:
sudo fdisk -l
For UEFI systems, check the EFI partition:
ls /boot/efi/EFI/ubuntu/
If GRUB files exist, it’s installed on your UEFI system.
- Verify GRUB Bootloader with efibootmgr (For UEFI Systems)
sudo efibootmgr -v
- Check GRUB Bootloader at System Startup
Restart your system and hold the Shift button for BIOS or Ecs/F12 for UEFI.

How To Install GRUB on Ubuntu
Depending on your system, whether your system uses BIOS or UEFI, you can follow the respective steps.
Installing GRUB on BIOS Systems
If your system is using a traditional BIOS setup, follow these steps:
- Identify the Target Disk
Run the following command to find your disk:
Lsblk
The main disk is usually /dev/sda or /dev/nvme0n1.
- Install GRUB on the MBR
Use the grub-install command:
sudo grub-install /dev/sdX
Replace /dev/sdX with your actual disk name (e.g., /dev/sda).
- Update the GRUB Configuration
Generate a new configuration file after installing:
sudo update-grub
- Reboot the System
Reboot your system to see if the installation was successful:
sudo reboot
Installing GRUB on UEFI Systems
Follow these steps for UEFI systems:
- Mount the EFI Partition
Identify your EFI partition by running:
sudo fdisk -l | grep EFI
It is usually mounted at /boot/efi. If it’s not mounted, do so manually:
sudo mount /dev/sdXn /boot/efi
Replace /dev/sdXn with your EFI partition (e.g., /dev/sda1).
- Install GRUB for UEFI
Run the following command to install GRUB on the EFI system partition:
sudo grub-install –target=x86_64-efi –efi-directory=/boot/efi –bootloader-id=ubuntu
- Update the GRUB Configuration
Generate the GRUB configuration file by running:
sudo update-grub
- Reboot and Verify GRUB
Restart the system to verify installation:
sudo reboot
You can also check GRUB entries using:
sudo efibootmgr -v
Repairing GRUB Bootloader on Ubuntu
If GRUB is missing, corrupted, or fails to boot Ubuntu, you can repair using the following methods:
- Boot into a Live Ubuntu Session
Use a bootable Ubuntu USB/DVD and select try Ubuntu without installing.
- Identify and Mount the Root Partition
Find your Linux partition:
lsblk
Mount it:
sudo mount /dev/sdXn /mnt
(Replace /dev/sdXn with your root partition, e.g., /dev/sda2).
- Mount Additional System Directories
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys
- Chroot into Your System
sudo chroot /mnt
- Reinstall GRUB
For BIOS Systems:
grub-install /dev/sdX
For UEFI Systems:
grub-install –target=x86_64-efi –efi-directory=/boot/efi –bootloader-id=ubuntu
- Update GRUB Configuration
update-grub
- Exit Chroot and Reboot
exit
sudo reboot
Configuring GRUB
GRUB settings can be modified in the /etc/default/grub file.
- Edit the GRUB Configuration File
sudo nano /etc/default/grub
- Common GRUB Customizations
Set Default Boot Entry by running”
GRUB_DEFAULT=0
Enable GRUB Menu at Startup
GRUB_TIMEOUT=5
Enable Recovery Mode
GRUB_DISABLE_RECOVERY=false
Change Resolution
GRUB_GFXMODE=1024×768
- Apply Changes
Apply the Changes by running:
sudo update-grub
Reboot to see the updated settings.
Related Article: How to Install GCC on Ubuntu: The Only Guide You’ll Need
Troubleshooting GRUB Issues
Issue | Solution |
GRUB Rescue Mode (grub rescue> prompt) | 1. Identify partitions: ls2. Set root: set root=(hd0,1) (adjust as needed)3. Load and boot GRUB: insmod normal → normal |
Missing GRUB Menu at Boot | 1. Edit GRUB config: sudo nano /etc/default/grub2. Set:GRUB_TIMEOUT_STYLE=menuGRUB_TIMEOUT=53. Update GRUB: sudo update-grub |
Booting Directly into Windows Instead of GRUB | 1. Reinstall GRUB: sudo grub-install /dev/sda2. Update GRUB: sudo update-grub |
GRUB Not Detecting Other OS (e.g., Dual Boot) | 1. Run: sudo os-prober2. Update GRUB: sudo update-grub |
Broken GRUB After Kernel Update | 1. Boot into a Live USB2. Mount root partition: sudo mount /dev/sdXn /mnt3. Chroot: sudo chroot /mnt4. Reinstall GRUB: grub-install /dev/sdX5. Update GRUB: update-grub6. Reboot: exit → sudo reboot |
Need an Automatic GRUB Repair Tool | 1. Install Boot-Repair: sudo apt install boot-repair2. Run: boot-repair |
Wrapping Up – Install GRUB on Ubuntu
GRUB is an essential element of the Linux boot process, which allows users to manage multiple operating systems and recover from boot failures. Regardless of the system you are using, configuring the right settings and troubleshooting issues is crucial for maintaining a stable system.
1. What is GRUB in Ubuntu?
GRUB (Grand Unified Bootloader) is the default bootloader for Ubuntu and many other Linux distributions. It allows users to select between multiple operating systems and kernel versions at startup.
2. How do I reinstall GRUB after a system crash?
Boot into a Live Ubuntu USB, then run:sudo mount /dev/sdXn /mnt # Replace Xn with your root partition sudo grub-install --root-directory=/mnt /dev/sdX sudo update-grub
3. What should I do if GRUB is missing or corrupted?
Use a Live Ubuntu USB, mount the partitions, and reinstall GRUB using grub-install
and update-grub
.