Grub Boot Loader Configuration

I have a nine year old PC.

It’s a PIII with dual 1Gig processors at 1Gig clock speed, with 1Gig of ram.

This is a dual boot system.

It has two hard drives, one is 250Gb loaded with Windows 2000 Professional, this is the C: drive.

The second hard drive is 400GBs where openSuse 11.0 is loaded.

I have installed a new (C:) hard drive to try and solve any existing problems. This is a dual boot system. I have Windows 2000 Professional already installed. Then I installed openSUSE 11.0. And did all of the online updates from the initial boot. Then I rebooted and can’t get back into linux. I have a slight configuration problem in the Grub boot logger. I notice in the lines of text in the boot loader sentences, that it refers to (0,6). It won’t boot there but if I edit it to (0,5) then it will start to boot but stops at a line with a $ cursor and the lines just above saying something about not being able to mount sda7 because another program has already mounted it. So I reboot with the opensuse disk and go into the option to rescue the system. When it gets to LOGIN, I login using “ROOT”. I then have the Rescue~#: cursor. I just don’t know what to type to get any answers for you. Could you please coach me with what to type so I can get info for you to help me?

I do know I have
[/boot partition that is 70.5MB], and a
/ partition that is 20.0GB], and a
[swap partition that is 2.0GB], and a
[/home partition that is 222.5GB].

All of these sizes and partitions were chosen by the installation process. I did not edit anything.

Any help would be greatly appreciated.

Don’t flame me if I have added this in the wrong area. I’m new and don’t know what I’m doing.

Meant to post (hd2,6) and (hd2,5)

We are going to need to see the contents of several files and output from a few commands. This is a lot easier to do if you have a LiveCD which connects to the internet. Using the DVD in Rescue mode we can try to post the data to the web from the command line (works with wireline broadband, probably wireless; dial-up is too complicated). So, DVD or LiveCD? We also need to know the names of your root partition, and if /boot is on its own separate partition, its name, also (like sda5 or sdb3 or sdc6, etc.). If you don’t know the names, you can probably figure them out by booting the DVD into Rescue, logging in as root, and doing:

fdisk -l

I am a little confused. I’ve not seen a motherboard of that era that can handle drives of that size?
fdisk -l output will be very interesting.

My understanding is that W2K SP3 and XP SP1 support 48-bit LBA if the bios does. I’ll need to re-check re Linux; I seem to recall that the kernel calculates its own disk geometries and does not use the bios for this purpose.

Double-checked. Supported since 2.5.x kernel. Still, there can be other issues with some PCI cards and, if the bios does not support 48-bit LBA, if the boot partition exceeds the 137GB boundary.

Thank you for your guidance in this matter.

I see several have posted so I’ll try to address all things as I go.

Concerning the size of the drives and them being recognized by the BIOS of the old mother board.

I have found that it only recognizes 127GB of drive from the Windows 32 bit OS. Not a problem because Linux sees all of it. So I use the unseen portion of the drives for Linux. But Windows thinks it has two 127 GB drives. Also along about November of 2008 I actually had this all working. I could shut down and come back and reboot just fine. Then it got so I couldn’t boot into Linux. I never have got it working completely again. I use the Gnome desktop if that makes a difference.

DVD or live CD? I bought the DVD from Novell.

Using your command of ( fdisk -l ) I came up with the following.

Disk/dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units=cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1a341a33

Device Boot Start End Blocks ID System
/dev/sda1 1 16709 134215011 7 HPFS/NTFS
/dev/sda2 * 16710 48641 256493790 f W95 Ext’d (LBA)
/dev/sda5 16719 16980 2104483+ 82 Linux Swap/Solaris
/dev/sda6 16710 16718 72229+ 83 Linux
/dev/sda7 16981 19591 20972826 83 Linux
/dev/sda8 19592 48641 233344093+ 83 Linux

Partition table entries are not in disk order

Disk/dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units=cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5049e9d9

Device Boot Start End Blocks ID System
/dev/sdb1 * 1 16708 134206978+ 7 HPFS/NTFS

So the following are the Linux partitions.

/dev/sda5 = swap

/dev/sda6 = /boot

/dev/sda7 = / (mount)

