Installed kernel is not copied to /boot

Hi,

I’m trying to install the 5.10 LTS kernel, since the last kernel upgrade (to 5.16) made my computer unable to boot. I have tried using the mhwd-kernel tool , and initially it looked fine but it gave me some error messages like:

[2022-01-05T20:52:31+0100] [ALPM-SCRIPTLET] :: Running kernel-install for kernel 5.10.89-1-MANJARO
[2022-01-05T20:52:36+0100] [ALPM-SCRIPTLET] ==> ERROR: Unable to write to path: `/boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO/initrd'          
[2022-01-05T20:52:36+0100] [ALPM-SCRIPTLET] ==> ERROR: Unable to write to path: `/boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO/initrd-fallback'

I discovered that the new kernel was not installed in /boot. I then created the directory /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO manually and tried again, this time the error messages disappeared but the files were still missing from /boot. I then tried copying the files from /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO to /boot and ran update-grub manually, this time the kernel was found and I could boot it. Hoping this had somehow solved everything, I tried installing yet another kernel version, which was successfully installed into /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/<kernel_version> but it was not copied to /boot. The 5.16 kernel which I had installed first (whose update made the computer unable to boot) did not seem to require the /boot/efi/66823fbac26e41469b40e8bd3fb2a41b directory.

Any ideas what could be wrong here? It works for now but I guess the next time I get a kernel update it will not be installed correctly.

Hi @iceaway, and welcome!

I just did mine, not too long ago, and had absolutely no problems, whatsoever. What you’re describing sounds like, to me at least, a permissions error.

Please post the output of:

stat /boot

TIP: When providing terminal output, wrap the text in 3 backticks (```) before as well as after the text. Like this:

```
pasted text
```

This will just cause it to be rendered like this:

Ut placerat placerat
commodo
placerat tristique nunc
amet dolor quam ex quis
ac maximus
pellentesque magna
purus quam rutrum
cursus enim ac et purus magna.

instead of like this:

Ut placerat placerat commodo placerat tristique nunc amet dolor quam ex quis ac maximus pellentesque magna purus quam rutrum cursus enim ac et purus magna.

making it much more legible, thus easier for those trying to provide assistance and increasing your chances to receive said assistance.

Alternatively, paste the text, select it all and press the “Preformatted text” (</>) button on the toolbar.

Thanks for the welcome!

The output is:

$ stat /boot                                                                 ~
  File: /boot
  Size: 562       	Blocks: 0          IO Block: 4096   directory
Device: 0,27	Inode: 260         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-01-06 13:40:40.698425720 +0100
Modify: 2022-01-06 09:56:21.667446134 +0100
Change: 2022-01-06 09:56:21.667446134 +0100
 Birth: 2021-12-22 22:23:01.423435945 +0100

Does that look alright?

That’s the important line and It looks fine. Hede’s mine for comparison:

Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)

Now, how did you do the upgrade?

Hello @iceaway :wink:

Just a guess, but did you install systemd-boot recently?

pamac list --installed | grep -i "systemd-boot"

Looks to me that not the grub hook in pacman is working, but something different. And well, the error could be occur when no space is left on the EFI Partition, which is mounted in /boot/efi.

The initial upgrade was using the Add/Remove software GUI (as I was notified of upgrades available).

Not that I am aware of. I am using GRUB but I have been considering systemd-boot as I read somewhere that it is a lot faster when using an encrypted disk (I use luks with btrfs inside).

$ pamac list --installed | grep -i "systemd-boot"                                22-01-06 - 13:59:05
systemd-boot-manager                     0.9-1                       community  13.1 kB

Seems like it is installed. Could that interfere somehow? I have not installed it myself on purpose, as far as I know. The disk space looks good to me:

$ df -h | grep efi                                                               22-01-06 - 13:59:15
/dev/nvme0n1p1         511M  120M  392M  24% /boot/efi

I’ll leave you in @megavolt’s more than capable hands.

:wink:

1 Like

Yes… as you see, it installs also some hooks:

$ sudo pacman -Ql systemd-boot-manager
systemd-boot-manager /etc/
systemd-boot-manager /etc/sdboot-manage.conf
systemd-boot-manager /usr/
systemd-boot-manager /usr/bin/
systemd-boot-manager /usr/bin/sdboot-manage
systemd-boot-manager /usr/share/
systemd-boot-manager /usr/share/libalpm/
systemd-boot-manager /usr/share/libalpm/hooks/
systemd-boot-manager /usr/share/libalpm/hooks/sdboot-kernel-remove.hook
systemd-boot-manager /usr/share/libalpm/hooks/sdboot-kernel-update.hook
systemd-boot-manager /usr/share/libalpm/hooks/sdboot-systemd-update.hook

So remove it and you should be good.

I have removed systemd-boot-manager now, and tried to remove/reinstall the 5.14 kernel (using it to test the install, not planning on using it), but it still only installs itself to /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.14.21-2-MANJARO/, so update-grub cannot find it.

Kernel install log:

% sudo mhwd-kernel -i linux514                                                   22-01-06 - 14:56:21
:: Synchronizing package databases...
 core                            169.4 KiB  2.07 MiB/s 00:00 [#################################] 100%
 extra                          1916.4 KiB  14.9 MiB/s 00:00 [#################################] 100%
 community                         6.8 MiB  29.4 MiB/s 00:00 [#################################] 100%
 multilib                        178.2 KiB  8.70 MiB/s 00:00 [#################################] 100%
resolving dependencies...
looking for conflicting packages...

Packages (2) linux514-5.14.21-2  linux514-virtualbox-host-modules-6.1.30-1

Total Installed Size:  101.77 MiB

:: Proceed with installation? [Y/n] 
(2/2) checking keys in keyring                               [#################################] 100%
(2/2) checking package integrity                             [#################################] 100%
(2/2) loading package files                                  [#################################] 100%
(2/2) checking for file conflicts                            [#################################] 100%
(2/2) checking available disk space                          [#################################] 100%
:: Processing package changes...
(1/2) installing linux514                                    [#################################] 100%
>>> NOTE: 5.14.21 is the last maintenance release for the linux514 series.
    This kernel is now marked 'End Of Life' (EOL).
    
    It is recommend to switch to the newer linux515 series:
    'sudo mhwd-kernel -i linux515'
    
Optional dependencies for linux514
    crda: to set the correct wireless channels of your country [installed]
(2/2) installing linux514-virtualbox-host-modules            [#################################] 100%
===> You must load vboxdrv module before starting VirtualBox:
===> # modprobe vboxdrv
:: Running post-transaction hooks...
(1/5) Arming ConditionNeedsUpdate...
(2/5) Updating module dependencies...

(3/5) Installing kernel...
:: Running kernel-install for kernel 5.14.21-2-MANJARO
==> Starting build: 5.14.21-2-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [consolefont]
  -> Running build hook: [keymap]
  -> Running build hook: [keyboard]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.14.21-2-MANJARO/initrd
==> Image generation successful
==> Starting build: 5.14.21-2-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [consolefont]
  -> Running build hook: [keymap]
  -> Running build hook: [keyboard]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.14.21-2-MANJARO/initrd-fallback
==> Image generation successful
(4/5) Installing mkinitcpio presets...
:: Generating /etc/mkinitcpio.d/linux514.preset
(5/5) Updating Grub-Bootmenu
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.16-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.16-x86_64.img
Found initrd fallback image: /boot/initramfs-5.16-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
Found snapshot: 2022-01-06 14:54:40 | timeshift-btrfs/snapshots/2022-01-06_14-54-40/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
Found snapshot: 2022-01-06 09:49:26 | timeshift-btrfs/snapshots/2022-01-06_09-49-25/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
Found snapshot: 2022-01-06 09:48:40 | timeshift-btrfs/snapshots/2022-01-06_09-48-40/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
Found snapshot: 2022-01-05 22:55:54 | timeshift-btrfs/snapshots/2022-01-05_22-55-53/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
Found snapshot: 2022-01-05 20:02:40 | timeshift-btrfs/snapshots/2022-01-05_20-42-11/@ | ondemand | Before restoring '2022-01-05 20:37:35'        |
Found snapshot: 2021-12-22 23:05:33 | timeshift-btrfs/snapshots/2021-12-22_23-05-33/@ | ondemand | N/A                                           |
Found 6 snapshot(s)
Unmount /tmp/grub-btrfs.hAGLmig4Ur .. Success
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
% ls -l /boot                                                                    22-01-06 - 15:00:29
total 123008
-rw-r--r-- 1 root root    51200 Nov  2 19:41 amd-ucode.img
drwxr-xr-x 5 root root     4096 Jan  1  1970 efi
drwxr-xr-x 1 root root      144 Jan  6 14:57 grub
-rwxr-xr-x 1 root root 32256181 Jan  6 09:52 initramfs-5.10-x86_64-fallback.img
-rwxr-xr-x 1 root root 13336869 Jan  6 09:52 initramfs-5.10-x86_64.img
-rw------- 1 root root 41264327 Dec 22 23:00 initramfs-5.16-x86_64-fallback.img
-rw------- 1 root root 14130005 Dec 22 23:00 initramfs-5.16-x86_64.img
-rw-r--r-- 1 root root  4769792 Jun  8  2021 intel-ucode.img
-rw-r--r-- 1 root root       22 Dec 29 19:08 linux510-x86_64.kver
-rw-r--r-- 1 root root       22 Nov 21 23:42 linux514-x86_64.kver
-rw-r--r-- 1 root root       22 Dec 29 19:07 linux515-x86_64.kver
-rw-r--r-- 1 root root       38 Dec 20 16:47 linux516-x86_64.kver
drwxr-xr-x 1 root root       22 Dec 22 22:32 memtest86+
-rwxr-xr-x 1 root root  9460384 Jan  6 09:52 vmlinuz-5.10-x86_64
-rw-r--r-- 1 root root 10650208 Dec 22 22:40 vmlinuz-5.16-x86_64

Can you think of anything else?

When searching for systed-boot I don’t find it. Instead, I find systemd-kernel-maintenance:

$ pamac search systemd-boot

systemd-kernel-maintenance                                                                                                                                                                                                    0.92-1              community
[..]

So see if that’s installed, and perhaps it should be removed, then?

pamac search systemd-kernel-maintenance
1 Like

Have look at these files:

ls /etc/mkinitcpio.d/*

mkininitcpio creates the images and read these paths in the files and also what @Mirdarthos mentioned.

I tried that, and now the vmlinuzfile seems to be copied, but not the initramfs. I also checked /etc/mkinitcpio.d/* as @megavolt suggested, and found an interesting difference. The default kernel version is different from the others:

--- linux510.preset	2022-01-06 09:49:54.556222195 +0100
+++ linux516.preset	2022-01-05 21:04:18.665988403 +0100
@@ -1,6 +1,6 @@
 ALL_config="/etc/mkinitcpio.conf"
-ALL_kver="/boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO/linux"
+ALL_kver="/66823fbac26e41469b40e8bd3fb2a41b/5.16.0-1-MANJARO/linux"
 PRESETS=(default fallback)
-default_image="/boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO/initrd"
-fallback_image="/boot/efi/66823fbac26e41469b40e8bd3fb2a41b/5.10.89-1-MANJARO/initrd-fallback"
+default_image="/66823fbac26e41469b40e8bd3fb2a41b/5.16.0-1-MANJARO/initrd"
+fallback_image="/66823fbac26e41469b40e8bd3fb2a41b/5.16.0-1-MANJARO/initrd-fallback"
 fallback_options="-S autodetect"

Where do these files come from? It’s strange that the default kernel lacks /boot/efi in the path. I suppose that is why the initramfs is not in the correct place in /boot.

No idea which script did that, propably the systemd-boot hook. :man_shrugging:

Yes, you need to correct that. :wink:

Thanks for all your quick help! I think I figured out what went wrong. After removing the systemd-stuff as you suggested, the vmlinuz-files were copied correctly, but the initramfs-files ended up in the wrong place due to the bad content of the *.preset files in /etc/mkinitcpio.d.
I tried removing/installing the same kernel over and over again during testing using the mhwd-kernel command, and in that process I believe it saved the old *.preset file to a .pacsave file under /etc/mkinitcpio.d (this file would have the bad path in it), and when the kernel was reinstalled, it would take that old .pacsave file instead of writing a new correct one. I guess the systemd-packages put the weird path in it, which grub does not understand, and after removing systemd-boot the wrong path was still saved in the .pacsave file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.