What is GRUB in Kali Linux, and how do you configure and repair it?

GRUB (GNU GRand Unified Bootloader) is a vital component in Kali Linux that manages the boot process. It bridges the system firmware and the operating system, allowing users to boot into Kali Linux or other installed OSs. GRUB supports advanced features like multibooting, dynamic configuration, kernel parameter editing, and recovery options. It stores configurations in /etc/default/grub, and any changes require updating the configuration using sudo update-grub. Additionally, GRUB can be customized with themes, password protection, and custom kernel parameters. Understanding GRUB ensures efficient boot management and troubleshooting in Kali Linux systems.

Jan 18, 2025 - 09:42
Updated: 7 days ago
104.2k
What is GRUB in Kali Linux, and how do you configure and repair it?

Quick answer: GRUB is the boot loader Kali Linux uses. It starts after the firmware (BIOS or UEFI), shows a menu, loads the Linux kernel and initramfs, and hands control to the system. You configure it in /etc/default/grub and apply changes with update-grub. If Kali will not boot, repair it from a live USB with a chroot and grub-install.

Key takeaways

  • GRUB 2 starts the kernel after BIOS or UEFI hands over control.
  • Edit /etc/default/grub, never /boot/grub/grub.cfg directly, then run update-grub.
  • Kali uses GRUB 2, with os-prober available for dual-boot detection.
  • A broken GRUB is repaired from a live USB using chroot and grub-install.
  • Back up the config and know your disk layout before changing the boot loader.

What does GRUB do?

GRUB (GNU GRand Unified Bootloader) is the first program that loads Kali after the firmware has finished its checks. It finds the kernel, loads it with an initial RAM filesystem (initramfs), passes it boot parameters, and starts it. If more than one operating system is installed, GRUB also lets you choose.

The sequence on a typical Kali install:

  1. BIOS or UEFI firmware starts.
  2. Firmware loads GRUB from the disk (the boot sector on BIOS systems, or an EFI system partition on UEFI systems).
  3. GRUB reads its configuration and shows the menu.
  4. GRUB loads the Linux kernel and initramfs.
  5. The kernel starts and systemd brings up the system.

The official GNU GRUB manual describes every option. Kali itself is covered in the Kali Linux documentation.

Where are GRUB's files?

PathPurpose
/etc/default/grubMain settings you edit
/etc/grub.d/Scripts that build menu entries
/boot/grub/grub.cfgGenerated file. Do not edit it by hand
/boot/efiEFI system partition on UEFI installs

How do you change GRUB settings?

Edit /etc/default/grub, then regenerate the configuration. Make a backup first.

$ sudo cp /etc/default/grub /etc/default/grub.bak
$ sudo nano /etc/default/grub
$ sudo update-grub

Useful settings:

  • GRUB_TIMEOUT=5 is how many seconds the menu waits.
  • GRUB_DEFAULT=0 boots the first entry. You can also use a saved entry.
  • GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" sets kernel options. Removing quiet splash shows boot messages, which helps when debugging.

update-grub rewrites /boot/grub/grub.cfg from your settings and the scripts in /etc/grub.d/.

How do you boot into recovery mode?

Choose "Advanced options for Kali GNU/Linux" in the GRUB menu, then a recovery entry. You get a root shell that lets you fix passwords or broken packages. You can also press e on a menu entry to edit its options for one boot. Changes made this way are not saved.

How do you repair GRUB when Kali will not boot?

Boot from a Kali live USB, mount your installed system, and reinstall GRUB. First check your layout.

$ lsblk -f

Say Kali's root partition is /dev/sda2 and you boot in UEFI mode with the EFI partition on /dev/sda1. Your device names will differ. Then:

$ sudo mount /dev/sda2 /mnt
$ sudo mount /dev/sda1 /mnt/boot/efi
$ for d in dev dev/pts proc sys run; do sudo mount --bind /$d /mnt/$d; done
$ sudo chroot /mnt
# grub-install /dev/sda
# update-grub
# exit

On a BIOS (legacy) system you skip the EFI mount and run grub-install /dev/sda on the disk, not on a partition. Reboot and remove the USB.

Check ls /sys/firmware/efi in the live session. If the directory exists, you booted in UEFI mode and should use the UEFI steps.

Why does Windows disappear from the GRUB menu?

Dual-boot menus rely on os-prober. On recent Debian-based systems it is disabled by default, so Windows may not appear after an update. To enable it, set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub and run update-grub. Check this against the Kali documentation for your version.

Common mistakes

  • Editing grub.cfg directly. The next update-grub erases your change.
  • Running grub-install on a partition instead of the disk on BIOS systems.
  • Forgetting to mount the EFI partition before the chroot on UEFI systems.
  • Setting GRUB_TIMEOUT=0 and then being unable to reach the menu.

What about LILO?

LILO was the older Linux boot loader and is not used on modern Kali. Our LILO explainer covers the history.

Next steps

Understanding boot is basic Linux administration. If you are building those skills, look at our Linux training or read how the Linux file system hierarchy is laid out.

Related reading

Frequently Asked Questions

GRUB is the boot loader that starts Kali Linux. It runs after the firmware, shows a boot menu, loads the kernel and initramfs, and passes control to the operating system. Kali uses GRUB 2.

Edit /etc/default/grub for your settings and /etc/grub.d/ for custom entries. The generated /boot/grub/grub.cfg is rebuilt by update-grub and should not be edited by hand, because the next update overwrites it.

Edit /etc/default/grub, then run sudo update-grub. This regenerates /boot/grub/grub.cfg from your settings. Back up the file before editing, so you can restore it if the system fails to boot.

Boot a Kali live USB, mount the installed root and EFI partitions, bind-mount dev, proc, sys and run, chroot in, then run grub-install and update-grub. Reboot after exiting the chroot.

The os-prober tool may be disabled by default. Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub and run update-grub. Make sure Windows is installed and its partitions are readable.

LILO is an older boot loader with fewer features and no longer used on current distributions. GRUB 2 supports menus, many filesystems, UEFI and interactive editing, and is the default on Kali.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.