LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2004, 09:06 PM   #1
p1800
LQ Newbie
 
Registered: May 2004
Posts: 9

Rep: Reputation: 0
GRUB errors, booting on 2nd hard drive


I am a newbie running Redhat 8 on my second harddrive. First drive is Windows 95. For 6 months I've been booting Linux from the floppy, or Windows from C: (hd0). Then I tried to change my BIOS to boot on D. What happened was that I saw 'GRUB' and a perpetually flashing cursor. I thought that the boot was looking for GRUB and couldn't find it.
More info: I had partitioned hdb so that the first partition hdb1 is /boot and the second is /.
More info: when I boot with the floppy, the initial message is 'press return or .... to boot from /dev/hdb2. Which is root.
So I installed grub into hdb. (/sbin/grub-install /dev/hdb)
Now, when I try to boot on D (hdb), I get an error message:

root hd1,1
Filesystem type unknown, partition type 0xF hd1,1.
press any key to continue.

So I did so, and got the menu with both Linux and DOS choices. The Linux choice didn't work.
My grub.conf file looks like:
...
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hdb1
default=0
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd1,1)
kernel /vmlinuz-2.4.18-14 ro root=/dev/hdb1
initrd /initrd-2.4.18-14.img
title DOS
rootnoverify (hd0,0)
chainloader +1

It's the grub.conf that existed before I reinstalled grub.
Now I notice that I've defined root as hdb1, which it isn't. However, there are error messages before Grub ever gets to the menu.

I would really appreciate some help before I do something I shouldn't.
By the way, these forums are great. So great, that I haven't had to ask anything before now.

Thanks,
Ann
 
Old 05-19-2004, 09:39 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,710

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
Filesystem type unknown, partition type 0xF hd1,1.
0xf is an extended partition ID. So I am interested in how the 2nd hard drive is partitioned. Post the output of:

fdisk -l /dev/hdb (that is a small L)
 
Old 05-20-2004, 04:39 PM   #3
p1800
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Disk /dev/hdb: 255 heads, 63 sectors, 524 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 332 2562367+ 83 Linux
/dev/hdb3 333 396 514080 83 Linux
/dev/hdb4 397 524 1028160 5 Extended
/dev/hdb5 397 460 514048+ 83 Linux
/dev/hdb6 461 493 265041 82 Linux swap
/dev/hdb7 494 524 248976 6 FAT16
~

Hmm, what is that + on the root partition?

Thanks,
 
Old 05-21-2004, 04:40 AM   #4
sbogus
Member
 
Registered: May 2004
Location: Germany, Munich
Distribution: SuSE Pro Releases 7.3, 9.0, CentOS 4.0, Kubuntu 6.0x
Posts: 103

Rep: Reputation: 15
Hi p1800,

what have had happened is that when you change the boot device in BIOS the GRUB is confused to find his Stage 1.5 and Stage 2 files. For GRUB hd0 is the primary boot device and not necessarily the hda disk. In your case hd0 is the hdb disk, so you should change menu.lst (or grub.conf, whatever your GRUB uses as configuration file) as follows:


title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel (hd0,1)/vmlinuz-2.4.18-14 ro root=/dev/hdb2
initrd (hd0,1)/initrd-2.4.18-14.img

title DOS
rootnoverify (hd1,0)
makeactive
chainloader +1


This should make your GRUB boot perfect.

Kind regards,
sbogus
 
Old 05-23-2004, 10:34 AM   #5
p1800
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Question

