Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[LILO config] 2 different linux on the same laptop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Enkahel
n00b
n00b


Joined: 03 Sep 2004
Posts: 9

PostPosted: Sat Jan 08, 2005 4:08 pm    Post subject: [LILO config] 2 different linux on the same laptop Reply with quote

Hi guys,

Just a little question concerning LILO config :

I have a XB7 laptop with a MDK 10.1 on it.
I've just installed gentoo on it, using MDK to prepare disks, and so on (chrooting, etc..)

Now install is complete, and I would like to reconfig MDK Lilo in order to add an entry for gentoo.

Prob is that the MDK lilo config refuse to acknoledge the path of the gentoo kernel (quite logical, because of the chroot)

here is the config of lilo I tried :

default="linux"
boot=/dev/hda
map=/boot/map
keytable=/boot/fr-latin1.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw

image=/boot/vmlinuz
label="linux"
root=/dev/hda1
initrd=/boot/initrd.img
append="devfs=nomount acpi=on splash=silent"
vga=788
read-only

image=/boot/vmlinuz
label="linux-nonfb"
root=/dev/hda1
initrd=/boot/initrd.img
append="devfs=nomount acpi=on"
read-only

image=/boot/vmlinuz
label="failsafe"
root=/dev/hda1
initrd=/boot/initrd.img
append="failsafe acpi=on devfs=nomount"
read-only

image=/boot/kernel-2.6.7-gento-r11
label="gentoo"
root=/dev/hda3
read-only


I have MDK linux installed on HDA1, swap is common for the 2 distrib' (HDA5) and gentoo is installed on the HDA3 partition, other partitions are not important for this problem...

any idea of how I should config my lilo.conf on this case ?
Back to top
View user's profile Send private message
dee2
n00b
n00b


Joined: 08 Jan 2005
Posts: 71

PostPosted: Sat Jan 08, 2005 4:26 pm    Post subject: Reply with quote

mount hda3 somewhere ex. /mnt/gentoo
and in lilo.conf use
image=/mnt/gentoo/boot/kernel-2.6.7-gento-r11
Back to top
View user's profile Send private message
Enkahel
n00b
n00b


Joined: 03 Sep 2004
Posts: 9

PostPosted: Sat Jan 08, 2005 4:38 pm    Post subject: Reply with quote

That will certainly work for reconfig lilo under MDK, but wil there not be a problem when I will restart the computer ?

because at computer's start, gentoo will not be mounted, and /mnt/gentoo/boot will not be accessible, will it ?

(I prefer asking what is going to happen insteadof trying by my self and crash something I don"t want to...)

:)
Back to top
View user's profile Send private message
dee2
n00b
n00b


Joined: 08 Jan 2005
Posts: 71

PostPosted: Sat Jan 08, 2005 10:13 pm    Post subject: Reply with quote

It will work :-)
No the mount point will not be there when you boot gentoo and that's fine.
I've installed many different distributions but always kept the lilo configuration from only one of them, never had a problem with it.
Back to top
View user's profile Send private message
Enkahel
n00b
n00b


Joined: 03 Sep 2004
Posts: 9

PostPosted: Mon Jan 10, 2005 7:35 pm    Post subject: Reply with quote

Ok, It's working :)

cheers !

But now.... It's working, good... but may I ask why ?

Why does it working although the system file is not yet mounted ?
Back to top
View user's profile Send private message
dee2
n00b
n00b


Joined: 08 Jan 2005
Posts: 71

PostPosted: Wed Jan 12, 2005 5:27 pm    Post subject: Reply with quote

Glad it worked for you, sorry I can not explain to you why it works - magic is involved :-)
Maybe someone else will step in and explain, perhaps you will find something in the lilo manual or read "linux from scratch".
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Thu Jan 27, 2005 8:51 am    Post subject: Reply with quote

dee2 wrote:
Glad it worked for you, sorry I can not explain to you why it works - magic is involved :-)
Maybe someone else will step in and explain, perhaps you will find something in the lilo manual or read "linux from scratch".


In case someone is still interested, I think I have solved this puzzle by making a mistake. It is not magic, as dee2 supposed, but genius at work.

First, I followed dee2's advice about what to put in lilo.conf

second, I forgot to run lilo before rebooting to test it out

Third, booting the image failed, I remembered that I hadn't run lilo before rebooting, so I booted into my other gentoo install (don't ask why I have 2) and ran lilo

fourth, lilo failed, and I didn't understand why. Then I realized that I hadn't mounted the other install in this linux session. I mounted it, ran lilo, and everything worked, and a light came on. :idea:

fifth, I booted again, and ran "cat mtab" before and after I mounted the the other install:
before:
Code:
/dev/hda3 / reiserfs rw,noatime,notail 0 0
none /dev devfs rw 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hda4 /home ext3 rw,noatime 0 0
none /dev/shm tmpfs rw 0 0
none /proc/bus/usb usbfs rw 0 0

after:
Code:
/dev/hda3 / reiserfs rw,noatime,notail 0 0
none /dev devfs rw 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hda4 /home ext3 rw,noatime 0 0
none /dev/shm tmpfs rw 0 0
none /proc/bus/usb usbfs rw 0 0
/dev/hdb3 /mnt/gentoo reiserfs rw 0 0
/dev/hdb1 /mnt/gentoo/boot ext2 rw 0 0


Notice the additional mount points in the second cat of mtab.

My conclusion is that when lilo is executed, it scans mtab, and intelligently writes the appropriate information about mount points into the boot file. I could be wrong, but if I am, I'm pretty sure I'm close to the right answer.

This raises the question: how in the heck does grub manage this? It has to be something completely different because you don't need to execute grub after changing the config (at least that's how I understand it, I've never used grub)

thanks, dee2 for showing us how to accomplish this, and thank you enk for asking the question, so that I didn't have to.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Thu Jan 27, 2005 6:42 pm    Post subject: Reply with quote

Quote:
This raises the question: how in the heck does grub manage this? It has to be something completely different because you don't need to execute grub after changing the config (at least that's how I understand it, I've never used grub)

Actually, I am pretty much surprised by this method that has been suggested. :roll: I don't use lilo but I use grub. I have MDK10.0 and gentoo installed. And, using grub, I didnot have to resort to any such technique. My menu.lst looks like this:
Code:
timeout 5
#color black/cyan yellow/cyan
color white/black
default 0
splashimage=(hd0,7)/grub/splash.xpm.gz

title Gentoo Linux Kernel 2.6.9-r6
kernel (hd0,7)/kernel-2.6.9-gentoo-r6 root=/dev/hde9 hdg=none hdg=noprobe devfs=mount floppy=none floppy=noprobe
#initrd=/boot/initrd-gentoo

title Mandrake Linux 2.6.3-7mdk
kernel (hd0,7)/vmlinuz root=/dev/hde1 acpi=ht devfs=mount vga=788 hdg=none floppy=none floppy=noprobe
initrd (hd0,7)/initrd.img

title failsafe
kernel (hd0,0)/boot/vmlinuz root=/dev/hde1 failsafe splash=silent acpi=ht devfs=nomount hdg=none hdg=noprobe floppy=none floppy=noprobe
initrd (hd0,0)/boot/initrd.img

In fact, I have the same partition for /home for both MDK and gentoo. And I never had a problem with booting into gentoo or MDK. Of course, my /boot is in a different partition.
cat /etc/mtab:
Code:
/dev/hde9 / ext3 rw,noatime 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev ramfs rw 0 0
none /dev/pts devpts rw 0 0
none /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0
/dev/hde1 /mnt/Mandrake10.0 ext3 rw,noatime 0 0
/dev/hde8 /boot ext3 rw,noatime 0 0
/dev/hde6 /home ext3 rw 0 0
/dev/hde7 /mnt/stuff ext3 rw 0 0
none /proc/bus/usb usbfs rw 0 0
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Fri Jan 28, 2005 8:20 am    Post subject: Reply with quote

yet another mystery solved. you simply name the device rather than the mount point in grub. My god, that is way too logical! I bet that you can do the same thing in lilo.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Fri Jan 28, 2005 8:45 am    Post subject: Reply with quote

mlsfit138 wrote:
yet another mystery solved. you simply name the device rather than the mount point in grub. My god, that is way too logical! I bet that you can do the same thing in lilo.


I'm pretty sure you can't do it.

This has always been the main difference between lilo and grub. lilo uses the devices from /dev. grub gets it's device information, though, from the bios.

So lets say I have one SATA HD on my comp. So using a 2.4 kernel it would probably be called /dev/hde. But then if I recompile the kernel to use the newer drivers it would call it /dev/sda.

If I were using lilo to boot and make that change, I'd have to change the device it uses to boot off of (since /dev/hde will no longer exist). If I used grub, I wouldn't need to change anything because to the bios I still only have 1 disk.

edit:
And the reason you don't have to run anything related to grub after recompiling is because the grub executable (the one installed on the mbr or wherever you want) is set up so that it loads the config file (grub.conf or menu.lst) from the partition with the boot record.
Like with lilo, you use the config file to make the executable but with grub the executable uses the config file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum