Related Items  

Linux and Windows IT Support  


Windows, Apple and Linux IT support and services.

For Software and Web Development.

Restoring Grub2


If for some reason your grub has gotten corrupted, here are the steps to restore it.

Boot into a rescue CD (either Ubuntu or System Rescue CD, which you can download freely).

Mount the drive, where sdXY is the partition (eg: /dev/sda1)

sudo mount /dev/sdXY /mnt

Map all of system partitions (/dev, sys and proc):

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

Then "chroot" to the new directory:

sudo chroot /mnt

Note: if you are using System Rescue CD, you may get this error:
chroot: failed to run command `/bin/zsh` : No such file or directory

In that case you have to specify the shell:

chroot /mnt /bin/bash

Once chrooted, run the following to install grub (where sdX is your drive where grub will be installed. You have to use the drive, not a partition. ie: /dev/sda, not /dev/sda1)

grub-install /dev/sdX

Finally, unmount everything:

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

and reboot.

Original article is posted on the ALT Technical site.


Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
Copyright © 1999 - 2024 Virtual Helpme | Techical Support and Maintenance | Original Template: Allrounder