Dear sbogus,
thanks. I tried the above and got to the grub.conf menu. But when I selected Red Hat I got an error message:
root (hd0,1)
File system is ext2fs, partition type 0x83 (that's an improvement!)
kernel (hd0,1)/vmlinuz-version ro
Error 15: File not found.

This is where my files are:
/boot (hdb1): vmlinuz-version; grub directory with stages 1,2 and 1-5, and grub.conf
/(hdb2): initrd directory; and sbin/grub (executable file)

I tried changing to:
kernel (hd0,0)/vmlinuz-version ro
since vmlinuz is on hdb1 /boot. Then I got an error message:
...root=hdb2
error 11: unrecognized device string.

This is my grub.conf:
...
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel (hd0,1)/vmlinuz-2.4.18-14 ro
root=/dev/hdb2
initrd (hd0,1)/initrd-2.4.18-14.img
...
To me, a newbie, it seems like it should read:
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel (hd0,0)/boot/vmlinuz-2.4.18-14 ro
root=/dev/hdb2
initrd (hd0,1)/initrd/initrd-2.4.18-14.img
But that didn't work either.

I'm perfectly willing to reinstall linux, but I'd like to know how to avoid the above.
Thanks,
p1800

Last edited by p1800; 05-26-2004 at 12:29 PM.
 
Old 05-26-2004, 08:57 PM   #6
p1800
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
I tried again, after using the grub> find command for vmlinuz and initrd,and got through the following:

root (hd0,1)
kernel (hd0,0)/vmlinuz-version ro
root=/dev/hdb2

Then I got an error 11, unrecognized device string

So I tried

root (hd0,1)
kernel (hd0,0)/vmlinuz-version ro
root=(hd0,1)/dev/hdb2
initrd (hd0,0)/initrd-version

I got a boot, which turned into a kernel panic. To summarize:

VFS mounted root (ext2)
Loaded ext3 module
mounted /proc filesystem
mounting root filesystem
EXT3 -fs- unable to read superblock
mount: error 22 mounting ext3
pivotroot: pivot_root (/sysroot,/sysroot/initrd) failed:2
umount /intird/proc failed:2
Freeing unused kernel memory 20k failed
Kernel panic: no init found. Try passing init= option to kernel

This does not happen when I boot with the floppy.
Does grub keep referring to my initial boot hard drive as hd0,
even though the bios thinks of it as the second hard drive?

I'd appreciate any references.

p1800
going nowhere fast
 
Old 06-03-2004, 04:51 AM   #7
sbogus
Member
 
Registered: May 2004
Location: Germany, Munich
Distribution: SuSE Pro Releases 7.3, 9.0, CentOS 4.0, Kubuntu 6.0x
Posts: 103

Rep: Reputation: 15
Hi p1800,
sorry for the big delay.

First of all I notice you made mistake in your menu.lst file. The root=<string> statement is parameter to the kernel statement and not separate line in the config file.

According to this part of your post:
Quote:
I tried again, after using the grub> find command for vmlinuz and initrd,and got through the following:

root (hd0,1)
kernel (hd0,0)/vmlinuz-version ro
root=/dev/hdb2
If the find vmlinuz-2.4.18-14 command gave you as result the device specification (hd0,0), then this is your root partition and you should write this in the menu-lst file:

title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel (hd0,0)/vmlinuz-2.4.18-14 ro root=/dev/hdb1
initrd (hd0,0)/initrd-2.4.18-14.img


and not this:

root (hd0,1)
kernel (hd0,0)/vmlinuz-version ro
root=(hd0,1)/dev/hdb2
initrd (hd0,0)/initrd-version


The find command of grub shell gave you already all information you need to make clean boot. The unrecognized device string error comes from the wrong line root=/dev/hdb2, wich actualy belong to the kernel statement

If it is still wrong and does not boot, then please provide here the output of the grub command find for your menu.lst, vmlinuz-2.4.18-14 and initrd-2.4.18-14.img files

Kind regards,
sbogus
 
Old 06-04-2004, 09:34 PM   #8
p1800
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Smile

dear sbogus,
yes, that worked!!
I'm not sure why grub doesn't need the directories under root where vmlinuz and initrd are located, but it evidently doesn't.
Now I'm working fine, until I want to boot windows!
Thanks,
P1800
 
Old 06-11-2004, 11:58 PM   #9
Communist
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Rep: Reputation: 0
Windows XP + RH 9 linux

Hello,

I have a similar problem to P1800, but slightly different. I have a computer with two hard drives. Until now, I did not even install the second drive, and was using Windows XP as my first. However I am a newbie to Linux and I use it a lot at work, and really prefer it to XP.

So I took my second drive and disconnected my primary drive from my comp and installed Red Hat 9.0 on the second drive, making the installer think that there is only one drive in this machine. I did this cause I have a lot of software and files in my XP drive, and did not want Linux installer to touch the MBR of that drive.

Now Grub thinks I only have one drive, and I tried to manually put Windows XP in grub.conf, so when I rebooted, my grub looked really really messy, it was basically black and white and unreadable, and not even one of the OS would work. After I click on any OS, it would state and error message, and since my screen is messed up, I could not even read the error message.

This is what the original grub.conf file looked like after all the comments:



default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img


I then changed it to this and reconnected my primary drive back to reboot (hda):


default=0
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd1,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

title Windows XP
rootnoverify (hd0,0)
chainloader +1

I thought since hda is for Windowx, hd0 would refer to that, but reading your other post cleared that for me. Now I cant load grub at all, is there any way I can boot into Linux without going through GRUB, or do I have to reinstall it?

Also is there anything else that I have to change in the grub.conf file? hda for me is XP, and hdb is Linux, and I really dont want to GRUB to touch the MBR on the XP drive.

Thanks in advance for all the help.

Kind regards,

Communist
 
Old 06-12-2004, 06:00 AM   #10
sbogus
Member
 
Registered: May 2004
Location: Germany, Munich
Distribution: SuSE Pro Releases 7.3, 9.0, CentOS 4.0, Kubuntu 6.0x
Posts: 103

Rep: Reputation: 15
Hi Communist,
/ btw. nice nickname is this /

In general it is not very good idea to pick out a drive in order to let some OS' installer thinking there's only one drive in the system. Things might get really weird.

If you know what you want and what you do, there's nothing to afraid of even leaving both drives inplace and installing Linux telling it not to touch one of the drives. It will do really nothing to the other drive.

I've in my box two harddisks and have installed SuSE on the second drive without to touch the first one.

To your problem...

First of all, check in BIOS which drive is your primary boot disk and which is the secondary one. The primary boot disk is referred as hd0 by GRUB, the secondary as hd1 and so on.
To get rid of the messed up screen, you should check these points:
  • When you power on your machine, do you see clearly the initial check&enumerate messages from the machine's BIOS? If No then there's hardware problem - probably you didn't install properly the second disk after its previous removal. Check that and install properly the disk including all wires&cables
  • So, you see the initiali BIOS check&enumerate screen, then you probably don's see the boot screen where the PCI, IDE, SCSI and (probably) Network busses are scaned to find a bootable device. If Yes (you do not see clearly the boot screen) then there's again some harware problem - loose cards or connectors on the mainboard, loose RAM modules, bad RAM modules or something alike. Check this. Also check the video card! It migh be the problem case
  • So you see properly the boot screen, but after the boot process has been initiated from the BIOS you get a messed up screen where you can read nothing. This is problem with misplassed boot loaders. For example if you switched the boot sequence and or messed up the boot configuration of the OSes this might be the case. Check this according the information for hd0 and hd1 I gave you above

In your modified grub.conf you've changed default 1 to default 0. Although I do not think it might be critical, you better change it back to default 1. This statement tells GRUB which is the default boot configuration it should execute. I do not know how GRUB reacts if the value is zero.

Second thing is to reinstall GRUB in the MBR of your Linux drive and not in the MBR of your Windows XP drive.

Try these thing and come back here to post the results. I wish you good luck.

Kind regards,
sbogus
 
Old 06-12-2004, 09:24 AM   #11
Communist
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Rep: Reputation: 0
Hi Sbogus,

Thanks you so much for your quick reply. On the side, just to give you a little background about my nickname, I was actually born in China, but am not from there, so I just use this nick for everything, to keep a little association with my birthplace.

Now for the things that you told me to do.

1. I checked the BIOS and it says that my Windows drive is the primary boot loader. Right now I am using my XP drive and its working fine. I have put my XP drive to boot up first in the BIOS. My plan was to make the Linux (hdb) drive to boot first, so that GRUB would load. Anyways according to the BIOS the primary boot disk is the XP (hda).

2. When I boot up, the BIOS detects all the three of my drives, the two disks and the CD-RW drive. To load XP instead of GRUB i just tell it to boot from my hda first.

3. I also do see the boot devices screen where it checks to see what to boot up from, because my BIOS always says looking to BOOT from CD since my CD-RW is set to be the first boot up drive. I am not an expert, but dont thing there are any hardware problems, cause I reinstalled Linux again last night, and it worked fine. The RAM and Video Card are also fine, they all work when I boot up with XP.

4. When I leave my Windows drive and try to install redhat, then it always loads GRUB to hda and does not give me the option to change it to hdb, no matter what I do. The Disk druid screen gives me an error when I tell it to create a /Boot in hdb. Says that it can only do it in hda. I dont know if this makes sense to you.

I have not changed the default back to 1. I was wondering if there is a way I can get back into Linux, since my GRUB does not work, or do I have to reinstall Linux.

I am willing to reinstall RedHat, I just dont want it to touch my hda, do you have any suggestions on how to do that?

Thanks again for all the help... Hopefully I can start helping out people in a few years.

Kind Regards,

Communist
 
Old 06-12-2004, 07:36 PM   #12
Communist
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Rep: Reputation: 0
Hi sbogus,

Thought I would update you on something else that I did today. I connected my Windows XP drive and my RedHat drives. I changed the order of booting in my bios, I told it to boot first from CD, then my RH drive (primary slave) and then my XP drive (primary master). I then reinstalled RH and installed GRUB in the MBR for the RH drive. Ofcourse it was a fresh install.

I did a minimum install to save time. Now when I reboot my computer, it can boot to GRUB, but when I tell it to load XP, a blank screen with just this written on it comes up:

Booting 'Windows XP'
rootnoverify (hd1,0)
chainloader +1

and then just stays at that screen and does nothing. I then restart my maching and try to load RH, and it works just fine. I also dont have the previous problem with not being able to see GRUB clearly, the image appears just fine now.

Then I went back to the BIOS and changed the order of booting to CD first, then XP and finally RH. Once I saved the BIOS, XP booted up just fine. So I have a long work around to get into RH and XP, I just have to go to my bios and change the order of booting the drives.

I would love to have GRUB work just fine. Here is the grub.conf file, I have made no changes to this, its the default one that RH made while installing itself (please remember that this time, RH knew that I had a Windows XP drive, and I just made it install GRUB in the RH drive, hdb MBR):

# boot=/dev/hdb (commented line)

default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

title Windows XP
rootnoverify (hd1,0)
chainloader +1

Any suggestions? Like I said I can boot into both OS' just fine, I just dont want to keep on going to the BIOS and changing the boot order each time I want to load into the other OS. Thanks a lot for all your help on this.

Kind regards,

Communist
 
Old 06-14-2004, 04:15 AM   #13
sbogus
Member
 
Registered: May 2004
Location: Germany, Munich
Distribution: SuSE Pro Releases 7.3, 9.0, CentOS 4.0, Kubuntu 6.0x
Posts: 103

Rep: Reputation: 15
Hi Communist,
Yes, I do have suggestions for your boot problem.

First of all, which version of GRUB do you use in RH? Mine is 0.93.x and has one very weird behaviour when it should boot Windows installations.

It says exactly the same thing as in your case.

This is what I've in my menu.lst (this is the SuSE's configuration file for GRUB)


