Last active
December 23, 2015 20:29
-
-
Save alibitek/6689419 to your computer and use it in GitHub Desktop.
Easiest way to reinstall Grub 2 on BIOS system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Boot to a Live CD/USB | |
2) Mount the root partition | |
sudo mkdir /mnt/sda1 && sudo mount /dev/sda /mnt/sda1 | |
3) Bind the directories that Grub needs access to | |
sudo mount --bind /dev /mnt/sda1/dev && sudo mount --bind /dev/pts /mnt/sda1/dev/pts && sudo mount --bind /proc /mnt/sda1/proc && sudo mount --bind /sys /mnt/sda1/sys | |
4) Jump into the system | |
sudo chroot /mnt/sda1 | |
5) Install Grub | |
grub-install --target=i386-pc --recheck --debug /dev/sda | |
6) Generate configuration files | |
grub-mkconfig -o /boot/grub/grub.cfg | |
6) Now Grub is back. Exit the chrooted system and unmount everything | |
exit && sudo umount /mnt/sda1/dev && sudo umount /mnt/sda1/dev/pts && sudo umount /mnt/sda1/proc && sudo umount /mnt/sda1/sys && sudo umount /mnt/sda1 | |
7) Restart | |
sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment