PDA

View Full Version : Grub config


mcc28
2nd January 2006, 10:15 AM
Hi,
I've read through the plethora of posts on Grub in here, but unfortunately I'm still stuck!

I've just added another SATA disk to my system and before used to use partman to switch between XP/Fedora, but this time I wanted to use Grub, alas with no success so far.

The but order in bios is set to HDD0 and then SCSI.

My fdisk -l is:

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 83 Linux
/dev/hda2 * 14 1033 8193150 83 Linux
/dev/hda3 1034 2308 10241437+ 83 Linux
/dev/hda4 2309 14593 98679262+ 5 Extended
/dev/hda5 2309 3583 10241406 83 Linux
/dev/hda6 3584 3902 2562336 83 Linux
/dev/hda7 3903 4157 2048256 83 Linux
/dev/hda8 4158 14593 83827138+ 83 Linux

Disk /dev/hdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 128 7297 57593025 c W95 FAT32 (LBA)
/dev/hdb2 1 127 1020096 82 Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9728 78140128+ 7 HPFS/NTFS

Disk /dev/sdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19928 160071628+ 7 HPFS/NTFS

######

My device map is:

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdb
(hd2) /dev/sda
(hd3) /dev/sdb

######

The version of XP I'm trying to boot is on /dev/sda

Extremely grateful for any help cos at the moment I'm well stuck....


Mark

shams
2nd January 2006, 11:58 AM
read this link (http://shamsweb.50webs.com/page3.html#2disk)

mcc28
2nd January 2006, 12:14 PM
Sham,

Thanks for the link.

In my grub.conf I have:

title Microsoft Windows
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
makeactive
chainloader +1

When I boot this I get the above commands printed on the screen and a flashing cursor.

As XP is on /dev/sda then based on my device.map above I thought this would work...

Any ideas?

Mark

shams
2nd January 2006, 01:48 PM
change hd0 to sd0

mcc28
2nd January 2006, 03:36 PM
change hd0 to sd0
Shams,

Do you mean like this?

title Microsoft Windows
map (sd0) (hd2)
map (hd2) (sd0)
rootnoverify (hd2,0)
makeactive
chainloader +1

mcc28
2nd January 2006, 06:24 PM
....can anyone help me with this, it's a real pain having to make the change in the bios to alternate the oses...

Mark

shams
2nd January 2006, 11:40 PM
the other way to manage is to change the bios to boot the xp drive and add the linux to the xp ntldr read this link (http://shamsweb.50webs.com/page3.html) .

markkuk
3rd January 2006, 12:23 PM
change hd0 to sd0
No. GRUB drive names are always hdN, no matter what the interface type is. Mcc28's original post shows that hd2 is the first SATA drive (/dev/sda in Linux).

mcc28
3rd January 2006, 06:17 PM
Okay,

This is my /etc/grub.conf:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda1
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.14-1.1653_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.14-1.1653_FC4 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.14-1.1653_FC4.img
title Windows XP
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
makeactive
chainloader +1

####

Whilst I cannot see anything wrong with this id /dev/sda1 = (hd2,0) maybe you guys can?

Are there any log files I can check?

Do you know anywhere else I may be able to ask to get some help?

Shams-thanks for the wingrub link, but I really would like to get it working this way if possible. Interestingly before I added the 2nd SATA drive, it did work okay....seems odd that this last drive would cause such a problem!

Mark

acalderwood
8th January 2006, 01:49 PM
Try commenting out the rootnoverify line. As hd0 and hd2 are made to swap places, hd0 becomes sda and is therefore the default root device, which is exactly what you want. rootnoverify (hd2,0) actually undoes this as it operates on hda, making that into the default root device.

--
Alastair Calderwood

leadgolem
11th January 2006, 01:15 PM
Is windows installed on sda or sdb?

Also, Note that GRUB does _not_ distinguish IDE from SCSI - it simply
counts the drive numbers from zero, regardless of their type. Normally,
any IDE drive number is less than any SCSI drive number, although that
is not true if you change the boot sequence by swapping IDE and SCSI
drives in your BIOS.

That means grub is numbering the drives according to there boot sequence, not there physical location. if you change your bios setting to boot a different hd then you also changed your device map. Grub doesn't actually look for these changes, so you may be pointing to the wrong drive.

One more thing, if you installed grub over your mbr then windows won't boot at all. If you did that then you need to use your windows install disk to rescue the mbr. Then your fedora install disk to reinstall grub in a different location.

leadgolem
11th January 2006, 04:10 PM
rootnoverify:: Set GRUB's root device without mountingThat just means don't try to mount the drive. Wich you can't do anyway because grub can't see ntfs. If you want good info on grub type info grub in terminal. I'm not sure, but I believe you are having a problem because your trying to switch a sata drive with an ata. What your probably going to have to do is set the sata drive as the first hd to boot, then use the fc4 disk to install grub on the mbr of that drive.