Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dual booting with LILO

170 views
Skip to first unread message

Clark Smith

unread,
Dec 28, 2013, 1:23:04 PM12/28/13
to
I have a box with Slackware 13.0 installed in /dev/sda2. I added
a second drive, /dev/sdb2, in which I installed Slackware 14.1. The box
now boots 14.1, and I have access to the /dev/sda partitions simply by
mounting them by means of appropriate entries in /etc/fstab in the 14.1
disk.

What I would like to do now is to be able to select, at startup
time, whether to boot 13.0 or 14.1. My current lilo.conf contains the
following relevant lines:

boot = /dev/sdb
bitmap = /boot/slack.bmp

image = /boot/vmlinuz
root = /dev/sdb2
label = Linux
read-only

I know how to boot different kernels, when they all live in the same
drive; it's just a matter of adding new 'image' blocks. But I don't know
how to do it when the alternative kernel lives on a separate disk.

Any ideas? I guess I could copy the 13.0 kernel from /dev/sda2
to /boot in /dev/sdb2 and then add a relevant 'image' block to /etc/
lilo.conf in /dev/sdb2. However, one thing I am not sure about is whether
the entries in /etc/fstab for 13.0 (i.e. in /dev/sda2) can remain
untouched. I am also worried about any other potential gotchas when
messing with LILO - I know only too well what it is like locking myself
out of a system by doing the wrong thing with LILO.

Any suggestions will be much appreciated.

Henrik Carlqvist

unread,
Dec 28, 2013, 1:54:18 PM12/28/13
to
On Sat, 28 Dec 2013 18:23:04 +0000, Clark Smith wrote:
> I have a box with Slackware 13.0 installed in /dev/sda2. I added a
> second drive, /dev/sdb2, in which I installed Slackware 14.1. The box
> now boots 14.1, and I have access to the /dev/sda partitions simply by
> mounting them by means of appropriate entries in /etc/fstab in the 14.1
> disk.

Did you add any such entries to fstab? If so, what do the entries look
like?

> What I would like to do now is to be able to select, at startup
> time, whether to boot 13.0 or 14.1. My current lilo.conf contains the
> following relevant lines:
>
> boot = /dev/sdb
> bitmap = /boot/slack.bmp
>
> image = /boot/vmlinuz
> root = /dev/sdb2
> label = Linux
> read-only

This is a little interesting as it seems as if your motherboard prefers
to boot from the MBR of /dev/sdb instead of /dev/sda. Did you on purpose
alter some setting in your CMOS setup for this?

> I know how to boot different kernels, when they all live in the same
> drive; it's just a matter of adding new 'image' blocks. But I don't know
> how to do it when the alternative kernel lives on a separate disk.

Before running lilo you must mount all partitions containing kernels
pointed to by image-lines in lilo.conf.

> Any ideas?

Another idea would be to make your lilo installations to chain load to
each other. That way the different Linux installations does not need to
know anything about each others kernel files. You could add a lines like
this to lilo.conf in your Slackware 14.1 installation on /dev/sdb2:

other=/dev/sda
label=First_disk

And you can add the following in your Slackware 13.0 installation on /dev/
sda2:

other=/dev/sdb
label=Second_disk

