ubuntu 8.10 boot loader mounted in wrong drive

Asked by newborn

Hi I have a tri boot system Hda1 Win 98, hda 2 win XP & hdb3 I just loaded ubuntu 8.10. During insatllation it asked where should boot loader be mounted/ kept & gave the option of hdb3 itself & I pressed ok. So now when i start up i get only the 2 windows options not the grub loader. So now how can I move the grub loader from Hdb3 to HDa1 ( I guess Hda 1 is where the grub loader should be mounted.

Also I had just reloded my ubuntu, from 6.06 to 8.10. This was a guided installation, but now i seem to have 2 linux swap partitions. Which should be kept/ or should I combine both, how?

Please help

Question information

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

I think it's just that the MBR on hda needs to be fixed. It might be good to reinstall the whole of grub at the same time, just to freshen it up. In 8.10 hda has been renamed sda but still means the same thing.

Boot up into a LiveCd session, preferably with 8.10, open a terminal console and type

sudo grub

find /boot/grub/stage1

This 2nd command will be on a grub command-line, not the normal linux command-line. If the result of the find command is (hd1,2) then continue by typing in

root (hd1,2)

setup (hd0)

quit

This should reinstall a fresh grub on the Ubuntu partition and will setup the first drive to look for the boot-loader in sdb3. The grub installer should automatically include lines for both the Windows and the Ubuntu.

Good luck and regards again from
Tom :)

Revision history for this message
Andre Mangan (kyphi) said :
#2

That looks like a 2 hard drive setup.

Use "sudo fdisk -l" to determine the numerical sequence of your hard drives.

Using a Live CD, in a terminal, type the following sequence:

sudo grub
find /vmlinuz (note the values returned to enter in lieu of x and y in the next step)
root (hdx,y)
setup (hd0)
quit

Close the terminal screen and any other screens and reboot.

hd0 (0 not o or O) is hda if you are using IDE drives but this may be not be the case if you are using SATA drives (fdisk will tell you). The numbers after hda and hdb refer to the partitions.

Revision history for this message
Andre Mangan (kyphi) said :
#3

Sorry to duplicate (in part) what Tom has already posted. He must be young and quick off the mark ;-) ...and up late.

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

lol, it's good to see i'm likely to be on the right track and it's good to see it from a slightly different angle. I hadn't thought of "find /vmlinuz" and the Sata vs IDE was new to me too. So it's all good :)

Thanks and regards from
Tom :)

Ps Blimey it is late!

Revision history for this message
Best Andre Mangan (kyphi) said :
#5

Just to clarify: In GRUB, you can use

1. find /boot/grub/stage1
2. find /vmlinuz
3. find /sbin/init

They will all give the same output.

Many people only have 1 hard drive with several partitions and perhaps Ubuntu and Windows installed. So, hd0 would be correct.

If you have more than one hard drive with Ubuntu on one drive and Windows on another, to restore GRUB you will have to put the entry onto the Windows drive which may be drive 2 = sdb.

To determine which drive hosts what, you can use "sudo fdisk -l" and to further support your findings you can use "cat /boot/grub/device.map". The equivalents of grub hd0 and hd1 are sda and sdb. Grub counts from zero. This also applies to partitions.

Drive order for multiple drives can be altered in the BIOS as well as switching SATA ports (no master/slave in SATA). If you have 2 identical drives they can easily be switched and the results would not be readily apparent.

Revision history for this message
newborn (venuwarrior70) said :
#6

Thanks Andre Mangan, that solved my question.