вторник, 24 февраля 2009 г.

How to restore Grub from a live Ubuntu cd

How to restore Grub from a live Ubuntu cd.
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)

Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands

Code:
find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr

Code:
setup (hd0)
Finally exit the grub shell
Code:
quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Here it is possible to familiarise with the interesting insurance company which is engaged in free auto insurance quotes california car insurance auto quotes online

1 комментарий:

Александр Ганишев комментирует...

У меня на ноуте раньше стояла хп. Я установил Ubuntu 8.10. После установки стало поялятсья надпись:
NTLDR is missing
Press CTL-ALT-Del to restart

Я рыполнил приведенные выше рекомендации, но ничего не изменилось. Да, если в ручную выбирать из boot-меню, грузится без проблем.