As allways, you will have to run lilo after editing lilo.conf. Is
something goes wrong, boot from your favorite live CD, mount your Linux
installation, fix lilo.conf and do a chroot to the mountpoint before
running lilo again. It is also possible to do
"lilo -r /path/to/mounted/sdb2".

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc351(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost

Chuck Coffee

unread,
Dec 28, 2013, 2:32:19 PM12/28/13
to
On Sat, 28 Dec 2013 18:23:04 +0000, Clark Smith wrote:


>
> Any suggestions will be much appreciated.

You need something like the following in your LILO file:
# End LILO global section
# Slack-13.1 bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda10
label = Slack-13.1
read-only
# Slack-13.1 bootable partition config ends
# Slack-14 bootable partition config begins
image = /mnt/Slack-14/boot/vmlinuz
root = /dev/sda1
label = Slack-14
read-only
# Slack-14 bootable partition config ends
============
I did this from Slack 14 with the Slack 13 /dev/sda10 mounted
and then I ran LILO.conf.
Now when my Dual boot window comes up, I select the slackware version
I want.

--
Chuckels

Clark Smith

unread,
Dec 28, 2013, 2:33:34 PM12/28/13
to
On Sat, 28 Dec 2013 18:54:18 +0000, Henrik Carlqvist wrote:

> On Sat, 28 Dec 2013 18:23:04 +0000, Clark Smith wrote:
>> I have a box with Slackware 13.0 installed in /dev/sda2. I added a
>> second drive, /dev/sdb2, in which I installed Slackware 14.1. The box
>> now boots 14.1, and I have access to the /dev/sda partitions simply by
>> mounting them by means of appropriate entries in /etc/fstab in the 14.1
>> disk.
>
> Did you add any such entries to fstab? If so, what do the entries look
> like?

They were added by the Slackware installation script.

>> What I would like to do now is to be able to select, at startup
>> time, whether to boot 13.0 or 14.1. My current lilo.conf contains the
>> following relevant lines:
>>
>> boot = /dev/sdb
>> bitmap = /boot/slack.bmp
>>
>> image = /boot/vmlinuz
>> root = /dev/sdb2
>> label = Linux
>> read-only
>
> This is a little interesting as it seems as if your motherboard prefers
> to boot from the MBR of /dev/sdb instead of /dev/sda. Did you on purpose
> alter some setting in your CMOS setup for this?

I did not do it on purpose; it just happened. I opened up the PC,
and installed the new drive without touching any already-existing
connections into the motherboard. I then booted off a USB stick where I
had the Slackware 14.1 stuff, and proceeded to install 14.1 on /dev/sdb
(actually, /dev/sdb2.) At the end of the installation, when prompted to
install LILO I chose to install it on the MBR - hence the lilo.conf file
above.

>> I know how to boot different kernels, when they all live in the same
>> drive; it's just a matter of adding new 'image' blocks. But I don't
>> know how to do it when the alternative kernel lives on a separate disk.
>
> Before running lilo you must mount all partitions containing kernels
> pointed to by image-lines in lilo.conf.

They are all mounted when the 14.1 system boots up.

>> Any ideas?
>
> Another idea would be to make your lilo installations to chain load to
> each other. That way the different Linux installations does not need to
> know anything about each others kernel files. You could add a lines like
> this to lilo.conf in your Slackware 14.1 installation on /dev/sdb2:
>
> other=/dev/sda
> label=First_disk

OK.

> And you can add the following in your Slackware 13.0 installation on
> /dev/ sda2:
>
> other=/dev/sdb
> label=Second_disk

OK. However, see my comment below.

> As allways, you will have to run lilo after editing lilo.conf. Is
> something goes wrong, boot from your favorite live CD, mount your Linux
> installation, fix lilo.conf and do a chroot to the mountpoint before
> running lilo again. It is also possible to do "lilo -r
> /path/to/mounted/sdb2".

Dealing with lilo.conf on the 14.1 system is straightforward, for
that's the system that is being booted up - I just change /etc/lilo.conf
in /dev/sdb2 and run lilo. While this system is running I can also
change /etc/lilo.conf in /dev/sda2, for this partition in mounted and
accessible from the 14.1. I have two questions though:

1) How do I run lilo after changing /etc/lilo.conf in /dev/sda2?
Is it just a matter of invoking

lilo -r /13.root/etc/lilo.conf

(where /13.root is the mount point for the 13.0 root partition when
running the 14.1 system)?

2) When both /etc/lilo.conf files have been dealt with as
suggested, how do I select which Slackware version (13.0 or 14.1) should
be booted when bringing up the system? Is the 'other' clause in either
lilo.conf going to offer me the choice to boot one or the other?

My apologies if these are trivial, even silly, questions. I burnt
myself with LILO before by not doing due diligence; I wan to be much more
careful this time.

Thanks very much for your help.


Clark Smith

unread,
Dec 28, 2013, 5:30:25 PM12/28/13
to
Thanks. Unfortunately, that did not work for me. In fact, my LILO
got hosed. Not a big deal for, thanks to Henrik's advice, and some
googling, I was able to fix it. It was a good thing in the end, for I
reinstalled LILO in /dev/sda, and I can do the dual booting easily now -
which is what I needed. Therefore, your advice was useful. Thanks again.

Henrik Carlqvist

