Gentoo Linux help

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
Ok, got the #$@% thing installed. I was getting compiler errors 2 out of three times trying to install the distribution so I finally downloaded a stage 3 build and installed it (the one compiled build I got I toasted when I learned if you install grub into the partition of an XFS disk it trashes the journal and the disk is gone). The problem I'm having is the STUPID boot loader. Now I'm not used to using grub, I'm more familiar with lilo but either way I'm having the same problem with both. Now first off, this is the first time I've ever tried to put the kernel outside the old 1024 cyl. limit.

My main disk is a X15 on an LSI logic card. I've disabled the IDE primary disk in the BIOS to prevent problems with system commander (my bios assigns the IDE disks first then scsi disks, i.e. in XP my X15 is Disk 2, my primary IDE is disk 0 and my IDE zip is disk 1). Ok as I just mentioned I use system commander to multiboot so I prefer the linux bootloader to be installed into the /boot partition. I've never had a problem with this in Redhat (of course RHAT does it for me).

My partitioning scheme right now is:

/dev/sda1 FAT (2gigs, freedos)
/dev/sda2 NTFS (28gigs)
/dev/sda3 /boot (ext2) (100megs)
/dev/sda4 [extended]
/dev/sda5 swap (1gig)
/dev/sda6 / (ext2) (about 4 gig)

