MediaWiki:Welcome to the Howto page/Linux/Restore Grub

From wiki
< MediaWiki:Welcome to the Howto page‎ | Linux
Revision as of 22:40, 29 December 2013 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

First:


Boot from Linux CD;


When screen asks to boot press: Enter


Once kernel loaded and H/W detected and you get to first part of installer press Alt-F2 to get to console mode;


Press: Enter to activate;


then use these commands:

mkdir /mnt/temp

mount /dev/hda2(in my case replace with whereever / is located) /mnt/temp

mount --bind /sys /mnt/temp/sys

mount --bind /proc /mnt/temp/proc

mount --bind /dev /mnt/temp/dev

chroot /mnt/temp

~#grub


Note

The above has been tested for Debian Etch and thus might be slightly different on other Linux distributions. However, the general principle remains the same.


An example for Ubuntu 9.04 Jaunty and Ubuntu 9.10 Karmic:

mkdir /mnt/temp

mount /dev/hda2(in my case replace with whereever / is located) /mnt/temp

mount --bind /sys /mnt/temp/sys

mount --bind /proc /mnt/temp/proc

mount --bind /dev /mnt/temp/dev

chroot /mnt/temp

/usr/sbin/grub-install /dev/sda