Go to ...


A Better Technical Repository

RSS Feed

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
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt