Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active January 16, 2025 03:59
Show Gist options
  • Save miguelmota/d9e2249b8aff1e7d2e3093bcb54428e2 to your computer and use it in GitHub Desktop.
Save miguelmota/d9e2249b8aff1e7d2e3093bcb54428e2 to your computer and use it in GitHub Desktop.
Arch linux kernel modules not loading or not found fix notes
# boot from live disk
# mount user partition
mount /dev/sda3 /mnt
# it might under a different location, such as
# mount /dev/nvme0n1p3 /mnt
# chroot into partition
arch-chroot /mnt
# check current kernel version
uname -r
# check available kernels, it should show no folder for current kernel version
ls /lib/modules
# install latest kernel
pacman -Syu linux linux-headers
# check linux kernel version installed
pacman -Q | grep linux
# creates /boot/initramfs-linux-fallback.img
mkinitcpio -p linux
# generate initramfs for all kernels
# mkinitcpio -P
# if there's errors, run
# pacman -S linux
# and try mkinitcpio again
# check /boot is mounted in fstab, since it may not be updating correct kernel image if not mounted.
lsblk -o NAME,UUID,MOUNTPOINT
cat /etc/fstab
# if it doesn't exist, then add it. Use UUID from lsblk output
#UUID=1A3B-C3D4 /boot vfat defaults 0 2
# (optional) regenerate grub
exit
mount /dev/sda1 /mnt/boot
arch-chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg
# check path is correct
cat /boot/grub/grub.cfg | grep vmlinuz
# (optional) customize grub menu
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=7"
GRUB_DISABLE_SUBMENU=y
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
# regenerate with grub-mkconfig -o /boot/grub/grub.cfg
# check last modified date, it should show recently modified images
ls -l /boot/
# check available kernels, should show latest kernel
ls /lib/modules
# reboot and select latest kernel
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment