July 16

Linux: Repair Grub Bootloader / locked out of bootloader

Locking down Grub with a password is a great idea,
but sometimes things go wrong and you might find yourself locked out from booting your computer.
The following example is from memory so I may have missed a step, but it should be close to how to fix this issue

Boot into a live Linux CD or USB
(Note: I have found it needs to be the same version of Linux, especially when using the newer versions of Ubuntu.)

Start a terminal session
Type: sudo fdisk -l
Find the boot partition of you linux installation (In this example we have it install on /dev/sda1)

sudo mount /dev/sda1 /mnt

Remove you changes in /mnt/etc/grub.d/00_header (or whichever grub configuration file you changed that caused the issue

Create some neccessary hardlinks
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys
sudo chroot /mnt
update-grub /dev/sda1
CTRL-D
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt


Copyright 2021. All rights reserved.

Posted July 16, 2014 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B