LinuxQuestions.org
Help answer threads with 0 replies.
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 05-10-2020, 05:56 PM   #1
anfieldsierra
LQ Newbie
 
Registered: May 2020
Posts: 2

Rep: Reputation: Disabled
Configuring lilo for dual boot


I'm trying to configure lilo to support a dual-boot Slackware system. It fails to correctly boot the other system when setup like this:

I have two different installations of Slackware:
1) /dev/sda1
2) /dev/sda4

Each partition has its own unique root filesystem '/' containing a '/boot' directory


Here is the relevant bit of my /etc/lilo.conf
=============================================================
# Linux bootable partition config ends
image = /boot/vmlinuz
root = /dev/sda4
label = Current
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/sda1
label = Slackware
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
=============================================================



When I run "lilo -v" it seems to install the same initrd and vmlinuz for both systems. I get the following output:
=================================================
...
Calling map_insert_file

Boot image: /boot/vmlinuz -> vmlinuz-huge-4.4.208
Added Current *

Boot image: /boot/vmlinuz -> vmlinuz-huge-4.4.208
Added Slackware

Writing boot sector.
...
=================================================

This indicates to me that lilo is picking up the same kernel/initrd from the mounted boot partition.

How do I tell lilo to pick the kernel/initrd from the associated sda1/sda4 partitions ?
 
Old 05-11-2020, 11:05 PM   #2
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
You mention an initrd but do not specify the initrd in the as-posted lilo.conf. Are you sure you re using an initrd?

You are using /boot for both entries in your lilo.conf. That's your problem.

What is /boot? What does each of your two Slackware installs see as /boot? Whichever one you run lilo from sees /boot depending on how it is mounted.

You're going to have to pick one Slackware to run lilo on, and never run it on the other. On the Slackware you are running the lilo, you will need to indicate the boot partition on the OTHER slackware to include it, and it will need to be mounted.

So, let's say you decide to run lilo while in the slackware on sda1. Add a mount point and a corresponding fstab so that sda1 slackware can see and access sda4. Let's say you call it "/other_slackware" and then add a line in your fstab to mount /dev/sda4 as /other_slackware, OK?

The modified entry in lilo for the sda4 slackware would be something like this:
Code:
# Linux bootable partition config begins
image = /other_slackware/boot/vmlinuz
root = /dev/sda4
label = Current
read-only # Partitions should be mounted read-only for checking
initrd = /other_slackware/boot/whatever_you_called_your_initrd.img
# Linux bootable partition config ends
Don't blindly cut and paste that, as I do not know your system to the extent that you do.

Hopefully that helps you towards figuring things out.

Last edited by jr_bob_dobbs; 05-11-2020 at 11:09 PM.
 
1 members found this post helpful.
Old 05-11-2020, 11:17 PM   #3
anfieldsierra
LQ Newbie
 
Registered: May 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by jr_bob_dobbs View Post
...
You are using /boot for both entries in your lilo.conf. That's your problem.
...
You're going to have to pick one Slackware to run lilo on, and never run it on the other. On the Slackware you are running the lilo, you will need to indicate the boot partition on the OTHER slackware to include it, and it will need to be mounted.
Thanks for the help. Yeah, I misunderstood how lilo works. I've copied/renamed both kernels to the one "/boot" directory and updated lilo.conf accordingly. It's working as expected now.
 
Old 05-12-2020, 12:17 AM   #4
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
I prefer lilo for it's simple efficiency and relatively easy to understand configuration options, but I have been multi-booting for decades as I enjoy keeping up with different systems. For me given the differences in some distros (some don't even have lilo as an option) I must choose between copying those distros vmlinuz-foo, config-foo, and System.map-foo to my Main system's /boot versus installing a bootloader to the root partition of the other distros (only Main goes to MBR) and just using entries like

Code:
other = /dev/sda7
label = Current2
Both can work but I like/prefer redundancy so I always install bootloaders to each's root partition so thge most simple rescue disk can chainload or "hand off" the kernel loading bits for each. Hope this helps your choices.
 
2 members found this post helpful.
Old 05-12-2020, 12:29 AM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by anfieldsierra View Post
When I run "lilo -v" it seems to install the same initrd and vmlinuz for both systems.
Which partition is mounted AS / at that time?
Because /boot is the one in the current root partition, so
- you will have to mount the other partition somewhere
- in lilo.conf you have to change /boot for that partition to something like
/mount/dir/boot

Note that lilo (the application, not the boot loader) can see only files that are visible now, with the pathnames they have now.
So the lilo.conf on partition sda1 needs to have the /boot for sda4 changed and the other way 'round: the lilo.conf on sda4 needs a mount dir for the /boot on sda1

Another trick is having a separate /boot partition that is common to both, but then the vmlinuz and initrd files need different filenames, of course.
 
Old 05-12-2020, 08:18 AM   #6
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by ehartman View Post
Which partition is mounted AS / at that time?
Because /boot is the one in the current root partition
Yes, that's what I'd tried to explain but you said it better.

Quote:
Note that lilo (the application, not the boot loader) can see only files that are visible now, with the pathnames they have now.
Exactly! As before, better than I would have said.

Quote:
Another trick is having a separate /boot partition that is common to both, but then the vmlinuz and initrd files need different filenames, of course.
This is actually what I do. it seems complicated at first but ends up being easier.
 
Old 05-13-2020, 11:39 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Rather than maintaining a separate /boot partition, I keep the contents of /boot of other partitions in subdirectories in /boot in the partition that I use to maintain lilo.
So,
Code:
bash-5.0$ tree -d -L 1 /boot
/boot
├── grub
├── initrd-tree
├── sda5
└── sda7
and /etc/lilo.conf has entries
Code:
image = /boot/sda5/vmlinuz
...
image = /boot/sda7/vmlinuz
...
This avoids the need for renaming, but requires copying the contents of /boot when the kernel is upgraded in other partitions, followed by running lilo from the partition used to maintain lilo.
 
1 members found this post helpful.
  


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
[SOLVED] Edit lilo.conf, run /sbin/lilo, but lilo won't take changes lukameen Slackware 2 02-10-2012 12:10 PM
Dual boot Dual hdds, Download of ubuntu 10.1, no vista or dual boot jim d Linux - Newbie 4 11-25-2010 04:18 PM
Installing dual Boot 98/Linux - WONT 'LILO' Dual Boot !? L1nux3d Linux - Laptop and Netbook 15 02-11-2006 05:36 AM
configuring lilo with winxp dual boot gotmonkey Slackware 6 10-10-2004 06:46 AM
Lilo lost, Install disk failing to restore Lilo on dual boot? Dobie Linux - Newbie 2 05-05-2004 05:00 PM

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

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