• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Gentoo install.. grub/lilo won't load?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JerMe

Member
Joined
Nov 22, 2003
Location
New York City
I followed Kaltag's tutorial on Gentoo stage 1. Using the x86 2005.0 stage 1 minimal CD, I got through the bootstrapping, emerge system and whatnot, but I can't get the bootloaders to load Gentoo 2005.0. I can get Lilo to load WinXP, but grub won't load either Gentoo or WinXP. Help!

System specs:
DFI LanParty NF2 Ultra-B, AXP-M 2500+ (lowered to 220x10 just in case), Mushkin BH5 512MB (2-2-2-11), AIW 9600 Pro (stock)
Hard drive: PATA WD 120GB using Serilel adapter (the PATA->SATA adapter that came with the Abit NF7-S... it connects to mobo with SATA line, works fine for WinXP)

My HD is partitioned like this (according to fdisk -l):
Code:
Disk /dev/sda: 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/sda1	*	1	2550	20482843+	7	HPFS/NTFS
/dev/sda2		2551	13341	86678707+	5	Extended
/dev/sda3	*	13342	14527	9526545		83	Linux
/dev/sda4		14528	14593	530145		82	Linux swap / Solaris
/dev/sda5		2551	13341	86678676	7	HPFS/NTFS

...so basically I have 1 primary for XP, another partition for NTFS files, a Linux root and a Linux swap.

/etc/fstab:
Code:
<fs>			<mountpoint>	<type>		<opts>		<dump/pass>
/dev/sda3		/		reiserfs	noatime,notail	1 1
/dev/sda4		none		swap		sw		0 0
/dev/cdroms/cdrom0	/mnt/cdrom	auto		noauto,user	0 0
none			/proc		proc		defaults	0 0
none			/dev/shm	tmpfs		defaults	0 0

Here are the errors:

GRUB:

Code:
grub loading, please wait...
Error 17

then it freezes. Here's my grub.conf:
Code:
default 0
timeout 30
splashimage=(hd0,2)/grub/splash.xmp.gz

title=Gentoo Linux 2.6.11-r6
root (hd0,2)
kernel /kernel-2.6.11-gentoo-r6 root=/dev/sda3

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

When I ran grub:
Code:
root (hd0,2)
setup (hd0)

no errors that I recognized. Exited, rebooted, took the CD out... then got the Error 17 message, and the system stops. According to the help on gentoo.org,

"This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB. Be sure to check your root(x,y) settings in your grub.conf. Also, if you are trying to boot Windows, make sure that your grub.conf file has the root (hdX,Y) (or rootnoverify (hdX,Y)) and chainloader (hdX,Y) +1 in it."

So fdisk could recognize /dev/sda3 as a type 83 ReiserFS partition, but Grub couldn't recognize it? *shrug*

So I gave up on grub and emerged lilo... here's my lilo.conf:

Code:
boot=/dev/sda
prompt
timeout=50
default=gentoo

image/boot/kernel-2.6.11-gentoo-r6
label=gentoo
read-only
root=/dev/sda3

other=/dev/sda1
label=windows


then ran /sbin/lilo, exited, rebooted. When I tried WinXP, lilo booted it fine. When I tried to pick Gentoo, I got this error at the end:
Code:
VFS: Cannot open root device "803" or unknown-block(8,3)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on uknown block (8,3)

I looked it up, and "803" corresponds to /dev/sda3... the bootloader couldn't read the partition again? :( At least I know lilo works, but I'm lost as to why it can't load Gentoo... I don't want to have to start from scratch again if I don't have to... any suggestions?
 
Last edited:
In the grub command line, I get this:

Code:
#root (hd0,2)
 Filesystem type is reiserfs, partition type 0x83)
#setup (hd0)
 Checking if "/boot/grub/stage1" exists.... yes
 Checking if "/boot/grub/stage2" exists.... yes
 Checking if "/boot/grub/reiserfs_stage_1_5" exists... yes
 Running "embed /boot/grub/reiserfs_stage1_5 (hd0)... 26 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+26 p (hd0,2)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

So grub in the commandline sees hd0,2 (/dev/sda3) as reiserfs, but when booting up the system grub doesn't recognize it? I'm so lost... I wish I could just take out the Serillel adapter and just use the IDE cables to make things simple, but if I do that, then I lose the WinXP installation...
 
Last edited:
I think you have to patch grub to be able to access reiserfs partitions (error 17 means that the partition exists, but the filesystem cannot be accessed by grub). You don't have a separate /boot?
 
Gnufsh said:
I think you have to patch grub to be able to access reiserfs partitions (error 17 means that the partition exists, but the filesystem cannot be accessed by grub). You don't have a separate /boot?

Kaltag's walkthrough didn't use a separate boot, so I didn't either? I tried to re-emerge grub just incase the emerge borked for some reason, but that didn't fix anything.

Grub identified reiserfs when I root (h0,2) in its commandline, so at least it can access the drive in that manner... *sigh*

Edit: Turned out to be a kernel problem. Everyone should bow down to Kaltag, he's the man! :) Thanks for helping out ;)
 
Last edited:
I think you have to compile controllers into the kernel itself, not use them as modules, as the modules aren't loaded until later.
 
You have to compile controllers which are needed to mount the root partition into the kernel usually. YOu have the least hassles this way. There is one big exception however: you can create an initrd or initial ramdisk. Pretty much all distro boot kernels do it. Also, if you have some controller which only has drivers as binary only modules, you also need to use initrd.
 
klingens said:
grub runs with reiser fine. Using it here.
Well, my information is about three years old, so nevermind.

If you're using gentoo, there's no reason to have to use an initrd for drivers, since you're already compiling your kernel, just compile whatever you need to boot into it.
 
Hmm, I actually just had another idea that would explain why lilo will load win but not linux and grub will load neither.

On a large hard drive, on some systems, you cannot boot anything past the 1024 cylinder boundary. If your boot partition is there, then you can't ever get to the boot partition. Lilo, on the other hand, is installed in the mbr (completely, it doesn't use config files), so it would be able to run and boot windows (which is below the boundary) but not linux (which is above).

If that is indeed the problem, what you need to do to fix it is use qtparted to make a small boot partition at the beginning of the disk (move up the first partition some). This might change your drive letters, fstab, etc. also.
 
This particular problem has been fixed in BIOSes around the P5 era. Definitely no SATA equipped PC ever had this problem
 
I wasn't aware of that Gnufsh, ok back to the drawing board!

Personally, I am still leaning toward the hypothesis that he doesn't have reiser support compiled into his kernel (NOT as a module).

My suggestion would be to create a small ext2 or ext3 partition and make that the boot partition, or get reiserfs compiled into the kernel.
 
Thanks for all the ideas guys but we got it working last night. SATA was enabled but not the specific controller. All is well now. You can stop racking your brains :D
 
Back