EIVUS

GRUB Recovery and Linux Boot Issues

Fix broken GRUB or boot loader; use rescue mode and chroot.

Back to blog

Boot from provider rescue or live image, mount the root filesystem, and chroot to reinstall or fix GRUB. Keep a note of partition layout. Test after kernel updates; have a rescue plan documented.

When GRUB breaks

  • Causes: Failed kernel update, disk change (resize, new disk), mistaken edit to grub.cfg or /etc/default/grub, or filesystem corruption. System may show "GRUB rescue", "unknown filesystem", or black screen.
  • Goal: Boot into the real root filesystem and reinstall or reconfigure GRUB so the boot loader finds the kernel and initramfs and boots the OS.

Rescue and chroot

  • Boot rescue: Use the provider's rescue image (via panel or IPMI/KVM) or a live USB/DVD. Boot into a minimal OS (often same distro or generic live). Ensure you have root or sudo.
  • Mount root: Identify the root partition (e.g. /dev/sda1 or /dev/vda1). Mount it: mount /dev/vda1 /mnt. If you use separate /boot, mount that too: mount /dev/vda2 /mnt/boot (adjust devices). Mount virtual filesystems if needed: mount --bind /dev /mnt/dev, mount --bind /proc /mnt/proc, mount --bind /sys /mnt/sys.
  • Chroot: chroot /mnt. You are now "inside" the broken system. Run commands as if you were booted into it.

Reinstall GRUB

  • Install to disk: grub-install /dev/vda (use the disk device, not the partition). This writes GRUB to the MBR or ESP. For UEFI you may need to mount the EFI System Partition and run grub-install --efi-directory=/boot/efi.
  • Regenerate config: update-grub (Debian/Ubuntu) or grub2-mkconfig -o /boot/grub2/grub.cfg (RHEL/CentOS). This scans for kernels and updates grub.cfg.
  • Verify: Check /boot for vmlinuz and initrd; check /boot/grub/grub.cfg (or grub2/grub.cfg) for correct root= and kernel entries. Exit chroot, unmount, reboot. Remove rescue media so the server boots from disk.

Prevention and notes

  • Partition layout: Document or screenshot partition layout (e.g. lsblk, fdisk -l). Helps when you are in rescue and must mount the right partitions.
  • After kernel updates: Some updates change initramfs or kernel order. If the server does not boot after an update, use rescue to check /boot and re-run update-grub or fix grub.cfg.
  • Rescue plan: Document steps (which rescue image, mount points, grub-install command) so anyone can follow in an emergency. Test rescue access (e.g. from provider panel) periodically.

Summary

Boot from provider rescue or live image; mount root (and /boot if separate); chroot; reinstall GRUB with grub-install and update-grub/grub2-mkconfig. Keep partition layout noted; test after kernel updates; document rescue plan.

Clients who trust us