LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-04-2007, 01:58 PM   #1
shahgols
Member
 
Registered: Dec 2006
Posts: 97

Rep: Reputation: 15
GRUB fails to boot OS


Hi everyone,

I installed Vector Linux 5.8, which installs Lilo by default, so I told it not to install Lilo because I prefer GRUB. My partition is simple and looks like:

Part 1: root (/), bootable, beginning of h/d, ext3 fs
<empty space>
Part 2: swap, end of h/d, linux swap fs

I used a GRUB disk to boot Vector Linux (VL) and downloaded GRUB .97. I then untarred it and ran ./configure, make, make install, make clean. The whole process did not produce any errors and it created a i386-dc directory with stage1, stage2, and a bunch of other files in it. I then created a /boot/grub directory and copied all of the files under i386-pc in there. I also took a menu.lst template and added the follwoing to the end of the file:

title Vector Linux 5.8 Standard Gold
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
savedefault

Then I started the command line and went to grub and entered:

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

It ran without errors. I then rebooted and was presented with the GRUB boot screen. Vector Linux is highlighted and when I press enter, it says "Error 15: File not found". I go back to the GRUB boot screen and from there to the GRUB command line and enter exactly the same thing as there is in the menu.lst file (although here there are = signs, but the info is the same):

grub> root=(hd0,0)
grub> kernel=/boot/vmlinuz root=/dev/hdb1 ro
grub> boot

This works just fine. Can someone tell me what I did wrong and how I can fix it? Thanks in advance.

Oh, one more thing, I only have one hard drive, so shouldn't it be called hda1?
 
Old 01-04-2007, 02:13 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Quote:
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
These lines do not agree. Change 'root=/dev/hdb1' to 'root=/dev/hda1' so that it agrees with 'root (hd0,0).
 
Old 01-04-2007, 02:32 PM   #3
shahgols
Member
 
Registered: Dec 2006
Posts: 97

Original Poster
Rep: Reputation: 15
Hi there,

I tried that and it starts booting the OS and prints a bunch of stuff to the monitor (as usual, when it's loading) and then it fails to load the OS and says:

Cannot open root device "hda" or unknown block (0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)

When I use root=/dev/hdb1, it loads just fine. I am not a computer guru, but I think that it should be /dev/hda1, as you said, because it is the only h/d on my computer. However, everything says hdb1, for example, I used Gparted LiveCD and it says hdb1, df shows hdb1, etc.
 
Old 01-04-2007, 03:01 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
It seems maybe that something is showing up as hda. Run fdisk -l and post the output here.

In grubspeak, the two "root" entries mean totally different things:

root (hd0,0) tells GRUB that it's homebase is in the directory to which drive1, partition1 is mounted. In Linux-speak, this would mean hda1.

kernel vmlinux......root=/dev/hdb1 tells the kernel to mount the filesystem at hdb1

kernel /boot/vmlinuz..........tells GRUB that the kernel is in the /boot directory--The normal situation when there is no /boot partition.

Is it possible for GRUB to think that hd0,0 is drive 1, while the kernel thinks that hdb is drive 1??? I have no idea.
 
Old 01-04-2007, 03:10 PM   #5
shahgols
Member
 
Registered: Dec 2006
Posts: 97

Original Poster
Rep: Reputation: 15
Thanks for the explanation of the different parts of the GRUB code. I needed that.

Could it be that something needs to be changed in the BIOS?

Here's the output that you asked for:

root:# fdisk -l

Disk /dev/hdb: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 9726 78124063+ 83 Linux
/dev/hdb2 19902 20023 979965 82 Linux swap

Thanks.
 
Old 01-04-2007, 03:53 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
This all looks normal....I assume that there is a CD or something on hda, but no matter. If you tell the bios to boot from hard disk (that is the default), it will go to hdb.

Try this---just for the sake of eliminating some variables. Change your cabling and/or jumpers so that the harddrive shows up as hda. For example, a normal setup would be the harddrive as primary master, and the CD (or whatever) as Secondary master. Once you do this, then you will need to set up the grub configuration with the kernel line pointing to /dev/hda1

Change the BIOS? No--if it goes to a hard drive at all, it goes to the MBR. Nothing to change
 
Old 01-04-2007, 04:00 PM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Going back to my first response,

Quote:
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
and your more recent error message

Quote:
Cannot open root device "hda" or unknown block (0,0)
have you tried changing 'root (hd0,0)' to 'root (hd1,0)' to make it agree with 'root=/dev/hdb1' to see what effect that has on bootup?
 
Old 01-04-2007, 04:08 PM   #8
shahgols
Member
 
Registered: Dec 2006
Posts: 97

Original Poster
Rep: Reputation: 15
Good idea, I'll change the cables around and see what happens. But it will have to be later tonight or tomorrow, got to study now.

I tried changing to root=(hd1,0) and it tells me that there is no disk drive.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB LILO Boot loader fails mefrmdelhi Debian 1 09-21-2006 02:32 PM
boot fails when grub installed on MBR cheema Debian 4 01-05-2006 11:39 AM
Grub - dual boot fails on sdb mhoma Linux - General 0 06-13-2005 12:08 PM
Grub fails to boot when not at beginning of hard drive tisource Linux - Hardware 12 01-05-2005 12:13 PM
GRUB dual boot with two diff kernels fails at boot mosquito_dk Linux - Software 3 09-06-2004 10:18 AM


All times are GMT -5. The time now is 07:14 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration