Linux newbie, GRUB problems

Associate
Joined
24 Sep 2003
Posts
928
Location
Bedfordshire
Hi,

Trying to setup an XP/Ubuntu dual boot machine.

Machine has two HD's (40 gig and 20gig). XP went on first on the 40 gig and then Ubuntu on the 20 gig.

When I boot up GRUB tries to load but then I get error code 25. I think this means something is wrong with the boot record or it could be a motherboard problem.

I got SuperGRUB off the web. Which is a CD that allows me to boot both OS's but I would like to try and fix this problem.

One thing I am a little bit worried about is that I think both HDD's came up as slave when I was installing Ubuntu, could this be a problem?

Any help appreciated,

aaazza
 
The Grub error you have there relates to Grub not being able to read the partition from which it is supposed to read the bootloader files. The cause of this problem is that Grub & the Linux kernel sometimes don't agree on which drive is which :)
Only having two drives makes it a lot simpler- What you need to do is to edit
Code:
/boot/grub/device.map
At the minute, its probably going to look something like this:
Code:
(hd0)  /dev/hda 
(hd1)  /dev/hdb
You want to edit it so that it looks something like this:
Code:
(hd0) /dev/hdb
(hd1) /dev/hda

With any luck just doing that should do it, but if not post back with changes in the error codes (If any), and I can try something else.

(If most of that went over your head, all thats important is editing the file- Post back the contents if you're not sure)

-Leezer-
 
Trying to do this now. But I can't seem to get into Ubuntu with SuperGRUB, only windows.

Also do I need to open a terminal window to modify the file you mentioned?

aaazza
 
aaazza said:
Trying to do this now. But I can't seem to get into Ubuntu with SuperGRUB, only windows.

Also do I need to open a terminal window to modify the file you mentioned?

aaazza

OK, slightly harder then :)
Your first job is to get into Ubuntu- I'm assuming there is only Ubuntu on the second disk, say if that's not the case. Boot from the SuperGrub disk, and at the initial menu select GNU/ Linux. Select Boot GNU/ Linux, and you should see a list of available kernels/ OS's (This is set by the menu.lst file within your Ubuntu install, SuperGrub simply displays it) First, try to boot it as it is- This will almost certainly give you an error of some description, but this isn't really important.
The next step is to determine which drive Grub thinks is which at the moment (This will vary depending on which drive you boot from- Generally, the device you have just booted from will be referred to as hd0, but this isn't certain)
Reboot & get back to the kernel list, but this time select the initial entry & press E- You are now editing the list of commands Grub processes to boot. Select the first line, which should look like this (The inital number may be different):
Code:
root (hd0,0)
Press E again & change it to read:
Code:
root (hd1,0)
Press B to boot this command set- Hopefully, Grub should chainload the Linux kernel & start the boot process, and you'll get a series of boot messages. However, it may not be over yet, as Grub passes a startup argument telling Linux where the kernel is located, and this is in a slightly different format.
The second line down should read something like this:
Code:
kernel /boot/vmlinuz-2.6.17-10-generic [B]root=/dev/hda1[/B] ro quiet splash
The important part here is highlighted in bold- hd* refers to the device, and the final number refers to the partition number. You should only need to change the hard drive device reference so that it looks like this:
Code:
kernel /boot/vmlinuz-2.6.17-10-generic [B]root=/dev/hdb1[/B] ro quiet splash

Alteration of only one, both or none of these parameters may be required before you can get the system to boot, but after that simply editing the devices.map file should work. To edit the file, yes its better to use the console, as you need root priveldges to edit device.map & this is actually harder through a GUI (This file only needs to be tweaked if the user friendly stuff doesn't work :p )-
Code:
sudo nano /boot/grub/device.map
**Enter your password here**

Apologies if my post is a little rambling in places :)

-Leezer-
 
Not going to do anything in this situation :(
The whole problem is that Grub & the Linux kernel don't agree on which drive is which. By installing Grub through a livecd or Linux, it uses the drive assignments that the kernel uses to guess which BIOS drive is which. In this case, they don't agree, and no amount of re-installing is going to fix this. He needs to edit the device.map file as above to get it to work :)

(Yes, I know all about this- Try figuring out the right order for 4 identical 400gb drives, a 500gb, a 200gb & a 74gb, with three of them on a separate RAID card. Not fun :p )

-Leezer-
 
Ok :D. Its still a viable option if you can get into Ubuntu tho, you can boot from the live cd and mount the linux partitions to edit the device map.

EDIT: should be can't get into ubuntu.
 
Back
Top Bottom