You are not logged in.

#1 2019-09-20 11:01:44

eridanus
Member
Registered: 2019-09-20
Posts: 4

Arch is unbootable after each kernel update

Hi

I had 2 kernel updates: to 5.2.14 and to 5.3
Each kernel update the OS was unable to load the kernel modules and it was stuck at a login screen.
Each time I was needed to completely reinstall the grub in order to boot properly.
What's the problem? The kernel update wasn't interrupted, maybe I have messed grub configs or something? I don't know which additional information to provide (now my system works again, but it may crash the next kernel update as it crashed 2 times till now).

Offline

#2 2019-09-20 11:16:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,806

Re: Arch is unbootable after each kernel update

Where did you install GRUB to ? If on an EFI partition you will want to decide whether the kernel images should be loaded from there as well, in which case you must mount the ESP to /boot prior to the kernel update (which is best ensured with an fstab entry) in order for them to be present after an update, or you do not mount the ESP to /boot in which case you must ensure that your GRUB configuration refers to the kernel images on the root partition and not the ones on your ESP.

In doubt post your generated GRUB config, your fstab, grub install and config creation commands used and

lsblk -f
mount
tree /boot 

in [ code ][ /code ] tags without the spaces.

Last edited by V1del (2019-09-20 11:17:33)

Offline

#3 2019-09-20 11:57:03

eridanus
Member
Registered: 2019-09-20
Posts: 4

Re: Arch is unbootable after each kernel update

V1del wrote:

Where did you install GRUB to ? If on an EFI partition you will want to decide whether the kernel images should be loaded from there as well, in which case you must mount the ESP to /boot prior to the kernel update (which is best ensured with an fstab entry) in order for them to be present after an update, or you do not mount the ESP to /boot in which case you must ensure that your GRUB configuration refers to the kernel images on the root partition and not the ones on your ESP.

In doubt post your generated GRUB config, your fstab, grub install and config creation commands used and

lsblk -f
mount
tree /boot 

in [ code ][ /code ] tags without the spaces.

GRUB is installed into the /boot/efi directory (after the first crash it was installed in /boot directory). After the installation into the /boot/efi I can't locate my grub.cfg file anymore.
I can provide my /etc/default/grub config if it may help:

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

My fstab:

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

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdb2
UUID=e002562b-f3bb-46be-af9e-239a35ef96e9	/         	ext4      	rw,relatime	0 1

# /dev/sdb1
UUID=5DDE-FA2A      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

My grub reinstall during the second crush (the current crash that is somehow solved) was like this:
1) Boot from bootable USB
2)

mount <my rootfs partition> /mnt

3)

mount <my boot partition> /mnt/boot/efi

4)

arch-chroot /mnt

5)

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Arch

6) I was trying to

grub-mkconfig -o /boot/grub/grub.cfg

but I got an error:

grub-probe: error: Cannot find a GRUB drive for /dev/sdc1. Check your device.map

/dev/sdc1 it is my bootable USB drive partition. I've found that the device.map file doesn't exist and I can't run

grub-mkdevicemap

command. However, I've decided to reboot at this point and suddenly I could boot properly.

lsblk -f output:

NAME   FSTYPE   LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                       
├─sda1 vfat           9153-2D89                                           
└─sda2 crypto_L       5b9e30e2-545e-491e-845e-372c3c89dad8                
sdb                                                                       
├─sdb1 vfat           5DDE-FA2A                             299.3M     0% /boot
└─sdb2 ext4           e002562b-f3bb-46be-af9e-239a35ef96e9  162.6G    25% /

mount output:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4008496k,nr_inodes=1002124,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=11419)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=803440k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)

tree /boot output:

/boot
└── efi
    └── Arch
        └── grubx64.efi

2 directories, 1 file

Offline

#4 2019-09-20 12:20:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,806

Re: Arch is unbootable after each kernel update

Alright now, by logic of how it is set up now your GRUB configuration and the kernel image is from the /boot directory (on your root partition, not the ESP) and the GRUB that is launched is on your EFI partition. What you do here depends on what you want:

  • Keep the kernel images on the root parition and only load GRUB from the EFI partition -> if that is the case you will want to remove (or comment out) the /boot entry from your fstab (or switch it to a non conflicting path like) /efi and umount /boot (after which you will miracoulously notice the /boot directory of your root partition, containing both the relevant kernel images and your grub configuration.

  • If you actually want your kernel images on the ESP and not on your root partition umount /boot (and/or mount it at some temp location like /boottemp),remove your /boot directory on the root partition (or move over all the files to /boottemp, remove /boot after), umount /boottemp  remount the proper partition on /boot and rerun

    pacman -S linux
    grub-mkconfig -o /boot/grub/grub.cfg

    and keep the fstab entry

Offline

#5 2019-09-20 12:51:43

eridanus
Member
Registered: 2019-09-20
Posts: 4

Re: Arch is unbootable after each kernel update

The first option looks more preferable due to my tree /boot output, am I right?
And what is the exact reason of the OS crashes after the kernel updates that happened to me? Why I can boot now and cannot boot after kernel update?

Offline

#6 2019-09-20 13:07:03

loqs
Member
Registered: 2014-03-06
Posts: 9,080

Re: Arch is unbootable after each kernel update

Kernel modules are version specific.  The kernel will not load a module built for another version.
When you updated the linux package the modules for the kernel were updated but the kernel itself on /boot was not.
So the old kernel could not use the new modules.

Last edited by loqs (2019-09-20 13:08:12)

Offline

#7 2019-09-20 13:18:23

eridanus
Member
Registered: 2019-09-20
Posts: 4

Re: Arch is unbootable after each kernel update

V1del wrote:

Alright now, by logic of how it is set up now your GRUB configuration and the kernel image is from the /boot directory (on your root partition, not the ESP) and the GRUB that is launched is on your EFI partition. What you do here depends on what you want:

  • Keep the kernel images on the root parition and only load GRUB from the EFI partition -> if that is the case you will want to remove (or comment out) the /boot entry from your fstab (or switch it to a non conflicting path like) /efi and umount /boot (after which you will miracoulously notice the /boot directory of your root partition, containing both the relevant kernel images and your grub configuration.

  • If you actually want your kernel images on the ESP and not on your root partition umount /boot (and/or mount it at some temp location like /boottemp),remove your /boot directory on the root partition (or move over all the files to /boottemp, remove /boot after), umount /boottemp  remount the proper partition on /boot and rerun

    pacman -S linux
    grub-mkconfig -o /boot/grub/grub.cfg

    and keep the fstab entry

I chose the first option. For now my boot partition (/dev/sdb1) is not mounted on anything. Should I do something with it or in this occasion it is okay?
If yes, can I simply remove my boot partition? As I understood, the OS will boot from /boot/efi and according to my current settings I don't need a boot partition at all. Or I'm missing something?

Last edited by eridanus (2019-09-20 13:47:21)

Offline

Board footer

Powered by FluxBB