Lost GRUB

When GRUB is corrupted, your PC can't boot into Linux. Here's what I did:

$ sudo fdisk -l

$ sudo mount /dev/sda1 /mnt

$ sudo mount /dev/sda2 /mnt/boot Make sure you don't mix these up, pay attention to the output of FDISK

$ sudo mount --bind /dev /mnt/dev

$ sudo mount --bind /proc /mnt/proc

$ sudo mount --bind /sys /mnt/sys

$ sudo chroot /mnt

You should be chroot'd into your system as root, you can now run commands as root, without the need for sudo.

$ nano /etc/default/grub

$ update-grub

$ grub-install /dev/sda

$ grub-install --recheck /dev/sda

$ sudo umount /mnt/dev

$ sudo umount /mnt/sys

$ sudo umount /mnt/proc

$ sudo umount /mnt

If you had alternate OS entries, update-grub might say "Cannot find list of partitions!". Ignore it and continue - once you can boot into your linux installation, do so and then rerun update-grub and grub-install /dev/sda as root.

Reference: