LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2009, 10:27 PM   #1
alMubarmij
Member
 
Registered: Dec 2005
Posts: 140
Blog Entries: 1

Rep: Reputation: 16
How can I support other distros in LILO with its Kernel ?


How can I support other distros in LILO with its Kernel NOT by Slackware kernel installed by LILO ?

My Slackware in /dev/hda5 and other Linux is in /dev/hda2.

Is SmartBootManager a good solution ?
 
Old 02-08-2009, 10:39 PM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Mount the other partition first. Then edit "/etc/lilo.conf", adding a proper entry, and run lilo.
 
Old 02-09-2009, 12:55 AM   #3
alMubarmij
Member
 
Registered: Dec 2005
Posts: 140

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Ok, I'll do like this:
Code:
su -
mkdir /mnt/hda2
mount -t ext3 /dev/hda2 /mnt/hda2
mcedit /etc/lilo.conf
lilo
Then what ?
It will still use Slackware kernel at boot time.

And what is "proper entry" ?

Thank you.

Last edited by alMubarmij; 02-09-2009 at 12:59 AM.
 
Old 02-09-2009, 01:13 AM   #4
DavidHindman
Member
 
Registered: Dec 2008
Distribution: Slack 13 + JWM
Posts: 101

Rep: Reputation: 23
Quote:
Originally Posted by alMubarmij View Post
Ok, I'll do like this:
Code:
su -
mkdir /mnt/hda2
mount -t ext3 /dev/hda2 /mnt/hda2
mcedit /etc/lilo.conf
lilo
Then what ?
It will still use Slackware kernel at boot time.

And what is "proper entry" ?

Thank you.
Do
Code:
man lilo.conf
The man file for lilo.conf has an example of how to use lilo to boot OS2, DOS and Windows 98 as well as Linux.

The paragraph "Per-Image Section" describes how to boot a Linux kernel. You must supply a pathname to the kernel image. It doesn't have to be a Slackware kernel, it can be any kind of Linux kernel.
 
Old 02-09-2009, 01:24 AM   #5
DavidHindman
Member
 
Registered: Dec 2008
Distribution: Slack 13 + JWM
Posts: 101

Rep: Reputation: 23
Another thought. Each of your distros needs to have its kernel started with a different root partition (you know, the partition that contains the / directory for that distro). Look closely at the examples in the lilo.conf man page. One of them shows how to use the root= kernel boot option to start up kernels with different root partitions.
 
Old 02-09-2009, 01:32 AM   #6
alMubarmij
Member
 
Registered: Dec 2005
Posts: 140

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Thank you.

Can you guide me what I add exactly in lilo.conf for other distro ?
 
Old 02-09-2009, 01:32 AM   #7
james2b
Member
 
Registered: Feb 2007
Location: Washington state, USA
Distribution: Ubuntu Mate 18.04, Mint 19.1
Posts: 360

Rep: Reputation: 45
Smile

Try installing the grub boot loader, it works great either by direct or by chainload, other Linuxes and Windows. I have one main grub installed on the master boot record, and other Linux have grub installed on their boot sector of their root partitions, which then allows chainload booting to the other grubs. Then just edit your grub menu.lst file to add or to update other Linux installed, (or the grub.conf file in Fedora) And here is the main site link: http://www.gnu.org/software/grub/grub.en.html
 
Old 02-09-2009, 01:35 AM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by alMubarmij View Post
Ok, I'll do like this:
...It will still use Slackware kernel at boot time.
And what is "proper entry" ?
As DavidHindman pointed out, the lilo man page is the best reference for you.

But I'll try to fill in some blanks for you quickly here.

First, the reason for mounting the other partition is this: At boot time there is no concept of a filesystem and therefore no way to express the path to any kernel other than absolute location on the disk media (ie, head, cylinder, sector). Lilo 'calculates' this position and writes this to the boot record based on the path specified in lilo.conf. But to do that the partition on which the kernel is stored must be mounted when you run lilo to write the boot record.

So, using your own example, mount hda2 at /mnt/hda2, then add something like this to your lilo.conf:

Code:
image = /mnt/hda2/boot/vmlinuz
  root = /dev/hda2
  label = OtherLinux
Be sure 'vmlinuz' in the example is the actual filename of the kernel you want to run.

Then, when you run lilo it will be able to find the other kernel, figure out it's physical location on disk and write that to the boot sector with the label 'OtherLinux'.

Then when you boot and choose 'OtherLinux' it will load the other kernel which will (presumably) mount the filesystem at /dev/hda2 as it's root filesystem - ie, a running Linux system.
 
Old 02-09-2009, 12:45 PM   #9
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
Code:
image = /boot/vmlinuz
  root = /dev/hda5
  label = slackware.linux
  read-only  
other = /dev/hda2
  label = other.linux
 
Old 02-09-2009, 02:24 PM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

You would edit your Slackware '/etc/lilo.conf' to reflect your installs.

Code:
example stanzas for '/etc/lilo.conf';
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda5
  label = Slackware
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda2
  label = SomeOtherLinux
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
  label = WinXP
#  map-drive = 0x80
#   to = 0x81
#  map-drive = 0x81
#   to = 0x80
  table = /dev/sda
# Windows bootable partition config ends
After your save the '/etc/lilo.conf';

Code:
~#lilo -v -t -b /dev/your_device     #sda, hda this will only test 
~#lilo -v -b /dev/your_device        #this will write MBR to your_device
You should then be able to reboot an find your new lilo menu.
 
Old 02-09-2009, 02:46 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Sorry onebuck, that will not work...

Quote:
Originally Posted by onebuck View Post
Hi,
Code:
...
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda2
  label = SomeOtherLinux
...
...because he will end up booting the Slackware kernel using his other Linux's root filesystem - which is the very problem he is trying to solve.

He must first mount the other filesystem then provide the path to the target kernel through the mount point, that is, the path when lilo is run - not the expected boot time path as that cannot exist until after the kernel is running. That is the essence of what boot, ie 'bootstrap', means.
 
Old 02-09-2009, 02:49 PM   #12
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
You can set lilo to boot more than one distro/version each with its own kernel but you need to provide the correct path from the partition/file system on which your /etc/lilo.conf is which also the filesystem/partition from which you run the command lilo.


For example in the two stanzas below I am running lilo from slackware 12.2 on /dev/hda3 and lilo will look for the slackware-12.1 kernel where it is mounted from in 12.2, i.e. /mnt/hda1/boot/vmlinux and the root (directory) for 12.1 is located on /dev/hda1

image = /boot/vmlinuz
root = /dev/hda3
label = 12.2
read-only

image = /mnt/hda1/boot/vmlinuz
root = /dev/hda1
label = 12.1
read-only

Last edited by justwantin; 02-09-2009 at 03:09 PM.
 
Old 02-09-2009, 02:56 PM   #13
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Code:
image = /boot/vmlinuz-2.6.28.4
  initrd = /boot/initrd.gz
  append = "resume=/dev/sda4"
  root = /dev/sda1
  label = current
  read-only

image = /mnt/12.2/boot/vmlinuz-generic-smp-2.6.27.7-smp
  initrd = /mnt/12.2/boot/initrd.gz
  append = "resume=/dev/sda4"
  root = /dev/sda2
  label = stable
  read-only
Note that the "stable" entry is not the primary OS here, so you have to use the full path to its kernel, initrd, and so on.

Last edited by rworkman; 02-09-2009 at 02:58 PM.
 
Old 02-09-2009, 03:12 PM   #14
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
If your other linux's bootloader (grub or lilo) is in its root partition, and Slackware's lilo is in the MBR, just add this to Slackware's /etc/lilo.conf:

Code:
other = /dev/hda2
  label = other
Replace "other" with the distro name. Then run lilo as root.

Last edited by brianL; 02-09-2009 at 03:14 PM.
 
Old 02-09-2009, 03:29 PM   #15
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Here's my boot set-up for Slackware/FreeBSD

Code:
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda2
label = Linux
read-only
# Linux bootable partition config ends
# FreeBSD
other = /dev/hda3
table = /dev/hda
label = FreeBSD
 
  


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
do any distros still use LiLo? newbiesforever Linux - General 4 02-11-2008 02:39 AM
Boot 2 linux Distros ??? lilo goodeyesniper687 Slackware - Installation 1 10-16-2006 02:59 PM
distros that use Lilo otto k Linux - General 2 10-28-2005 12:24 AM
Lilo: kernel doesn't support initial ram disks. ecion Mandriva 22 07-22-2004 10:36 AM
Using LILO for Multiple Linux Distros bongski55 Linux - Newbie 14 10-10-2003 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:59 PM.

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