No mkinitcpio preset present

10,321

Solution 1

Regenerate a new initramfs-linux.img accordingly to the archlinux wiki:

mkinitcpio -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img -k 5.5.7-arch1-1

use ls /usr/lib/modules to get the available kernel.

Solution 2

Had this recently. My solution was to chroot into the system from an Arch live system. Delete the empty linux.preset in /etc/mkinitcpio.d/ and then run pacman -S linux.

This regenerated the linux.preset and the initramfs was rebuild. After that Arch booted as usual.

Share:
10,321

Related videos on Youtube

R Harrington
Author by

R Harrington

Updated on September 18, 2022

Comments

  • R Harrington
    R Harrington over 1 year

    My laptop lost battery during an update, so the linux kernel got truncated. After arch-chrooting into it and reinstalling linux, it's OK, but /boot/initramfs-linux.img (and the fallback) are empty. Also, /etc/mkinitcpio.d/linux.preset is empty. How can I fix this, and how can I generate a preset?

    ls /etc/mkinitcpio.d/ returns nothing

  • R Harrington
    R Harrington about 4 years
    I just get /usr/sbin/mkinitcpio: line 265: /etc/mkinitcpio.d/linux.preset: No such file or directory ==> ERROR: Failed to load preset: /etc/mkinitcpio.d/linux.preset' on the second command
  • R Harrington
    R Harrington about 4 years
    Yes, it's installed and I've reinstalled it
  • GAD3R
    GAD3R about 4 years
    @RHarrington could you add the ls /etc/mkinitcpio.d/
  • GAD3R
    GAD3R about 4 years
    @RHarrington See my edit please.
  • R Harrington
    R Harrington about 4 years
    I'm chrooted in, so I get ==> ERROR: '/lib/modules/5.1.0-050100-generic' is not a valid kernel module directory because of my host's kernel. How can I fix this?
  • GAD3R
    GAD3R about 4 years
  • R Harrington
    R Harrington about 4 years
  • 7beggars_nnnnm
    7beggars_nnnnm over 2 years
    it is worked! correct
  • colin
    colin over 2 years
    Down-voted as this is not a permanent fix. You'll have to do this manually every time you upgrade linux. The other answer is a permanent fix.
  • colin
    colin over 2 years
    This is a better answer because it fixes the problem permanently
  • GAD3R
    GAD3R over 2 years
    @GaryvanderMerwe downvote is used for the wrong answer, not for the accepted answer.