unread,
Dec 29, 2013, 6:56:19 AM12/29/13
to
On Sat, 28 Dec 2013 19:33:34 +0000, Clark Smith wrote:
> Is it just a matter of invoking
>
> lilo -r /13.root/etc/lilo.conf

It would rather be:

lilo -r /13.root

Pointing to the mount point of the root partition of your 13.0 system.
However, this also assumes that your 13.0 kernel is accessible from your
13.0 mount point. If your 13.0 system has the kernel i a separate
partition mounted at a place like /boot you will also have to make sure
that partition is mounted at 13.root/boot.

> 2) When both /etc/lilo.conf files have been dealt with as
> suggested, how do I select which Slackware version (13.0 or 14.1) should
> be booted when bringing up the system? Is the 'other' clause in either
> lilo.conf going to offer me the choice to boot one or the other?

At boot you will get two choices:
Linux (which boots Slackware 14.1)
First_disk (which loads your old lilo from /dev/sda)

If you choose First_disk you will get two new choices:
Linux (which boots Slackware 13.0)
Second_disk (which loads your new lilo from /dev/sdb)

You might want to alter the label lines in lilo.conf to be more
descriptive than just "Linux".

> My apologies if these are trivial, even silly, questions. I burnt
> myself with LILO before by not doing due diligence; I wan to be much
> more careful this time.

Before altering lilo.conf you might want to make sure that you have some
way to boot your system to fix a broken lilo.conf. This way in maight be
your favorite live CD or the Slackware installation disk. You might alwo
want to practice in using those CDs for booting into your installation or
editing lilo.conf and restoring lilo.

Chick Tower

unread,
Dec 30, 2013, 1:10:06 PM12/30/13
to
On 2013-12-28, Chuck Coffee <clco...@comcast.net> wrote:
> You need something like the following in your LILO file:
> # End LILO global section
> # Slack-13.1 bootable partition config begins
> image = /boot/vmlinuz
> root = /dev/sda10
> label = Slack-13.1
> read-only
> # Slack-13.1 bootable partition config ends
> # Slack-14 bootable partition config begins
> image = /mnt/Slack-14/boot/vmlinuz
> root = /dev/sda1
> label = Slack-14
> read-only
> # Slack-14 bootable partition config ends
>============
> I did this from Slack 14 with the Slack 13 /dev/sda10 mounted
> and then I ran LILO.conf.
> Now when my Dual boot window comes up, I select the slackware version
> I want.
>
> --
> Chuckels

It looks to me like you have the disk drives "reversed" for the OP's needs
in this lilo.conf. He's booting Slackware 14.1 just fine but trying to
add a stanza for 13.0.

However, since the OP says he got things sorted out, and you say your setup
works, this may be moot now.
--
Chick Tower

For e-mail: aols2 DOT sent DOT towerboy AT xoxy DOT net

jo...@wexfordpress.com

unread,
Jan 9, 2014, 8:15:01 PM1/9/14
to
The trick is to have all the partitions mounted when you run lilo. Then the
lilo.conf looks something like this:

boot = /dev/sda ( or wherever)
...
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sdb3
label = Slackware
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
image = /sda2/boot/vmlinuz
root = /dev/sda2
label = SUSE
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

Giovanni

unread,
Jan 10, 2014, 3:50:30 AM1/10/14
to
On 01/10/2014 02:15 AM, jo...@wexfordpress.com wrote:
>> Any suggestions will be much appreciated.
> The trick is to have all the partitions mounted when you run lilo.
> Then the lilo.conf looks something like this:
>
> boot = /dev/sda ( or wherever)
> ...
> # Linux bootable partition config begins
> image = /boot/vmlinuz
> root = /dev/sdb3
> label = Slackware
> read-only # Partitions should be mounted read-only for checking
> # Linux bootable partition config ends
> # Linux bootable partition config begins
> image = /sda2/boot/vmlinuz
> root = /dev/sda2
> label = SUSE
> read-only # Partitions should be mounted read-only for checking
> # Linux bootable partition config ends

Best solution would be to have a dedicated partition for boot images.
This partition can be mounted on '/boot' directory of all the different
environment you are going to install.

I keep also 'lilo.conf' on this partition making a symbolic link to
'/etc/lilo.conf'. So I am able to maintain only one global
configuration file from any environment currently in use.

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
< http://giovanni.homelinux.net/ >
0 new messages