LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2005, 04:05 PM   #1
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
dual boot two linux distros on one hd with lilo


I have debian installed and yesterday I installed slackware 10.1. I use lilo via the MBR. Both the /boot partitions with the kernel images are on the distro's root partition. The problem is now that I for either distro I get the kernel from the distro with which I last run lilo. I solved this now by simply copying the sources and use the same kernel but that's not an option for the long run as I'll probably use slackware to test things out while keeping my debian as stable work environment.

Example slackware 2.4 kernel debian 2.6. I run lilo in debian and get the 2.6 kernel in slack. When I run lilo in slack I get the 2.4 kernel in debian. This is my lilo.conf file:
Quote:
image=/boot/vmlinuz-2.6.8.1
root=/dev/hdb1
label=Debian
read-only
# restricted
# alias=1

image=/boot/vmlinuz
root=/dev/hdb7
label=Slackware
read-only
# restricted
# alias=2

other=/dev/hda1
label=Winblows
# read-only
# restricted
# alias=3
Now I look at it I think it's kind of logical that it behaves the way it does now But what would be a good fix? Create a new partition for /boot?
 
Old 02-23-2005, 07:08 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I haven't played much with LILO, but I can tell you that grub would handle this quite easily, through a text file edit (menu.lst) to set up the dual boot.
 
Old 02-24-2005, 04:06 AM   #3
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Lilo uses a simple text file as well. And I'd like to keep it.
 
Old 02-24-2005, 04:14 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Why do you reckon you have to re-run the lilo command every time you update your kernel (normally situation I mean) ???.

Grub doesn't have this requirement.

Cut your cloth, wear the consequences.
 
Old 02-24-2005, 04:53 AM   #5
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Quote:
Originally posted by syg00
Why do you reckon you have to re-run the lilo command every time you update your kernel (normally situation I mean) ???.
Cause it will have the wrong image in the lilo.conf file otherwise. IIRC "make install" runs lilo itself but that either didn't copy the image to the place I want or it didn't set the right one in lilo so I have to manually do that.

I looked at a grub menu.lst file. So if I say (don't have the proper syntax) root device is hdbx it will get the /boot folder on that root device? Do I never have to rerun grub as in lilo?
 
Old 02-24-2005, 05:17 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Simplest solution in my opinion is to run lilo only in one distribution. I have a similar setup (with two versions of RedHat) and only run lilo in RH8.
If I need a new lilo configuration (never do, but OK), I load RH8, update lilo.conf in RH8 and next run lilo in RH8. RH8 is, BTW, the default OS, which makes it simpler to remember.

So if you need a second kernel for slack (newer version) for testing, build it in slack, boot into debian and modify the lilo.conf for an additional slack entry with the new kernel and activate it in Debian by running lilo..

RH8.0>> 2.4.18-14
RH7.3>> 2.4.18-3
 
Old 02-24-2005, 05:24 AM   #7
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Do you have a seperate /boot partition or not? Are those distros on the same hard disk? If you don't have a seperate partition for /boot and both distros on the same hard disk could you post that part of your lilo.conf file?

Well the problem is that it won't do that solution. Basically the lilo configuration I posted above should do that but I get the debian kernel. The kernel is there in /dev/hdb7 /boot folder but I simply get my debian kernel like this. How do I edit it so that it'll work or does grub work completely different and doesn't have this problem.

Thanks for the help!
 
Old 02-24-2005, 05:57 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally posted by darkleaf
I looked at a grub menu.lst file. So if I say (don't have the proper syntax) root device is hdbx it will get the /boot folder on that root device? Do I never have to rerun grub as in lilo?
The root(hdx,y) specifies the location of /boot mountpoint - generally the location of the kernel, and grub stage files. The latter will be (hdx,y)/grub/*.* - which resolves in Linux terms to /boot/grub/*.*

I seem to be making this harder than it is.
The upshot is that you *NEVER* have to rerun grub unless you need to re-install it.
Was the major reason I dropped lilo years ago - I was using NT4 ntldr, and got sick of continually copying the lilo boot sector record over to NT after running a lilo command. Well actually I used to keep forgetting, and the Linux boot would fail - THEN I'd remember.

In your case, compile the kernels and copy to /boot as a unique name - create an entry in /boot/grub/menu.lst (generally symlink'd to grub.conf), and away you go. My current conf has 6 Gentoo entries in it - I can pick any one at any time.
 
Old 02-24-2005, 06:41 AM   #9
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Do I have to keep all the kernel images in one folder /boot (as in making a new partition for that) if I do that with 2 distros (I understand how it works with one distro at one hd but with more kernels) or isn't that necesarry and can I keep the slackware kernel on the slackware partition and the debian kernel on the debian partition?
 
Old 02-24-2005, 10:13 AM   #10
mdg
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 626

Rep: Reputation: 38
You shouldn't be running two LILO's. Choose either Slack or Debian to be your "master" distro and have the active LILO there. It's easiest to use the original LILO, the one that was there first.

Let's say you have Debian as the "master". Using Debian, make a directory "slackware" under /mnt and then make an entry in Debian /etc/fstab for the Slack partition with "/dev/hdb7" and "/mnt/slackware" in it, along with the other usual stuff for fstab entries.

Still in Debian, edit the slack section of lilo.conf:
Code:
image=/mnt/slackware/boot/vmlinuz
root=/dev/hdb7
label=Slackware
read-only
Mount the Slack partition manually and then run "lilo" as root (otherwise you'll get an error for the Slack partition)

Then disable (rename) the Slack lilo.conf so you'll only have the one (Debian) active lilo.conf. You can add as many distro's as you want like this, just skip the "install bootloader" step for each distro and edit your Debian lilo.conf accordingly
 
Old 02-24-2005, 10:29 AM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Each distro has it's own root partition (which contains the /boot for the distro). Further each distro has a separate /usr partition.
The /home is shared between the two distros.

My lilo.conf:
Code:
prompt
timeout=150
default=linux_8_0
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32
lock

image=/boot/vmlinuz-2.4.18-14
	label=linux_8_0
	initrd=/boot/initrd-2.4.18-14.img
	read-only
	append="hdc=ide-scsi root=LABEL=/1"

image=/boot/vmlinuz-2.4.18-3bigmem
	label=linux_7_3
	initrd=/boot/initrd-2.4.18-3bigmem.img
	read-only
	root=/dev/hdb1
	append="hdc=ide-scsi"

other=/dev/hda1
	optional
	label=W2K

Last edited by Wim Sturkenboom; 02-24-2005 at 10:31 AM.
 
Old 02-24-2005, 10:52 AM   #12
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Thanks for all the help! Got it working now!
 
  


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
boot 2 linux distros with grub/lilo blas Linux - General 4 11-18-2005 10:22 PM
Mepis-friendly linux distros for dual-boot dealerman MEPIS 12 07-13-2005 09:27 PM
Dual Boot <Two Linux Distros, no Windows> truthfatal Linux - Newbie 3 03-29-2005 09:20 AM
dual boot for multiple linux distros pirozzi Linux - General 5 01-29-2005 08:15 AM
lilo dual boot two linux distros / hda and hdb rioguia Linux - Newbie 2 01-23-2003 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:16 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
Open Source Consulting | Domain Registration