/dev/sda8 = /home

One final note. The Grub boot loader is installed fine. Because I use it to load Windows 2000 Pro. It’s just the command lines in Grub Boot loader that command Linux to start that are screwed up. I may be speaking out of turn here. Inexperience in what I’m saying. May have stuck foot in mouth.

Thank you very much for your help… It is much appreciated.

I have found that it only recognizes 127GB of drive from the Windows 32 bit OS . . .

As posted previously, with the necessary service pack Windows will see past 137GB, but unlike Linux Windows is dependent on the bios also supporting 48-bit LBA. In some bios’s, there is a switch that enables that. But in an older machine, it’s likely that the bios must be flashed, assuming there was a bios update.

The Grub boot loader is installed fine. Because I use it to load Windows 2000 Pro. It’s just the command lines in Grub Boot loader that command Linux to start that are screwed up. I may be speaking out of turn here. Inexperience in what I’m saying. May have stuck foot in mouth.

Not a problem at all, and in fact that info helps a lot. The reason for asking whether you have the DVD or the LiveCD is that the instructions for posting data back here will be different. What we need to see first is the contents of /boot/grub/menu.lst (which requires root to read). And by the way, since you can’t boot into openSUSE, how did you get the fdisk output posted back here?

I am running W2K with SP4.

I wrote the stuff on the screen down and then typed it out here.

I am running W2K with SP4.

Then the constraint is the bios.

I wrote the stuff on the screen down and then typed it out here.

Thanks for doing that; I was trying to avoid you having to do that by hand. So can you do the same for /boot/grub/menu.lst, /boot/grub/device.map, and /etc/grub.conf? Probably not a lot to write down.

Or if you want to give a try at posting the file to the web directly (again, assuming your net connection is broadband), you can do this (as root from the DVD Rescue System command line):

mount -t ext3 /dev/sda7 /mnt
mount -t ext3 /dev/sda6 /mnt/boot
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
/etc/init.d/network start
ping -c 4 www.nopaste.com
cat /boot/grub/menu.lst /boot/grub/device.map /etc/grub.conf > file.txt
curl -F file=@file.txt nopaste.com/a

If the ping works, your system is connected to the net and has DNS. The cat command will combine the three files into one. The curl command will copy that file to nopaste.com; the server a url with a page ID. Write that down, boot into Windows and verify it worked (nopaste.com/p/<pageID>) and post the url back here.

What do I type on the Rescue ~# command line to get it to display the contents of /boot/grub/menu.lst ?

Sorry about that! Here it is (logging in as root):


mount -t ext3 /dev/sda7 /mnt
mount -t ext3 /dev/sda6 /mnt/boot
cat /mnt/boot/grub/menu.lst
cat /mnt/boot/grub/device.map
cat /mnt/etc/grub.conf

The ping worked and I tried twice to send, but it came back with some sort of problem with the “file.txt”??

So I just wrote it down and typed it up.

Return for “menu.lst”

#Modified by YaST2 . Last modification on Tue Feb 24 09:06:59 MST 2009
default 1
timeout 8
gfx menu (hd0,5)/message

###Don’t change this comment – YaST2 identifier: Original name: xen###
title Xen - - openSUSE 11.0-2.6.25.20-0.1
root (hd0,5)
kernel /xen.gz
module /vmlinuz-2.625.20-0.1-xen root=/dev/mapper/pdc_bjgihaebg_part7 resume=/dev/mapper/pdc_part5 splash=silent showopts vga=0x31a
module /initrd-2.625.20-0.1-xen

###Don’t change this comment – YaST2 identifier: Original name:linux###
title openSUSE 11.0-2.6.25.20-0.1
root (hd0,5)
kernel /vmlinuz-2.6.25.20-0.1-pae root=/dev/mapper/pdc_bjgihaebg_part7 resume=/dev/mapper/pdc_bjgihaebg_part5 splash=silent showopts vga=0x31a
initrd /initrd-2.6.25.20-0.1-pae

###Don’t change this comment – YaST2 identifier: Original name:failsafe###
title Failsafe - - openSUSE 11.0-2.6.25.20-0.1
root (hd0,5)
kernel /vmlinuz-2.6.25.20-0.1-pae root=/dev/mapper/pdc_bjgihaebg_part7 showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off xllfailsafe vga=0x31a
initrd /initrd-2.6.25.20-0.1-pae

###Don’t change this comment – YaST2 identifier: Original name: windows 1
title windows 1
rootnoverify (hd0,5)
chainloader (hd0,0)+1

###Don’t change this comment – YaST2 identifier: Original name: windows 2000 pro
title windows 2000 pro
rootnoverify (hd0,5)
chainloader (hd0,0)+1

###Don’t change this comment – YaST2 identifier: Original name: floppy
title floppy
rootnoverify (hd0,5)
chainloader (hd0,0)+1

Here’s the return for “device map”

(fd0) /dev/fd0
(hd0) /dev/mapper/pdc_bjgihaebg

Here’s the return for “grub config”

setup - - stage2=/boot/grub/stage2 (hd0)(hd2,6)
quit

What I find interesting about this is the fact that the Grub Boot Loader installed is actually (stage 1.5), I wonder if that has anything to do with things?

Sorry the upload didn’t work; it tests out OK on my machine. Thanks for going the long way . . .

Quick explanation re stage1.5 . . . grub stage1 is what is installed in either the MBR of a partition boot sector; in it is embedded a pointer to the location of the actual loader program, stage2. Stage1.5 is a driver for the type of file system that stage2 is on, so that stage1 can read that file system and find the file; the stage1.5 file is physically placed in the space that is left empty following the boot sector. In short, stage1 uses stage1.5 to locate stage2.

Would you please double-check the contents of /etc/grub.conf? Note that you show “(hd0) (hd2,6)” - but there is no (hd2) according to your fstab; that would be a 3rd disk. This is important because the (hd2,6) is supposed to be the location of stage2. It should be “(hd0) (hd0,5)”. Having said that, you would not get the grub menu at all if this is incorrect (and you are booting W2K from grub, correct?). Are you also getting the green grub boot splash menu?

Try this, please: Boot to the grub menu. If you are getting a splash, press Escape to drop it to a text menu. Then press the ‘c’ key; you will be dropped into the grub shell. Then type the following precisely:

root (hd0,5)
kernel /vmlinuz root=/dev/sda7
initrd /initrd
boot

After the root command grub should return "file system is type ext3 . . . ". The kernel command should return "Linux-bzImage . . . ". The initrd command should return "Linux-initrd . . . ".
If that does not boot you into openSUSE, repeat the process but this time in the shell do:

find /grub/stage2

Grub should return: (hd0,5); if it does not, then try:


find /boot/grub/stage2

What does that return?

Finally, sda drive is connected to a Promise PCI card or an on-board Promise controller??? What is sdb connected to?

Grub Menu:

I do get a screen displaying the Grub menu. It is not green. It looks more like DOS, it’s black with white letters. It gives me three options to boot.

1.openSUSE 11.0
2.Failsafe openSUSE 11.0
3.Windows 2000 Pro

I’ll answer your last question first. The “sda” drive is the “hd2” drive. The “sdb” drive is my “hd0” drive. The “sdb” drive is my main drive that contains C: “sdb” is connected directly to the motherboard. The “sda” drive is hooked to a raid controller card.

Your Code:

root (hd0,5) won’t work.
Error22: No such partition

root (hd0,6)
Error22: No such partition

root (hd2,0)
Filesystem type unknown, partition type 0x7

root (hd2,1)
Filesystem type unknown, partition type 0xf

root (hd2,2)
Error22: No such partition

root (hd2,3)
Error22: No such partition

root (hd2,4)
Filesystem type is ext2fs, partition type 0x82

But root (hd2,5) returns:
Filesystem type is ext2fs, partition type 0x83

root (hd2,6)
Filesystem type is ext2fs, partition type 0x83

root (hd2,7)
Filesystem type is ext2fs, partition type 0x83

root (hd2,8)
Error22: No such partition

kernel /vmlinuz root=/dev/sda7
Error17: Cannot mount selected partition

kernel /vmlinuz root=/dev/sda5
Error17: Cannot mount selected partition

kernel /vmlinuz root=/dev/sda6
Error17: Cannot mount selected partition

Code:
find /grub/stage2
answers with (hd2,5)

find /boot/grub/stage2
answers with these two items one above the other:
(hd2,5)
(hd2,6)

I think I got everything you ask for, got all of my fingers crossed.

One question here. Do you think it would make any difference if I reinstalled everything on the “sdb” main drive?

No need to reinstall just yet. But it may come to that. It depends on whether grub can successfully see the disk on the RAID controller, and that will depend on when/how the controller is recognized. There is some strangeness here. For example, the bios is reporting the PCI card’s controller as the first in the chain (sda) and the on-board chipset’s controller as second (sdb) - that is highly unusual. And grub’s query of the bios is returning 3 devices, which is why there is an (hd0) and a (hd2); so where is (hd1)? By the way, where is the interface to manage arrays on this controller; is it an extension of the system bios or is it a Windows driver (i.e., after loading the OS).

For now, at the grub menu, again press ‘c’ to go into the shell, then do:

root (hd2,5)
kernel /vmlinuz root=/dev/sda7
initrd /initrd
boot

If that doesn’t work, restart the system and try this instead:

root (hd2,6)
kernel /boot/vmlinuz root=/dev/sda7
initrd /boot/initrd
boot

Report back.

The interface to control arrays I think is in the BIOS. Because I see it recognize the drives while in the boot up before windows loads.

Code:

root (hd2,5)

Filesystem type is ext2fs, partition type 0x83

kernel /vmlinuz root=/dev/sda7

[Linux-bzImage, setup=0x3000, size=0x205380]

initrd /initrd

[Linux-initrd @ 0x37a85000, 0x56ad38 bytes]

boot

Then it started to boot up. It got way down the list and then came up with the deadly “$”

The sentences just above the “$” said that some other program had exclusive control of the partition so it was unable to mount.

So I tried the second set of code.

Code:

root (hd2,6)

Filesystem type is ext2fs, partition type 0x83

kernel /boot/vmlinuz root=/dev/sda7

Error15: File not found

So it tried but failed…

By the way thanks for all of this help…

I think we have determined what the correct boot syntax is. But as I posted previously there are several things amiss. Note that /boot/grub/menu.lst looks for (hd0) to find the boot partition. And /boot/grub/device.map shows (hd0) as the PCI card disk. This suggests that the boot disk sequence in the bios has been changed from the original install. And, /etc/grub.conf which is the command fed to the grub shell for installation shows grub stage1 being installed to the sda MBR but pointing to stage2 on sda7 rather than sda6. All of this can be fixed, once we determine what it is that is actually hanging the boot.

What I need to see is the /etc/fstab file that controls the mounting at boot, and the kernel boot log, /var/log/boot.msg. The first you could copy by hand, but the second is much too long. So let’s try again to use the method you were unsuccessful with before, uploading both files. So boot into Rescue System, log in as root, and do the following (this must be done perfectly precise as each command depends upon the preceding one):

mount -t ext3 /dev/sda7 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
cd /root
/etc/init.d/network start
ping -c 4 www.nopaste.com
cat /etc/fstab /var/log/boot.msg > bootfiles
curl -F file=@bootfiles nopaste.com/a

After you chroot, the prompt will change color (probably from white to red); you’ll know the following commands are all in the chroot environment as long as the prompt is a red # sign. When you do the network start, you should get a message to that effect. The ping verifies you’re connected to the internet and that whatever you use for DNS (url resolution) is working. A few seconds after the curl command it should return this:

http://nopaste.com/p/<xxxxxxxxx>

Where <xxxxxxx> is an alpha-numeric, upper/lower case url ID. Write that down, reboot into Windows and type that into a browser address bar (careful not to omit the “/p”), and you should see the contents of “bootfiles” displayed. Copy/paste that url back here.

All went well with the code until right after I typed:

curl -f file=@bootfiles nopaste.com/a

and I pushed enter, this is what returned:

curl: (6) Couldn’t resolve host ‘bootfiles’
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML//EN”>
<html><head><title>302<title><head><body><p>Redirecting to <a href=‘http://nopaste.com/’>http://nopaste.com/</a></p></body><html>