title Windows
rootnoverify (hd1,0)
chainloader +1


I do have SuSE 9.0 on my hdb and Win2k on my hda, I boot from hdb and use GRUB to boot in Windows and in Linux.

So if I choose to boot in Windows it says

booting Windows
rootnoverify (hd1,0)
chainloader +1


and then nothing further occurs - it just does not boot.

I modified the Windows setion like this one in tiny hope it will work. Note the map commands remap the devices so that Windows can think it boots from the primary disk (which in some cases is really needed - bad, bad Windows! )


title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
chainloader +1


but I got an error telling me there's something wrong in the partition and it can't be chainloaded (executed). Then I just tried (inspiration from Tux probably ) to remap the drives again, so I got the following configuration section


title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1


And... Tux bless me! I got my Win2k booting...! I do not know why do I need to remap the devices twice, but apprently I do need this in order to be able to boot into Windows.

I hope this will help you.

Kind regards,
sbogus
 
Old 06-17-2004, 09:54 PM   #14
Communist
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Rep: Reputation: 0
Hello sbogus,

Thanks a lot for your prompt response. I have not tried it yet. My linux drive actually has freaked out on me. It happened all of a sudden, I think its fried. Anyways I am going to be further testing it out, and if it is fried, I will get a new one and try the linux experiment all over. Will let you know once I am done with all this.

