Discussion:
dual booting fails due to missing modules
(too old to reply)
K. Venken
2021-05-13 10:52:04 UTC
Permalink
I installed two versions of Slackware (14.1 and 14.2 in one case, but it
also happened with 14.2 and current in another), each in their own
partition. Eg. 14.1 is installed in /dev/sda2 and 14.2 in /dev/sda3.

After installation of the first, everything is fine. It boots as
expected. Then I install the 2nd version.

During installation of the second one, I let lilo configure both, so
there are 3 entries, as their is an old Windows one as well, which
doesn't matter here.

After this, I can boot only the last one, thus 14.2, and Windows to be
complete but, not the first one thus 14.1. This is, it boots properly,
but it is frozen after the login prompt. Somewhere during the boot I saw
something like * missing directory * something * modules, which makes me
suspect that - due to the modules not loaded, nothing "externally" as
keyboard works, and for the rest everything is fine.

I did a test and booted with the DVD and fixed the first one (14.1) by
running lilo on its partition (/dev/sda2). Now the second (14.2) has the
same problem. It is frozen at the prompt.

I checked on both sda2 and sda3 that kernel and modules are properly
linked to and files exists.

Then I checked then lilo.conf, on the 2nd, (on sda3) I got (see below).

I would have thought that having the root directory properly setup, the
modules directory should have been found as well. But this seems not to
be the case.


append=" vt.default_utf8=0"
boot = /dev/sda

bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255

prompt
timeout = 200
change-rules
reset
vga = normal

# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda3
label = Linux
read-only
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
label = Windows
table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda2
label = Linux-old
read-only
# Linux bootable partition config ends
K. Venken
2021-05-13 12:54:54 UTC
Permalink
To be able to read the boot messages, I did the setup again in a
virtualbox, so I could pause the system.

Running Lilo in 14.1 and then booting 14.2 gave:

Running /etc/rc.d/rc.modules -> rc.modules-3.10.17
Updating module dependencies for Linux 4.4.14
depmod: ERROR: could not open directory /lib/modules/4.4.14

Otherway around

Running lilo in 14.2 and then booting 14.1 gave:

Creating modules dependency list for 3.10.17: /sbin/... -all
depmod: ERROR: Could not open directory /lib/modules/3.10.17

It seemed that, for whatever reason, it always booted the kernel lilo
was run with. This is not what I expected as root is specified in lilo.conf

Anyway, the fix was to

- mount the 'other' linux version
- copy the vmlinuz-huge-... from that boot to the boot were lilo was run
- refer to the proper names in lilo.conf, like

# Linux bootable partition config begins
image = /boot/vmlinuz-huge-4.4.14
root = /dev/sda3
label = Linux
read-only
# Linux bootable partition config ends

# Windows bootable partition config begins
other = /dev/sda1
label = Windows
table = /dev/sda
# Windows bootable partition config ends

# Linux bootable partition config begins
image = /boot/vmlinuz-huge-3.10.17
root = /dev/sda2
label = Linux-old
read-only
# Linux bootable partition config ends
Post by K. Venken
I installed two versions of Slackware (14.1 and 14.2 in one case, but it
also happened with 14.2 and current in another), each in their own
partition. Eg. 14.1 is installed in /dev/sda2 and 14.2 in /dev/sda3.
After installation of the first, everything is fine. It boots as
expected. Then I install the 2nd version.
During installation of the second one, I let lilo configure both, so
there are 3 entries, as their is an old Windows one as well, which
doesn't matter here.
After this, I can boot only the last one, thus 14.2, and Windows to be
complete but, not the first one thus 14.1. This is, it boots properly,
but it is frozen after the login prompt. Somewhere during the boot I saw
something like * missing directory * something * modules, which makes me
suspect that - due to the modules not loaded, nothing "externally" as
keyboard works, and for the rest everything is fine.
I did a test and booted with the DVD and fixed the first one (14.1) by
running lilo on its partition (/dev/sda2). Now the second (14.2) has the
same problem. It is frozen at the prompt.
I checked on both sda2 and sda3 that kernel and modules are properly
linked to and files exists.
Then I checked then lilo.conf, on the 2nd, (on sda3) I got (see below).
I would have thought that having the root directory properly setup, the
modules directory should have been found as well. But this seems not to
be the case.
append=" vt.default_utf8=0"
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
prompt
timeout = 200
change-rules
  reset
vga = normal
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda3
  label = Linux
  read-only
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
  label = Windows
  table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda2
  label = Linux-old
  read-only