Gentoo is installed fully with a kernel compiled. I have built the /boot/grub/menu.lst file per the gentoo instructions. After typing grub at the command prompt the first line complains that /dev/sda3 is not the first disk then trys 4 or 5 times to mount my IDE Zip. After getting in grub I run root (hd1,2) then setup (hd1,2) (see's them both as ext2). The partition is toggled as bootable. But I'm not getting bootable access to it (System commander is fairly simple, it dumps straight to the partition and tries to boot it, this has always worked for me). Lilo does the same bloody thing and I can't figure out what I'm doing wrong.

Suggestions? (I'm not a linux Newbie). I really dig this distribution, I've never tried the BSD's so I've never experienced the port's system and I really like it (although I think there are still some rough edges to the emerge program, for example it won't let me unmerge lilo). My most experience is with Redhat, been using it close to 4 years now so keep in mind the bias it would give to me doing stuff when you think about things I might be doing wrong.
 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
2 words: 'emerge lilo'

I have never really liked grub, always seemed too fragile to me. I have, however, always liked lilo.

Doesn't really answer your question, but, it is a viable solution. :)
 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
Note above, I've tried lilo. It's giving me the same stupid problem which leads me to believe I'm doing something wrong. (and I do know how to configure lilo for the most part)
 

LNXman

Senior member
Jul 27, 2000
404
0
0
Let's think a little bit at what you are trying to do.

If I understand correctly, you are trying to load up /boot as your bootable partition (i.e. your first disk -> /dev/sda3). Right?
Now, I assume that your compiled kernel is probably in the /boot partition. Even if it were in /boot, can you explain to me how is the kernel going to load up your system correctly if all the configuration files, modules, libs, and the system mount, live under /?
You mention RedHat used to do this, but I am sure RedHat did not make /boot a separate partition. Or am I missing some RedHat type magic I don't know about. . .

When you create a / partition, you HAVE to have /etc, /bin, /lib and /boot (if your kernel lives in /boot) directories exist in the partition. They CANNOT be separate partitions.

In your case you have to boot up your system with your / (/dev/sda6) where the /boot directory will live (I hope your kernel is already living in /boot). But get rid of the /boot (/dev/sda3) partition before you boot up, and from your fstab after you sucessfully boot up.

Also, make sure that / is the bootable partition.

GL
 

Tiger

Platinum Member
Oct 9, 1999
2,312
0
0
I agree with the emerge lilo.
Gentoo's written install destructions want a seperate "/boot" partition and if you follow them to the letter that's where the kernel image gets installed. The only problem is, as LNXman states, everything else is in "/".
 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
It doesn't matter what partition you install Lilo/grub into. The configuration file of lilo/grub both include a specification for your / partition. This includes the fstab that then tells it where to load the kernel from. Having /boot on a seperate partition is actually a recommended procedure, then you can mount it read-only and not have to worry about a system crash taking out your kernel. (Part of the Gentoo install mentions this very point.

My partitioning scheme is exactly as Gentoo recommended. Now, am I missing something and should I infact be installing grub into /dev/sda6 and toggling that partition as bootable? Keep in mind that /dev/sda6 is in the extended partition and I'm not sure you can even make and extended partition bootable.
 

manly

Lifer
Jan 25, 2000
13,076
3,835
136
Hmm, interesting problem. For starters, can you tell us exactly what errors you're seeing? You've explicitly mentioned neither GRUB nor LILO works, but I don't think you mentioned any exact errors you see. I'm curious as you whether it's a software (likely) or a hardware (config) problem.

Some thoughts:

First off, LILO got rid of the 1024-cylinder limit a long time ago so I seriously doubt that's the issue.

Secondly, my /boot filesystem and my / filesystem are on separate partitions. Knowing Linux (and UNIX), I don't believe there's any built-in dependency that /boot must be within the / filesystem. Maybe LNXman can point us to some documentation.

Third, I don't believe the bootable (aka active) flag on the partition is actually meaningful to LILO (as it is for Winblows). In fact, I just took a look at my partition table, and none of my Linux filesystems are marked bootable. Then again, my case is slightly non-standard because I'm currently using a boot floppy. :X

I just tried to flag an extended partition bootable, and fdisk allows it. But actually, I don't believe that where you put the LILO or GRUB stub boot loader is important. By convention, if it's not in the MBR, it's installed onto the partition containing the OS kernel (in this case /boot). However, as you pointed out, since the boot description fully specifies the kernel to boot and the root filesystem, I don't think it's significant where you stick the boot loader. MBR, any of the partitions or a floppy disk should all work.

In conclusion, the points I mentioned above can be summarized as LILO (or even GRUB) is pretty flexible and doesn't impose the same limitations as users are accustomed to with MS operating systems. So hopefully you can eliminate some suspected problems from your debugging.

Btw, I'm surprised XFS has that kind of limitation. Why are you going back to ext2 rather than trying ext3?
 

LNXman

Senior member
Jul 27, 2000
404
0
0
Ah!
So the problem is a bit more clear. So the /boot partition contains boot images, then that is a different matter. Initially, it seemed to me that all booting components were on /boot (I never assumed images since I am not familiar with how RedHat, or the Gentoo, distros boot up). Since now we are talking about booting with images, then this particular problems should be easier to deal with:
What matters is where your booting image resides. If your booting image resides under the /boot partition (/dev/sda3), then that partition should be the first "disk" that gets loaded by Grup/Lilo since that image mostlikely has all the necessary booting components within it (such as the kernel, system configuration, necessary libs and apps to setup, etc).

WRT the booting flag, it only works if you would like to go straight into LINUX, just like a Windows 9X does.

Mostlikely, the boot loader installer complains because it is looking for an image it cannot find under /dev/sda3. Just like Lilo would complain if an image you defined to bootup would not be found where you told it , it would be. Check your contents under /dev/sda3, make sure everything you need exists, and, like others have mentioned run your emerge command.
Another possibility could be that you installed the some of the required componets under the /boot mount point of /dev/sda6, and others under the /boot partition (/dev/sda3).

Just a thought.

GL



 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0


<< For starters, can you tell us exactly what errors you're seeing? >>



The only thing that even remotely resembles an error is that when I run lilo or grub both of them specifically say /dev/sda3 is not the first disk. Otherwise everything appears to go normally, well except when I try to boot. :(



<< Third, I don't believe the bootable (aka active) flag on the partition is actually meaningful to LILO (as it is for Winblows). >>



It's not really, but system commander needs it unfortunately. This version is fairly old but it works for my needs and if I can just get lilo to install the way redhat would make it install then I wouldn't be having this problem.



<< Btw, I'm surprised XFS has that kind of limitation. >>



I was too, believe me.



<< Why are you going back to ext2 rather than trying ext3? >>



I can ext3 it later, major advantage of ext3 is that the journal is transparent and can be created after the fact. At least how I understand it. This is just an expermental build. My production linux system is my server.

I think I need to post my lilo.conf file and the output from running lilo. Give me the command to echo output from running lilo to a text file and I'll do it. :) (I've never figured out the way to echo to a file in linux :eek: ).
 

manly

Lifer
Jan 25, 2000
13,076
3,835
136


<< The only thing that even remotely resembles an error is that when I run lilo or grub both of them specifically say /dev/sda3 is not the first disk. Otherwise everything appears to go normally, well except when I try to boot. :( >>


Hmm, sounds odd that both LILO and GRUB (two unrelated tools) report the same error message. Unfortunately, I don't know what the problem is, but I get the feeling it's something to do w/ the way you have SCSI and IDE configured.


<< I think I need to post my lilo.conf file and the output from running lilo. Give me the command to echo output from running lilo to a text file and I'll do it. :) (I've never figured out the way to echo to a file in linux :eek: ). >>


Heh, I know what you mean about laziness. :eek: I think you're right that the /etc/lilo.conf file could be helpful.

# /sbin/lilo > ~/lilo.log

The > symbol is the shell redirection operator. It just takes the standard output of the first command and saves it into the second file (I suggested ~/lilo.log). Just be sure not to specify an existing filename because it'll get wiped. Shell I/O redirection is actually more complicated/flexible, but this is the base case that's easy to use and remember.

No offense, but I don't know what LNXman is talking about in his last reply.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
The way Gentoo seems to work, is that it uses an image, (or ramdisk image) of a root filesystem to boot up as well as the kernel image. This is a convenient way to boot up in ram, which makes booting and setup faster, and may avoid kernel corruption in the event your machine may be turned off without a proper shutdown. I believe Mandrake uses this type of booting as well.
I assume the root fs image exists in the /boot partition /dev/sda3. But, I did not catch where the boot image (kernel) was. If Gentoo uses the same format at Mandrake, then mostlikely the kernel image exists under the /boot partition as well. Since, by process of elimination from your posts, it sounds that way.
Now, if one of them does not exist in the /boot partition, or neither of them exists, after you setup Grub/Lilo, and attempt to install it, then the Grub/Lilo installation will complain, and not install.
I am not familiar with Gentoo's way of installing either one, but if you can, try running /sbin/lilo -t -v -v -v (no it is not a typo) in CLI so that you can see exaclty what/where in the config file Lilo is complaining about in standard output. Maybe you can get a clearer picture of what the problem is.

To clarify . . .
Initially it sounded as if you had the kernel (vmlinuz) in your /dev/sda6, since it is /, and your root fs image under the /boot partition (/dev/sda3) which I understood was the partition you were trying to tell Grup/Lilo to boot ( without the kernel ). That did not make sense to me, that is why I mentioned my "assumptions" hoping that I could get a clearer picture of the problem.

I did not think I would lose someone with what I was suggesting . . . maybe I should be more descriptive, and not skip corners.

Anyways, as I mentioned on my last post, make sure the images you use to boot with Grup/Lilo exist where you say they exist (kernel + root fs). In other words, check the contents of /dev/sda3. That is all.

GL

/edit: fixed typo

 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
LNXman, I don't know if we are even talking the same language. Mandrake AFAIK doesnt' use anything other than a standard kernel, there is an "image" like you are refering to that is used during installation because no file system exists but not after the system is installed. See unless mandrake has changed drastically in the last year it's still a stock redhat system that's customized by mandrake.



<< Initially it sounded as if you had the kernel (vmlinuz) in your /dev/sda6, since it is /, and your root fs image under the /boot partition (/dev/sda3) which I understood was the partition you were trying to tell Grup/Lilo to boot ( without the kernel ). That did not make sense to me, that is why I mentioned my "assumptions" hoping that I could get a clearer picture of the problem. >>



Just like any linux system I have a kernel (it's not called vmlinuz, frankly what it is called doesn't matter, you could call it foo, in fact lets pretend it's called foo). My Kernel that I compilied and copied from /usr/src/linux/arch/i386/boot is in /boot. /boot is my /dev/sda3 partition. Frankly it doesn't really matter where the kernel is in relationship to the boot loader as long as you tell the boot loader where the kernel is. In the lilo configuration file you specify the location of the kernel, in my case it's /dev/sda3. Also in the lilo configuration file you specify where the root partition is, /dev/sda6 in my case.

In either case I need to paste the lilo.conf and lilo output so people can really see what's going on and point out where I picked up the crack pipe and puffed away. I'm confident this is NOT a hardware issue. I haven't had any problems with a former redhat install that I blew away to do the gentoo install.
 

LNXman

Senior member
Jul 27, 2000
404
0
0


<< Mandrake AFAIK doesnt' use anything other than a standard kernel, there is an "image" like you are refering to that is used during installation because no file system exists but not after the system is installed. See unless mandrake has changed drastically in the last year it's still a stock redhat system that's customized by mandrake. >>



Mandrake has changed (at least I saw it in 8.1). It uses the standard vmlinuz-<whatever_postfix> and a root fs ram image to boot the O.S. after installation. I've never use it, and don't particularly like this type of booting ( unless it is used by some sort of media to restore the O.S. in the hard drive).

In any case, as you mentioned, it would be best if you post your lilo.conf file and the error output from lilo that way we can get a clearer picture of what is going on, and speak the same language.

GL
 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
Lilo.log >

'Warning: /dev/sda3 is not on the first disk
Added Linux *"

lilo.conf>

boot=/dev/sda3
prompt
timeout=40
default=linux
vga=normal
read-only
lba32
install=/boot/boot-text.b

image=/boot/bzImage
label=Linux
read-only
root=/dev/sda6
 

LNXman

Senior member
Jul 27, 2000
404
0
0
I just realized something, so forget if you read my last post before I changed it. . .

Since your machine is juggling IDE & SCSI, you may have to remove the IDE device from the motherboard, reboot with the installation CD, and rerun lilo, halt, then re-intall the IDE device, and finally reboot. It sucks, but that is the only way I have found to fix this problem until a new version of LILO can handle this juggling better.

Sorry if I confused you earlier. . .

GL
/edit: rewrote post. . .
 

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
don't know if it helps but here is what I did, I was having similar headaches with scsi drives and gentoo.

I think someone said in the gentoo forums that in grub root really means boot so I put

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=midas gentoo
root (hd0,0) point to /boot partition
kernel /boot/bzImage root=/dev/sda5 point to / partition

Also from what has been said I noticed I seem to have 2 /boot directorys, my /boot on it's own partiton is not mounted at start up and I end up looking at my /boot in / and wondering why it's so empty
rolleye.gif
 

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
I agee w/ LNXman, that's exactly what I did, i just disconected my ide drives booted with grub, made sure everythign worked, shutdown, reconnect power to ide drives and rebooted.

grub is weird:disgust: