I borked my kernel - attempted to go from 5.10 to 4.19 (accidently deleted active 5.10)

While troubleshooting a different graphical issue (Battlefield 1 Steam-Proton DirectX Error) I had a remembery that I had to go back to 4.19 and disable wayland the last time I played BF1 to get it to work. I’ve since gone back to 5.10 and never did turn wayland back on as I read there is still some ironing out that needs to happen there. Anyway - enough back story. I cannot inxi because I cannot get a login screen right now, but the most recent inxi (from last night) is in the link above.

So this morning, I thought, well what the hell? Why don’t I try 4.19 again, it worked last time! So I:

  1. went to Manjaro settings/kernel
  2. installed 4.19
  3. rebooted
  4. went back to manjaro settings/kernel
  5. removed 5.10
  6. rebooted
  7. saw pretty flashing caps and scroll lock lights and computer bloops now after LUKs password.

What I have tried since:

  1. Yelling at my computer “NOT AGAIN!” (I think I had to use grub recovery last time I tried to go backwards too, but I cannot recall what the solution was. Something about redoing my 4.19 installation and redoing the amdgpu I think got it working, but I don’t know how to do this. My friend was visiting and helped.)
  2. I am unable to see any terminal errors because I see my stupid motherboard logo instead of useful information since the last couple of years with both manjaro and debian 10.
  3. I can press ctrl-shift-f5 to get a grub menu after the LUKs password.
  4. using ‘fallback’ 4.19 didn’t work.

Help would be appreciated greatly. I’m clearly not changing the kernel in the fashion that was intended so maybe someone can also tell me how I’m supposed to do it next time ?

So you just want to get kernel 5.10 back but can’t tty? Do you have a live usb? You should be able to use chroot to install your kernel. I’m guessing you don’t have a timeshift backup to restore

1 Like

Thanks for the reply. These are all valid questions.

  1. I’m wanting to boot with the 4.19 kernel just to see if it will fix my problem, I can re-install 5.10 later if the manjaro settings/kernel tool doesn’t screw it up again? It seems it always upgrades fine, but doesn’t like going backwards, or I’m just doing something inherently wrong.
  2. I can make another manjaro usblive with this debian 10 machine and dd

Will chroot allow me to fix my 4.19 kernel that seems to have not installed correctly with the provided manjaro tools? I’d like a step by step tutorial link to feel comfortable to attempt this if possible. I’m comfortable with the terminal, but not very practiced with it.

I don’t have a timeshift backup to restore, as you can see in my inxi’s im kinda cramped for ssd and hdd space with >70% filled on 5tb of storage. Games are very big these days! I should and could probably put a dd of my / partition on a thumb drive i guess.

There’s an excellent guide on using manjaro chroot in the manjaro wiki, it’s saved my bacon in the past. You should be able to use it to install both kernels and update your system

You can use any distro or even windows to create a live usb of manjaro.

There’s a lot more knowledgeable people than me on these forums, hopefully someone else will chime in if you get stuck

With timeshift your only supposed to back up your system not your home folder so it shouldn’t be very big and can be stored on a USB/external drive

1 Like

$ sudo manjaro-chroot -a returns:

Error: No linux partitions detected! 

this is after i mounted and unlocked the LUKs partition on the liveusb manjaro

edit: after reading my own error:

$ sudo su
    # manjaro-chroot /run/media/manjaro/7ac3a3a5-4e73-430c...