Thanks again!

Kind regards,

Communist
 
Old 12-02-2004, 01:05 PM   #15
degrees
LQ Newbie
 
Registered: Dec 2004
Location: Visalia, CA USA
Distribution: OpenSuSE 10.3
Posts: 1

Rep: Reputation: 0
Worked perfectly - thank you

I just wanted to say thanks to sbogus for the advice. It worked perfectly!

My situation was this: I had added a hard drive to a PC, and because it was larger, made it the primary boot, and installed SuSE 9.1 - and I used it for a couple months. Unfortunately, the machive was flakey when I had to reboot - and I figured out the power supply was too weak for the big hard drive.

So I moved the hard drive to my main Windows XP machine. If I made the Win XP hard drive the (first) boot drive in BIOS, that worked - but of course, Linux wasn't a boot option. If I made the Linux hard drive the (first) boot drive in BIOS, I could boot to Linux, but selecting the Windows boot just failed with:

root (hd1,0)
Filesystem type unknown, partition type 0x7
chainloader +1


Thanks to sbogus guidance, the Linux hard drive is the primary boot drive - and I can boot either OS.

Excellent help people! Thank you so very much!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2nd hard drive naflan Debian 4 02-22-2004 02:55 PM
RH9 Software Raid 1 hard drive failure - GRUB loader errors Mynar Linux - Newbie 1 01-28-2004 10:25 AM
grub, hard drive mapping, booting chrisrose21044 Linux - Newbie 1 09-29-2003 08:57 AM
2nd hard drive neo.sarcastic Linux - Hardware 4 09-22-2003 11:22 PM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 09:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration