LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-21-2014, 03:26 PM   #1
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Rep: Reputation: Disabled
Want to Add Second Distribution to LILO


I am using Slackware 14.1 64-bit with the KDE desktop environment. LILO is installed in the MBR and root is in sda1.

Just for fun I decided to install another distro in sda5. I skipped the part when the distro wanted to install its own bootloader since I already have LILO in the MBR.

When I boot up, LILO only shows the entry for Slackware. I thought that the "lilo" command would find the second distro and add it to the LILO bootloader menu, but that is not so. So, how do I add the second distro to the LILO bootloader menu?

I'm not really interested in using another bootloader such as GRUB, GAG, etc. I am sure that with your help I can solve this issue within LILO.

Last edited by tb75252; 02-21-2014 at 04:33 PM.
 
Old 02-21-2014, 04:40 PM   #2
rkfb
Member
 
Registered: Oct 2003
Location: Guildford, England
Distribution: Slackware64 -current running i3
Posts: 503

Rep: Reputation: 174Reputation: 174
You could open /etc/lilo.conf and copy/paste the bit below

#Linux bootable partition config begins

that boots your existing copy of slackware so you have two the same. Then edit the second one so it matches your second distro, eg change the root partition to point to the relevant partition and then give it a label. Don't forget to run

# lilo

once you're done.
 
Old 02-21-2014, 06:51 PM   #3
croxen
Member
 
Registered: May 2002
Posts: 100

Rep: Reputation: 42
From a root terminal run "liloconfig". Choose the "expert" option and then add the new partition to the Lilo configuration.
 
Old 02-22-2014, 03:36 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121Reputation: 2121
Lilo should also detect all operating systems installed and generate the correct entries though.

In actuality Grub is a better choice if you edit /boot/grub/grub.cfg for the Slackware entries and remove the version specific labels and edit the paths only to the symlinks. After that you can update the kernel packages when they come out and you'll never need to reconfigure.

Plus OS-prober will auto detect any OS installed.
 
Old 02-23-2014, 05:33 AM   #5
michaelslack
Member
 
Registered: Feb 2013
Location: Sydney
Distribution: slackware
Posts: 110

Rep: Reputation: 36
My understanding is this: lilo can load another OS in one of two ways

1. if it is Linux, it can load it directly as it does with slackware
2. if it is any other OS on a partition which is bootable and has a bootloader installed to its boot-block, lilo can ``chain-load'', i.e. pass control to the other OS's own bootloader

For 1. to work, as well as supplying the root partition, you need to know at least

a. the path of the linux image that needs to be loaded and
b. if it needs an initrd and if so, its path.

This may or may not be easy to find out/guess.

Nothing further is required for 2. however and this is how I handle such things when a. and b. above are not clear.

