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.
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 (```) beforeas well asafter 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.
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.
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:
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
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:
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.
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.