SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 *
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.
...
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.
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.
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.
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,
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.