You are not logged in.

#1 2019-06-19 18:56:13

snazz
Member
Registered: 2019-06-19
Posts: 7

[SOLVED] Kernel module version does not match kernel version...

(original title: Kernel module version does not match kernel version after upgrade)

Hello! I recently installed Arch following the Installation Guide. After upgrading my system (including the Linux package), systemd says it cannot mount /boot and drops me into an emergency shell.

From that shell, I can see that the version numbers given by uname -a and pacman -Qi linux differ, suggesting that I am booting from a new kernel but with old modules (which is why I cannot mount /boot).

My fstab includes / and /boot, in that order. The only difference from a “standard” Arch install that I made was to give the —removable option to grub-install because I could not seem to add a UEFI boot entry (both Debian and Fedora gave errors about the same issue; I think it’s a bug in my motherboard firmware). /boot is mounted when I upgrade the kernel and mkinitcpio only gives two unrelated warnings about missing WiFi firmware.

There are a number of threads referencing this same systemd error message but none of the ones I have seen have contained much information relevant to my specific issue.

Any help would be much appreciated!

Last edited by snazz (2019-06-19 21:36:13)

Offline

#2 2019-06-19 19:00:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Kernel module version does not match kernel version...

Most likely your /boot was not mounted for the upgrade. From the chroot, make sure it is mounted and reinstall linux.

Then remove the files written to the root filesystem during the first upgrade.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-06-19 19:09:17

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

I booted into a live USB, mounted /dev/sda2 to /mnt and /dev/sda1 to /mnt/boot, chrooted into /mnt, and reinstalled linux. I receive the same error upon rebooting. mkinitcpio produced identical output to when I upgraded from the running system.

When you say “remove the files written to the root filesystem during the first upgrade,” are you referring to files in the /boot directory on the root filesystem or some other location?

Offline

#4 2019-06-19 20:11:17

seth
Member
Registered: 2012-09-03
Posts: 64,547

Re: [SOLVED] Kernel module version does not match kernel version...

suggesting that I am booting from a new kernel but with old modules

What's the actual output?
I assume you still can boot the fallback initramfs?

Offline

#5 2019-06-19 20:27:42

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

seth wrote:

suggesting that I am booting from a new kernel but with old modules

What's the actual output?
I assume you still can boot the fallback initramfs?

The Linux version returned by pacman is 5.1.11-arch1-1, while uname -a tells me I’m running 5.1.6-arch1-1-ARCH. Booting with the fallback option selected in GRUB gives the same “[FAILED] Failed to mount /boot” error caused by “mount: /boot: unknown filesystem type ‘vfat’.”

Offline

#6 2019-06-19 20:37:48

seth
Member
Registered: 2012-09-03
Posts: 64,547

Re: [SOLVED] Kernel module version does not match kernel version...

That makes far more sense (you're booting an old kernel w/ new modules) and #2 remains the most likely scenario (perhaps w/ a twist)

What's the output of "ls -l /mnt/boot" before and after mounting sda1 into /mnt/boot?
(If the live system has no GUI you can make use of eg. https://wiki.archlinux.org/index.php/Pastebin)

Offline

#7 2019-06-19 21:00:40

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

(from the Arch USB stick I used to install)

# mount /dev/sda2 /mnt
# ls -l /mnt/boot
total 44756
drwxr-xr-x 2 root root 4096 Jun 4 21:40 efi
drwxr-xr-x 6 root root 4096 Jun 4 21:47 grub
-rw-r—r— 1 root root 9168943 Jun 5 21:54 initramfs-linux.img
-rw-r—r— 1 root root 30578405 Jun 5 21:54 initramfs-linux-fallback.img
-rw-r—r— 1 root root 6068608 May 31 15:17 vmlinuz-linux
# mount /dev/sda1 /mnt/boot
# ls -l /mnt/boot
total 44744
drwxr-xr-x 4 root root 8192 Jun 4 21:46 EFI
drwxr-xr-x 6 root root 8192 Jun 4 21:26 grub
-rw-r—r— 1 root root 9166214 Jun 19 19:09 initramfs-linux.img
-rw-r—r— 1 root root 30562324 Jun 5 19:09 initramfs-linux-fallback.img
-rw-r—r— 1 root root 6064512 Jun 17 18:54 vmlinuz-linux

So either the kernel or the kernel modules is coming from the /boot directory when it should be coming from the /boot partition? Will deleting the contents of the /boot directory on the root filesystem solve the issue?

Last edited by snazz (2019-06-19 21:03:26)

Offline

#8 2019-06-19 21:03:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Kernel module version does not match kernel version...

jasonwryan wrote:

Then remove the files written to the root filesystem during the first upgrade.

Please paste your /fstab as well...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2019-06-19 21:07:01

seth
Member
Registered: 2012-09-03
Posts: 64,547

Re: [SOLVED] Kernel module version does not match kernel version...

I suspect you're booting from the root partition, ie. the grub.cfg does not point to the /boot partition (cause you ran grub-mkconfig w/o /boot being mounted?)
Try to re-install the kernel w/o mounting /boot or fix the grub config (you can also do the one first to be able to boot back into the system and run grub-mkconfig)

Interestingly the fallback image on sda1 is even briefly older than the one on /boot…

Offline

#10 2019-06-19 21:19:03

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

My fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=f71a6d2e-48b5-469d-af06-f8db0b79e02b	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=209B-9D17      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

@seth: That seems like a probable explanation. I’ll give it a go.

Offline

#11 2019-06-19 21:24:59

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

seth wrote:

I suspect you're booting from the root partition, ie. the grub.cfg does not point to the /boot partition (cause you ran grub-mkconfig w/o /boot being mounted?)
Try to re-install the kernel w/o mounting /boot or fix the grub config (you can also do the one first to be able to boot back into the system and run grub-mkconfig)

Interestingly the fallback image on sda1 is even briefly older than the one on /boot…

Reinstalling the kernel without /boot mounted allowed me to boot normally. If I completely remove /dev/sda1 (boot partition) from my fstab, will future kernel upgrades just work?

Offline

#12 2019-06-19 21:26:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,371
Website

Re: [SOLVED] Kernel module version does not match kernel version...

That would probably suffice.  But wouldn't it make more sense to fix the problem with grub?  Presumably you made the boot partition to be used, not to sit unused.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2019-06-19 21:29:41

seth
Member
Registered: 2012-09-03
Posts: 64,547

Re: [SOLVED] Kernel module version does not match kernel version...

You don't have to use a separate boot partition, no (and in this case you can and should remove the fstab entry)
Though your UEFI related issues might stem from that (assumig this is an https://wiki.archlinux.org/index.php/EF … _partition ?)

Offline

#14 2019-06-19 21:35:13

snazz
Member
Registered: 2019-06-19
Posts: 7

Re: [SOLVED] Kernel module version does not match kernel version...

It is an ESP and the UEFI issues have cropped up with a friend’s PC (we bought the same thing at the same time and both run different Linux distros) as well as my own on every Linux distro I’ve tried, so I’ll chalk it up to that. I will certainly play with fixing the problem the “right way” the next time I get a kernel upgrade, but my goal today had more to do with getting the thing up and running with the latest kernel.

Thank you all for your help! I’ll mark this thread solved.

Offline

Board footer

Powered by FluxBB