So I decided to go for “/etc/fstab”, here’s what I got.

/dev/mapper/pdc_bjgihaebg-part5 swap swap defaults 00
/dev/mapper/pdc_bjgihaebg-part7 / ext3 ACI, user_xahr 11
/dev/mapper/pdc_bjgihaebg-part6 /boot ext3 ACI, user_xahr 12
/dev/mapper/pdc_bjgihaebg-part8 /home ext3 ACI, user_xahr 12

/dev/disk/by-id/scsi-SATA_WDC_WD2500AVJB-_WD-WCARZ0627215-part1 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0

/dev/mapper/pdc_bjgihaebj_part1 /windows/G ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0

proc /proc proc defaults 00
sysfs /sys sysfs noauto 00
debugfs /sys/kernel/debug debugfs noauto 00
usbfs /proc/bus/usb usbfs noauto 00
devpts /dev/pts devpts mode=0620,gid=5 00
/dev/sda7 /data2 ext3 defaults 11
/dev/sda7 /data3 ext3 defaults 11
/dev/sda7 /data4 ext3 defaults 11
/dev/sda7 /data5 ext3 defaults 11
/dev/sda7 /data6 ext3 defaults 11
/dev/sda7 /data7 ext3 defaults 11
/dev/sda7 /data8 ext3 defaults 11
/dev/sda7 /data9 ext3 defaults 11
/dev/sda7 /data10 ext3 defaults 11
/dev/sda7 /data11 ext3 defaults 11

You were right the other file is huge!!!

Let’s start with /etc/fstab, because there is something definitely weird there. Where did all this come from???


/dev/sda7 /data2 ext3 defaults 11
/dev/sda7 /data3 ext3 defaults 11
/dev/sda7 /data4 ext3 defaults 11
/dev/sda7 /data5 ext3 defaults 11
/dev/sda7 /data6 ext3 defaults 11
/dev/sda7 /data7 ext3 defaults 11
/dev/sda7 /data8 ext3 defaults 11
/dev/sda7 /data9 ext3 defaults 11
/dev/sda7 /data10 ext3 defaults 11
/dev/sda7 /data11 ext3 defaults 11

That is attempting to mount the root partition 10 times at a location other than root (that is, “/”). I don’t know how the kernel would handle this, but it certainly is conceivable this could upset the boot process. So you need to delete all those lines. In Rescue the text editors are difficult for new users, so I suggest that you install “nano” which will be much easier for repairing the file. So again, boot into Rescue, login as root, and do:

mount -t ext3 /dev/sda7 /mnt
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt
/etc/init.d/network start
zypper in nano
nano /etc/fstab

Zypper will install nano as long as you have a repository configured that it can access. When you run nano it will load /etc/fstab. You use the cursor keys to navigate in nano. Just scroll down to the end of those bogus lines and press the Backspace key to erase them. When you get to the first character of the top-most line (the /data2 line) erase it but do NOT let the cursor return to the end of the last good line (the devpts line); if you accidentally do that then hit Enter to put the cursor to the line following (fstab needs a line-feed at the end of each line to know the line is ended). Then do Ctrl-O (as in orange, not a zero), nano will display the file name, press Enter and nano will tell you the file was written. Do Ctrl-X to exit nano.

Side note: You typed “ACI, user_xahr” from fstab. I trust that was a typo. It should be “acl,user_xattr”. If it’s not, you can correct that in nano while your there, too.

Then do:

exit
shutdown -r now

To reboot the machine. Remove the DVD. Once again at the grub menu, hit ‘c’ to go to the shell, and do:


root (hd2,5)
kernel /vmlinuz root=/dev/sda7
initrd /initrd
boot

If you get into openSUSE, post back and we’ll fix the boot files. If the boot process still fails, we need to once again try to upload the logfile. In your post above, you have a typo; you used “-f” instead of “-F”; that will fail. So here’s the drill again, modified since you only need to upload the one file. This should work, again from Rescue as root:

mount -t ext3 /dev/sda7 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
/etc/init.d/network start
cd /var/log
curl -F file=@boot.msg nopaste.com/a

Check that you wrote down the url correctly, post it back here.