For example, I installed doudoulinux (a kids distro based on debian) on an old machine which already had slackware on it. I wanted to keep the original slackware lilo as the controlling bootloader (so e.g. I'm always greeted by the slackware-lilo boot screen!). So during the doudoulinux install (the debian graphical installer) when it came to installing grub (as debian does) there were three choices:

1. install to /dev/sda (the MBR of the disk) -- this would have obliterated by old lilo which I didn't want to do

2. install to /dev/sda3 (the root partition of doudoulinx). This, along with marking the partition as bootable, meant I
could chain-load from my slackware lilo to the doudoulinux grub. Then all I had to do was edit slackware's /etc/lilo.config
and add the lines

Code:
other=/dev/sda3
 label=doudoulinux
and then run lilo again. This is what I did and to me was the most hassle-free -- but it might violate tb75252's desire for a lilo-only solution

3. do nothing -- I could have done this and followed rkfb's abvice above, but I would have to work out the path of the
linux kernel image (and initrd if necessary) to load. In that case I would have had to

i. mounted the other OS's root partition from inside slackware and
ii. gone to /boot there where the only linux image was vmlinuz-2.6.32-5-686 and there was also initrd-img-2.6.32-5-686.

Then I would have needed to add

Code:
image = /boot/vmlinuz-2.6.32-5-686
 root = /dev/sda3
 initrd = /boot/initrd-img-2.6.32-5-686
 label= doudoulinux
 read-only
to /etc/lilo.conf, and then run lilo again. Now I didn't follow option 3., I might have something wrong there but in my example I would have been lucky since there was only one linux image and one initrd. To be sure I would have let it still install grub and then peeked in the config file to see how it booted, and then replicated this config in my slackware's /etc/lilo.conf.

So it might be worth it to let it *temporarily* install grub/whatever (preferably in the boot-block of the other OS's partition) just to see the config details, then go back and use lilo for everything once you've got that sorted out.

Hope this helps,

Michael

PS I don't know how smart lilo is at ``finding'' other OS's e.g. when running liloconfig. I know it
can find it if you follow 2. above i.e. if another partition is already bootable. This is what usually happens with Windows I guess.

Last edited by michaelslack; 02-23-2014 at 05:43 PM.
 
Old 02-25-2014, 11:37 AM   #6
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: Disabled
I was able to solve my problem. Here is what I did and I hope it will help some other newbie like me in the future.

First of all /dev/sda5 (where I have installed the root directory for my second distribution, i.e. Slackware 32-bit) needs to be mounted in Slackware 64-bit:
Code:
mkdir /mnt/slack32
mount /dev/sda5 /mnt/slack32
Now, the path to my Slackware 32-bit kernel should be /mnt/slack32/boot/vmlinuz, so I put that in the /etc/lilo.conf file of Slackware 64-bit and then ran:
Code:
/sbin/lilo
After LILO was successfully installed, I unmounted /dev/sda5 and removed the /mnt/slack32 directory:
Code:
umount /dev/sda5 /mnt/slack32
rm -r /mnt/slack32
 
1 members found this post helpful.
Old 02-25-2014, 08:47 PM   #7
michaelslack
Member
 
Registered: Feb 2013
Location: Sydney
Distribution: slackware
Posts: 110

Rep: Reputation: 36
Hi tb75252,

I don't quite understand what you've done there. Does it work? Do you get a second option (corresp. to your 32-bit slackware) on your initial lilo splash screen? Does it successfully boot? Do both installations boot ok?

If so, could you please post your full /etc/lilo.conf so I can see what else you've got in there?

Thanks,

Michael

PS similar issues were discussed in another recent thread and brianL there suggested the same as my option 2 suggestion.
 
Old 02-25-2014, 09:17 PM   #8
tb75252
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelslack View Post
Hi tb75252,

I don't quite understand what you've done there. Does it work? Do you get a second option (corresp. to your 32-bit slackware) on your initial lilo splash screen? Does it successfully boot? Do both installations boot ok?

If so, could you please post your full /etc/lilo.conf so I can see what else you've got in there?

Thanks,

Michael

PS similar issues were discussed in another recent thread and brianL there suggested the same as my option 2 suggestion.
Hi Michael.
Yes, everything boots just fine.

Here is a copy of my /etc/lilo.conf as you requested. Of course you will have to modify the /dev/sda5 part according to your set up. Don't forget to run /sbin/lilo when you are finished with modifying the file.
Quote:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# Append any additional kernel parameters:
append=" vt.default_utf8=0"
boot = /dev/sda

#compact # faster, but won't work on all systems.

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
#vga=791
# VESA framebuffer console @ 1024x768x32k
#vga=790
# VESA framebuffer console @ 1024x768x256
#vga=773
# VESA framebuffer console @ 800x600x64k
#vga=788
# VESA framebuffer console @ 800x600x32k
#vga=784
# VESA framebuffer console @ 640x480x256
#vga=769
# End LILO global section
# Linux bootable partition config begins

image = /boot/vmlinuz
root = /dev/sda1
label = Slackware64
read-only

image = /mnt/slack32/boot/vmlinuz
root = /dev/sda5
label = Slackware32
read-only

# Linux bootable partition config ends
 
Old 02-25-2014, 09:45 PM   #9
michaelslack
Member
 
Registered: Feb 2013
Location: Sydney
Distribution: slackware
Posts: 110

Rep: Reputation: 36
Thanks for that. Your approach has pointed out something I didn't realise about how lilo works.

After reading your previous post I thought ``if /mnt/slack32 doesn't exist at boot time, how does it find the right kernel?''. However it's almost as if running lilo actually *copies* the kernel file pointed to in lilo.conf to the MBR. So whether the kernel exists at that path at boot time or not doesn't matter, so long as it exists when lilo is run.
I guess it doesn't actually copy it but perhaps puts a robust pointer of some kind.

Interesting.

Thanks again,

Michael
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot install lilo from distribution DVD vovim Slackware - Installation 3 11-27-2011 08:45 AM
Add Kalyway 10.5.2 to LILO? Innervision Slackware 1 06-04-2009 07:05 PM
Trying to add Debian to lilo grimx Slackware 9 11-22-2008 01:03 AM
Customizing a distribution to add my artwork and design for a brand new distribution caa718 Linux From Scratch 3 03-19-2006 05:03 PM
configuring lilo for an additional distribution? Vincent Slackware 3 02-26-2004 02:13 PM

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

All times are GMT -5. The time now is 12:57 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