grub

Asked by sabareesh

Hi
I had a dual boot system with Windows XP on my C: drive and Ubuntu 8.04LTS Desktop edition in the same hard drive(160GB) on other partition. Due to a problem with Windows I had to "Format" it using the Windows installation CD and as a result of this I am now unable to boot into Ubuntu.After formatting system directly boot windows xp, what can i do
My problem is that I don't know how to get grub back or where to put it when I find out how to do it.
HELP me

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
S.Vikash Koushik
Solved:
Last query:
Last reply:
Revision history for this message
sabareesh (sabareeshbc) said :
#1

i used ubuntu live cd and i find ubuntu in the other partition.

Revision history for this message
sabareesh (sabareeshbc) said :
#2

please help me to recover my lost grub

Revision history for this message
Daniel (daniel-jacobs) said :
#3

Have a look at

http://ubuntuforums.org/showthread.php?t=224351

I hope this helps.

Revision history for this message
Best S.Vikash Koushik (vikashkoushik) said :
#4

Hi dude.

 This will be a simple procedure.

Enter the Live Cd and Go to Terminal which will be present at Applications ->Accessories.There type the following command:

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

Code: find /boot/grub/stage1
Result: 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 ?,?)
Result:-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)

Code: quit

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

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.

Revision history for this message
Tom (tom6) said :
#5
Revision history for this message
sabareesh (sabareeshbc) said :
#6

Thanks S.Vikash Koushik, that solved my question.

Revision history for this message
sabareesh (sabareeshbc) said :
#7

Hai friend sorry for the delay. My network has some problems .Thanks for your replay.My problem is solved.

Revision history for this message
S.Vikash Koushik (vikashkoushik) said :
#8

Its Ok dude.As long as your problem is solved it & let us know it, it doesn't matter.

Revision history for this message
Tom (tom6) said :
#9

Brilliant, nicely done, congrats all :)
Regards from
Tom :)

Revision history for this message
sabareesh (sabareeshbc) said :
#10

It's ok tom .Once again i am thanking ubuntu makers for helping me to solve my problem.