Restoring the GNU Grub
- Get yourself a LiveCD
- Boot using the LiveCD and mount the partition containing your distribution (if it hasn’t been already mounted by the LiveCD distro)
- Open a terminal window, gain root access, and type: “chroot /mnt/hd??” OR “chroot /media/hd??” where the first “?” stands for the hard disk letter and the second “?” stands for the partition number. Note that some distributions use “/media” for mounting drives, so check both “/mnt” and “/media” before attempting to manually mount the partition. If you don’t know which is the distribution partition (e.g. If you have multiple distros installed) then just navigate to the directories you mounted on the previous step until you determine which is the right one. Typing just “mount” should reveal any automounted filesystems
- Type “grub”, a message saying “Probing devices to guess BIOS drives” should appear, just wait for a couple of minutes and soon you will see the grub prompt (it looks like “grub> _”)
- Type “find /boot/grub/stage1”. The result will be like “(hd0,5)” or perhaps “(hd0)”. Keep this in mind because it is a key-text for the next steps.
- Type “root (hd?,?)”, replace the question marks with what the output of the command above was.
- Now we are ready to install grub, select one of the following options depending on the place you want to install grub:
- If you want to install grub on the MBR (recommended for most installations) type “setup (hd?)” where “?” is the result BEFORE the comma that command in step 5 returned
- If you know what you are doing and want to install it on a separate partition, type “setup (hd?,?)” where the first “?” stands for the pre-comma output of the command of step 5 and the second “?” stands for the partition number.
- Type “quit” to exit the grub prompt
- Reboot the computer and remove the LiveCD, grub should now appear
howtos/reinstall_grub.txt · Last modified: d/m/Y H:i by 127.0.0.1