restoring grub after reinstalling windows

Asked by prassu

How to: Fix GRUB after a Windows Installation
i studied ubuntu documuntation
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
 but i have doubt with 4 step what is root (hd0,0)
setup (hd0,3)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
prassu
Solved:
Last query:
Last reply:
Revision history for this message
skkeeper (skkeeper) said :
#1

If you follow the steps on that page carefully you will restore Grub with no problems, I've been doing that trick on a dozen of computers over the last year and never had any problem.

To know which number to use on the root and setup command do:
find /boot/grub/stage1

So as an example lets say the find command returns:
hd(0,1)

Then you do
root (hd0,1)
and then
setup (hd0)

Revision history for this message
Cristi Nistor (cristi-nistor) said :
#2

First number after hd indicates the number of the physical disk, the second number indicates the partition number. So, (hd0, 0) means the first partition of the first physical disk. Just follow the instructions and the GRUB will be restored.

Good luck.

Revision history for this message
prassu (kumarprass) said :
#3

ok.. thanks
 which means u want to say that “first hard drive, second partition” (numbers start from 0). right

I have partions like this what next i should do
dev/sda1–>ntfs
dev/sda2–>ntfs
dev/sda5–>ext3
dev/sda6–>ntfs
dev/sda7–>ntfs
dev/sda8–>ntfs
dev/sda9–>ntfs
dev/sda10–>ntfs
is it i have gave (hd0,2) [in which i am thinking to install xp ]

Revision history for this message
prassu (kumarprass) said :
#4

from above infromation
plz tell
what should i have to give for root (hd........?
and stetup (hd....?
 comand
 if I install xp in dev/sda2

Thanks

Revision history for this message
Cristi Nistor (cristi-nistor) said :
#5

What is the output of command find /boot/grub/stage1 ?

It says that "Note that you should have mounted the partition which has your Linux system before typing this command". The command is:

mount /dev/sda5

which is your Linux partition (ext3 file system). Assuming that the notation is correct the next command will be:

root (hd0, 4) (/dev/sda5 equivalent to (hd0, 4) which is the fifth partition of the first hard disk)

followed by:

setup (hd0, 4)

and

quit

and you are done.

I don't see any swap partition listed. Did you set one?

Revision history for this message
prassu (kumarprass) said :
#6

ya ya i understood
 thanks

Revision history for this message
prassu (kumarprass) said :
#7

NO i did not the set the swap partition