sh-5.1# 
sh-5.1# mhwd-kernel -i linux419 rmc
:: Synchronizing package databases...
 core                                  168.7 KiB   380 KiB/s 00:00 [#####################################] 100%
 extra                                1905.5 KiB  7.75 MiB/s 00:00 [#####################################] 100%
 community                               6.6 MiB  32.8 MiB/s 00:00 [#####################################] 100%
 multilib                              177.6 KiB  3.04 MiB/s 00:00 [#####################################] 100%
error: no targets specified (use -h for help)

Error: 'rmc' aborted because the kernel failed to install or canceled on removal.

sh-5.1# cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a device; this may
    # be used with UUID= as a more robust way to name devices that works even if
    # disks are added and removed. See fstab(5).
    #
    # <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=EDCE-8D3A                            /boot/efi      vfat    umask=0077 0 2
/dev/mapper/luks-4538d332-dff3-43e9-bd6e-70fbdd0e1758 /              ext4    defaults,noatime 0 1

Like I said I’m certainly no expert and there’s far more knowledgeable people than me. Did you follow this guide and mount your file system? You’ll also need an active Internet connection

https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader#Use_mhwd-chroot

1 Like

Thanks @sawdoctor I’ll wait for more help from someone else!

this is done from the usblive manjaro terminal emulater after # manjaro-chroot

sh-5.1# mhwd-kernel -i linux510
Error: You can't reinstall your current kernel. Please use 'pacman -Syu' instead to update.
sh-5.1# pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
warning: gnome-wallpapers: local (20201023-1) is newer than community (20201020-1)
warning: sndio: local (20180120-1) is newer than community (1.7.0-3)
 there is nothing to do
sh-5.1# mhwd-kernel -l         
available kernels:
   * linux414
   * linux419
   * linux44
   * linux49
   * linux510
   * linux512
   * linux513
   * linux514
   * linux54
sh-5.1# mhwd-kernel -ls
Error: Invalid argument (use -h for help).
sh-5.1# mhwd-kernel -li
Currently running: 5.10.42-1-MANJARO (linux510)
The following kernels are installed in your system:
   * linux419
sh-5.1# mhwd-kernel -i linux512 rmc
:: Synchronizing package databases...
 core                                  168.7 KiB   399 KiB/s 00:00 [#####################################] 100%
 extra                                1905.5 KiB  7.99 MiB/s 00:00 [#####################################] 100%
 community                               6.6 MiB  34.0 MiB/s 00:00 [#####################################] 100%
 multilib                              177.6 KiB  2.89 MiB/s 00:00 [#####################################] 100%
error: no targets specified (use -h for help)

Error: 'rmc' aborted because the kernel failed to install or canceled on removal.
sh-5.1#

It appears i need to specify where to install the kernel? I’m thinking it’s because i have not mounted /boot or /efi - or something like that, but I’m really not sure - so this is where im stuck now.

sh-5.1# pacman -Syu grub
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
warning: grub-2.06-1 is up to date -- reinstalling
:: Starting full system upgrade...
warning: gnome-wallpapers: local (20201023-1) is newer than community (20201020-1)
warning: sndio: local (20180120-1) is newer than community (1.7.0-3)
resolving dependencies...
looking for conflicting packages...

Packages (1) grub-2.06-1

Total Installed Size:  47.85 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 grub-2.06-1-x86_64 is up to date
(1/1) checking keys in keyring                                     [#####################################] 100%
(1/1) checking package integrity                                   [#####################################] 100%
(1/1) loading package files                                        [#####################################] 100%
(1/1) checking for file conflicts                                  [#####################################] 100%
(1/1) checking available disk space                                [#####################################] 100%
:: Processing package changes...
(1/1) reinstalling grub                                            [#####################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the info directory file...
sh-5.1# grub-install --force --target=i386-pc --recheck --boot-directory=/boot /dev/nvme0n1                   
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for RAID and LVM install.

This is due to my LUKs encrypted drive?

Tip: When pasting terminal output on Discourse forums, one can either…

  • Highlight it and use the Preformatted text </> toolbar button.

  • Add three backticks ` above and below the text (Markdown):

    ```
    text
    ```

  • Use HTML:

    <pre><code>
    text
    </pre></code>

I’ve done it for you this time. :wink:

1 Like

Thanks - I had tried and it says “place 4 spaces in front” = i couldn’t get it to work - maybe umatrix blocking it? idk it’s working now though :slight_smile:

sh-5.1# lsblk 
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                                           7:0    0  76.4M  1 loop  
loop1                                           7:1    0 388.6M  1 loop  
loop2                                           7:2    0   1.5G  1 loop  
loop3                                           7:3    0 731.7M  1 loop  
sda                                             8:0    0   3.6T  0 disk  
`-sda1                                          8:1    0   3.6T  0 part  
sdb                                             8:16   1   7.2G  0 disk  
|-sdb1                                          8:17   1   2.7G  0 part  
`-sdb2                                          8:18   1     4M  0 part  
sdc                                             8:32   0   7.3T  0 disk  
|-sdc1                                          8:33   0   7.2T  0 part  
`-sdc2                                          8:34   0  74.5G  0 part  
nvme0n1                                       259:0    0 931.5G  0 disk  
|-nvme0n1p1                                   259:1    0   300M  0 part  
`-nvme0n1p2                                   259:2    0 931.2G  0 part  
  `-luks-4538d332-dff3-43e9-bd6e-70fbdd0e1758 254:0    0 931.2G  0 crypt /

That’s exactly what the Preformatted text </> button does. :wink:

I fixed my bootloader /grub issue and am back to the system boot loop after entering my LUKs password. After entering the password the screen says

Slot 0 opened

Then my keyboard caps and scroll light flash 72 times rapidly before the machine reboots itself.

I used Debian’s “rescue graphical” on their liveusb. After unlocking my encrypted drive, selecting the root partition and the master boot record by selecting the device nvme0n1, (not the partition) at the “reinstall grub” action, it booted as before. Now back to figuring out how to fix or reinstall the kernel.

  1. I unlocked the disk in the file manager.
  2. I opened disks and read where the unlocked device symlink is.
  3. I did what’s listed below in the terminal
    sudo mount /dev/mapper/luks-4538d332-dff3-43e9-bd6e-70fbdd0e1758 /mnt                                                                    ✔ 
        ~  sudo chroot /mnt /bin/bash                                                                                                               ✔ 
    [manjaro-gnome /]# sudo pacman -S linux419
    warning: linux419-4.19.198-1 is up to date -- reinstalling
    resolving dependencies...
    looking for conflicting packages...

    Packages (1) linux419-4.19.198-1

    Total Installed Size:  69.38 MiB
    Net Upgrade Size:       0.00 MiB

    :: Proceed with installation? [Y/n] y
    (1/1) checking keys in keyring                                                              [#####################################################] 100%
    (1/1) checking package integrity                                                            [#####################################################] 100%
    (1/1) loading package files                                                                 [#####################################################] 100%
    (1/1) checking for file conflicts                                                           [#####################################################] 100%
    error: could not open file: /etc/mtab: No such file or directory
    error: could not determine filesystem mount points
    error: not enough free disk space
    error: failed to commit transaction (unexpected error)
    Errors occurred, no packages were upgraded.
    [manjaro-gnome /]#
  1. I opened /mnt in my file manager and found mtab. mtab is a symlink and says this:

Screenshot from 2021-07-29 05-19-02

‘’’
[manjaro-gnome /]# sudo mkinitcpio -p linux419
==> ERROR: /proc must be mounted!
‘’’

Also, I figured out what I did wrong the first time. I didn’t force open the grub selection menu on my reboot after installing 4.19, so unbeknownst to me, it started 5.10 by default and I deleted my active kernel. Is this recoverable?

Help?

just found this and tried it. going to reboot now

I still had the original error I started this forum post with after my reboot.

I edited the boot grub options after learning how to edit the kernel options by removing quiet and adding nosplash debug loglevel=7 rd.systemd.show_status=auto rd.udev.log_level=7.

I would not recommend this to anyone - holy crap did my screen get spammed!

I pressed F10 to boot my temporary changes. It still boot looped and I didn’t have time to see what all the errors were. I rebooted into the liveusb manjaro. I mounted the encrypted drive and chroot into it. Then I read the system journal. I saw a lot of errors and warnings about both x-org related things and mesa/amd/vega56 errors (my graphics card)

I also didn’t get an error while trying to mount the /dev/nvme0n1p1 /boot/efi which I had been getting in the past (you might see in the other posts). I was also wondering if I just needed to re-install the kernel that I accidentally deleted instead of trying to switch to 4.19 as the first person ‘asked/suggested’ here. Having learned that I had accidentally deleted my active 510 kernel I decided to try all this;

on the Manjaro liveusb:

su
cryptsetup open --type luks /dev/nvme0n1p2 crypto_LUKS
mount /dev/mapper/crypto_LUKS /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
manjaro-chroot /mnt

in the chroot: #

pacman -Syyu linux510
pacman -R amdgpu-experimental
pacman -Syyu video-linux
pacman -Syyu xorg-server

This solved the problem. because i did 5 different things on this attempt to fix it, I’m not sure which actually solved it. I had to remove amdgpu-experimental because re-installing video-linux broke it’s dependency. If I had to guess, installing 510 and re-installing the xorg-server probably would have solved it.

While this was an error of simply not selecting my newly installed kernel in the grub menu. I was never presented a grub menu since this install of manjaro. I think that the default installation of manjaro should at least add a 3-5 second timeout before auto selecting a default. I didn’t know how to even get the grub menu after my luks partition was mounted… I spammed a bunch of keys, and i think tab or esc seems to get me the menu? also ctrl shift f5 did before? idk I’ll have to read about which is actually actually supposed to achieve the grub menu after luks password.

As a side note, while it says 4.19 is installed in the kernel section of manjaro settings, I’m unable to remove it because it says there’s a dependency not met. I’m going to try re-installing it and removing it again via the terminal and pacman and see what happens.

Oh well - I have a functioning system again - and thanks to all the wiki articles and a bit more patience I did get it working finally. Thanks for those folks who did all these wikis in manjaro and arch! I’ve edited this solution to try and make it more useful if someone else needs it.

1 Like

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