Page MenuHomePhabricator

GRUB Bootloader Reinstall
Updated 2,010 Days AgoPublic

Oh no, GRUB kicked the bucket! Luckily for you, your professor just went over Frankenstein last week, so you can say that you're somewhat of an expert with reviving the dead. :^)

1 - Boot into a live Linux disk
2 - Open a terminal: ( + ALT + T )
3 - Become root sudo su
4 - Run fdisk -l to find out where Linux is installed in the drive you're working on. It should look something like so:

Screenshot from 2018-08-22 15-34-40.jpg (234×610 px, 78 KB)
in this case, the drive that Linux is installed on is /dev/sda, and the partition is /dev/sda3
5 - Now to mount our Linux filesystem: mount /dev/sdxX /mnt
NOTE: in this example, you would mount /dev/sda3

mount --bind /proc /mnt/proc 
mount --bind /sys /mnt/sys 
mount --bind /dev /mnt/dev

6 - Now we want to work inside of what we've mounted, ergo: chroot /mnt
7 - Reinstall GRUB:

grub-install /dev/sdX
update-grub /dev/sdX
update-grub2 /dev/sdX

NOTE: in this case, we're installing it to /dev/sda

8 - Unmount everything previously mounted:

umount /mnt/proc
umount /mnt/sys
umount /mnt/dev
umount /mnt

9 - Revel in the fruits of your labor and reboot

Last Author
ajanib
Last Edited
Apr 8 2019, 10:21 AM

Event Timeline

ajanib edited the content of this document. (Show Details)
ajanib added projects: Restricted Project, Restricted Project.