# Linux bootable partition config ends
Chris Vine
2021-05-13 16:14:41 UTC
Permalink
On Thu, 13 May 2021 14:54:54 +0200
Post by K. Venken
To be able to read the boot messages, I did the setup again in a
virtualbox, so I could pause the system.
Running /etc/rc.d/rc.modules -> rc.modules-3.10.17
Updating module dependencies for Linux 4.4.14
depmod: ERROR: could not open directory /lib/modules/4.4.14
Otherway around
Creating modules dependency list for 3.10.17: /sbin/... -all
depmod: ERROR: Could not open directory /lib/modules/3.10.17
It seemed that, for whatever reason, it always booted the kernel lilo
was run with. This is not what I expected as root is specified in lilo.conf
Anyway, the fix was to
- mount the 'other' linux version
- copy the vmlinuz-huge-... from that boot to the boot were lilo was run
- refer to the proper names in lilo.conf, like
# Linux bootable partition config begins
image = /boot/vmlinuz-huge-4.4.14
root = /dev/sda3
label = Linux
read-only
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
label = Windows
table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz-huge-3.10.17
root = /dev/sda2
label = Linux-old
read-only
# Linux bootable partition config ends
The reason why you had this problem is that when you run lilo on
installing a new kernel, it will look in the /boot directory in order to
find /boot/vmlinuz-huge-4.4.13 and /boot/vmlinuz-hugh-3.10.17 as
specified in your lilo.conf file. However, you cannot have
both /dev/sda1 and /dev/sda2 mounted on / at the same time, so one of
the kernels (the one representing the unmounted kernel image) will not
be found. You need to have the two kernel images mounted and visible
at the same time, at the location specified in /etc/lilo.conf, say by
putting them on the same partition. Someone else has described one way
of doing that.
Giovanni
2021-05-13 14:24:46 UTC
Permalink
Post by K. Venken
I installed two versions of Slackware (14.1 and 14.2 in one case, but it
also happened with 14.2 and current in another), each in their own
partition. Eg. 14.1 is installed in /dev/sda2 and 14.2 in /dev/sda3.
After installation of the first, everything is fine. It boots as
expected. Then I install the 2nd version.
During installation of the second one, I let lilo configure both, so
there are 3 entries, as their is an old Windows one as well, which
doesn't matter here.
After this, I can boot only the last one, thus 14.2, and Windows to be
complete but, not the first one thus 14.1. This is, it boots properly,
but it is frozen after the login prompt. Somewhere during the boot I saw
something like * missing directory * something * modules, which makes me
suspect that - due to the modules not loaded, nothing "externally" as
keyboard works, and for the rest everything is fine.
To have multi boot for different releases you should have a separate
partition dedicated to kernel boot images and to lilo files and marked
as bootable.

This partition should be mounted to the boot directory of both releases.
Running lilo creates a file called 'map' where it stores the map of the
kernel images, in both partitions the /etc/lilo.conf is a symbolic link
to /boot/lilo conf so only one file has to be maintained.

It is also quite easy to install/test kernel upgrades, because they
install as vmlinuz and selecting to boot the 'test' image

I slightly modified the installkernel script to avoid overwriting config
and System.map files and this is my lilo.conf stored in /dev/sda3

-------------------------------------------------------------------
## boot = /dev/sda3
boot = /dev/disk/by-uuid/1bf90fdf-c71a-4233-bc46-cbb7b5699713

## Set the verbose level for bootloader installation (0:5)
verbose = 2

## Set the location of the map file
map = /boot/map

## Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255

prompt
timeout = 50
lba32
## vga = normal
vga = 0x318 ## see documentation for correct values

ramdisk = 0 ## Paranoia setting
## serial = 0,38400n8 ## (ttyS1, 38400,19200 bps, no parity, 8 bits)
change-rules ## Override dangerous defaults
reset

default = linux

## Append default kernel parameters
append = "vt.default_utf8=1 raid=noautodetect"

## Linux bootable partition config begins
image = /boot/vmlinuz-4.4.227.3
label = linux
## root = /dev/sda10 UUID="f1afc108-0f97-451d-8da1-5087701dcc92"
root = /dev/disk/by-uuid/f1afc108-0f97-451d-8da1-5087701dcc92
read-only

## Linux bootable partition config begins
image = /boot/vmlinuz-4.4.227.101
label = slack64
## root = /dev/sda2 "UUID=5d82c621-72d6-4142-b3cc-bd9d2dd9d3a3"
root = /dev/disk/by-uuid/3b0432fb-4e0e-4ac4-b679-039e4cb7cff8
addappend = "3"
read-only

## Linux bootable partition config begins
image = /boot/vmlinuz
## initrd = /boot/initrd.gz
## root = /dev/sda2 UUID="5d82c621-72d6-4142-b3cc-bd9d2dd9d3a3"
## root = /dev/disk/by-uuid/5d82c621-72d6-4142-b3cc-bd9d2dd9d3a3
## root = /dev/sda10 UUID="f1afc108-0f97-451d-8da1-5087701dcc92"
root = /dev/disk/by-uuid/f1afc108-0f97-451d-8da1-5087701dcc92
label = test
addappend = "3"
read-only ## Mounted read-only for checking

## Windows bootable partition config
other = /dev/sda1
label = WinXp
table = /dev/sda
------------------------------------------------------------


Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
< http://giovanni.homelinux.net/ >
Henrik Carlqvist
2021-05-13 17:36:08 UTC
Permalink
Post by K. Venken
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda3
label = Linux
...
Post by K. Venken
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda2
label = Linux-old
As others have already pointed out and as you already have seen yourself
both those entries point to the same kernel.
Post by K. Venken
I would have thought that having the root directory properly setup, the
modules directory should have been found as well. But this seems not to
be the case.
The root argument is not in anyway parsed by lilo. Lilo does not mount
different root partitions, checking if there is a separate boot partition
which needs to get mounted and searches for the kernel there. Lilo simply
takes the kernel you have pointed to in your currently mounted partitions.

The root argument is given as an argument to the kernel at boot so the
kernel knows what to mount as its first root partition. Once the kernel
has mounted the root partition it will attempt to start the init process
which will run startup scripts which might mount more partitions
mentioned in /etc/fstab.

As you have found and as others have suggested you can put all kernels on
the installation running lilo. Another way would be to run lilo on all
installations but only let one installation install boot into /dev/sda
hand have other lilos put their boot in /dev/sdaX, where X is the number
pointing to their root partition file system. The master lilo could then
make a chain loading to the other lilos like you chain load the Windows
partition. I don't say that this would be a better solution, but it might
make life easier the day you update kernels without having to wonder if
you need to copy your kernel to some other installation also.

regards Henrik

Loading...