Cannot switch kernel: errors "out of memory" and "you need to load the kernel first"

I’ve been using Manjaro for a while now and have often updated the kernel and changed it in order to fix things.
Because of this post I now wanted to switch to 5.10 (currently 4.19), however, I cannot switch to any kernel at the moment, which is new. I previously used 5.4, but had system-freeze issues, so I kept using 4.19. I prefer using LTS kernels because I’m not very experienced with Linux, especially not on kernel level.
Upon selecting a different kernel than 4.19 (tried 5.10, which I newly installed, and 5.4, which previously worked) in grub, two errors are issued:

error: out of memory
error: you need to load the kernel first

I could not find anything about the combination of these errors on the internet and on this forum – I hope I did not overlook something! Please excuse if I did …
My system info:

    System:
      Host: fredder-pc Kernel: 4.19.183-1-MANJARO x86_64 bits: 64 
      Desktop: Xfce 4.16.0 Distro: Manjaro Linux 
    Machine:
      Type: Convertible System: LENOVO product: 80X6 v: Lenovo YOGA 720-13IKB 
      serial: <superuser required> 
      Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN 
      serial: <superuser required> UEFI: LENOVO v: 1YCN36WW(V2.03) 
      date: 09/11/2017 
    Battery:
      ID-1: BAT1 charge: 38.5 Wh (99.7%) condition: 38.6/48.0 Wh (80.4%) 
    CPU:
      Info: Dual Core model: Intel Core i7-7500U bits: 64 type: MT MCP cache: 
      L2: 4 MiB 
      Speed: 2208 MHz min/max: 400/3500 MHz Core speeds (MHz): 1: 2208 2: 3299 
      3: 2455 4: 2278 
    Graphics:
      Device-1: Intel HD Graphics 620 driver: i915 v: kernel 
      Device-2: IMC Networks EasyCamera type: USB driver: uvcvideo 
      Display: x11 server: X.Org 1.20.10 driver: loaded: intel 
      unloaded: modesetting resolution: 1920x1080~60Hz 
      OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.1 
    Audio:
      Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel 
      Sound Server-1: ALSA v: k4.19.183-1-MANJARO running: yes 
      Sound Server-2: PulseAudio v: 14.2 running: yes 
    Network:
      Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi 
      IF: wlp63s0 state: up mac: f8:59:71:2a:a9:ae 
    Bluetooth:
      Device-1: Intel Bluetooth wireless interface type: USB driver: btusb 
      Report: This feature requires one of these tools: hciconfig/bt-adapter 
    Drives:
      Local Storage: total: 238.47 GiB used: 121.46 GiB (50.9%) 
      ID-1: /dev/nvme0n1 vendor: Toshiba model: N/A size: 238.47 GiB 
    Partition:
      ID-1: / size: 146.87 GiB used: 121.43 GiB (82.7%) fs: ext4 
      dev: /dev/nvme0n1p6 
      ID-2: /boot/efi size: 256 MiB used: 30.9 MiB (12.1%) fs: vfat 
      dev: /dev/nvme0n1p1 
    Swap:
      ID-1: swap-1 type: partition size: 15.71 GiB used: 0 KiB (0.0%) 
      dev: /dev/nvme0n1p7 
    Sensors:
      System Temperatures: cpu: 45.0 C mobo: N/A 
      Fan Speeds (RPM): N/A 
    Info:
      Processes: 211 Uptime: 30m Memory: 7.52 GiB used: 3.23 GiB (43.0%) 
      Shell: Bash inxi: 3.3.03 

/etc/default/grub:

    GRUB_DEFAULT=saved
    GRUB_TIMEOUT=1
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_DISTRIBUTOR='Manjaro'
    GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=207af92b-a410-4529-a76b-490aaa74df72 udev.log_priority=3"
    GRUB_CMDLINE_LINUX=""

    # If you want to enable the save default function, uncomment the following
    # line, and set GRUB_DEFAULT to saved.
    GRUB_SAVEDEFAULT=true

    # 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

    # 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 'videoinfo'
    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-gray/black"
    GRUB_COLOR_HIGHLIGHT="green/black"

    # Uncomment one of them for the gfx desired, a image background or a gfxtheme
    #GRUB_BACKGROUND="/usr/share/grub/background.png"
    GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

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

    # Set to false because grub was gone for some reason
    GRUB_DISABLE_OS_PROBER=false

mhwd-kernel -li:

    Currently running: 4.19.183-1-MANJARO (linux419)
    The following kernels are installed in your system:
       * linux419
       * linux510

sudo update-grub:

    Generating grub configuration file ...
    Found theme: /usr/share/grub/themes/manjaro/theme.txt
    Found linux image: /boot/vmlinuz-5.10-x86_64
    Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
    Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
    Found linux image: /boot/vmlinuz-4.19-x86_64
    Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-x86_64.img
    Found initrd fallback image: /boot/initramfs-4.19-x86_64-fallback.img
    Warning: os-prober will be executed to detect other bootable partitions.
    It's output will be used to detect bootable binaries on them and create new boot entries.
    Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
    Found Manjaro Linux (21.0.1) on /dev/nvme0n1p6
    Adding boot menu entry for UEFI Firmware Settings ...
    Found memtest86+ image: /boot/memtest86+/memtest.bin
    /usr/bin/grub-probe: warning: unknown device type nvme0n1.
    done

lsblk -f:

    NAME        FSTYPE   FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINT
    loop0       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/snapd/11588
    loop1       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/core18/1988
    loop2       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/gtk-common-themes/1513
    loop3       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/core18/1997
    loop4       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/snapd/11402
    loop5       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/gnome-3-28-1804/145
    loop6       squashfs 4.0                                                         0   100% /var/lib/snapd/snap/gtk-common-themes/1514
    nvme0n1                                                                                   
    ├─nvme0n1p1 vfat     FAT32 SYSTEM_DRV B8EC-990F                             225.1M    12% /boot/efi
    ├─nvme0n1p2                                                                               
    ├─nvme0n1p3 ntfs           Windows    1ADAED6EDAED469B                                    
    ├─nvme0n1p4 ntfs           LENOVO     CA8E07C68E07AA51                                    
    ├─nvme0n1p5 ntfs           WINRE_DRV  D2F2EF30F2EF180D                                    
    ├─nvme0n1p6 ext4     1.0              72ff51c6-0fc0-406c-9422-c09c3892d71d   17.9G    83% /run/timeshift/backup
    └─nvme0n1p7 swap     1                207af92b-a410-4529-a76b-490aaa74df72                [SWAP]

Any more info to provide?
What does “out of memory” refer to? I don’t see where this lack of free space is supposed to be.

As mentioned above, I want to switch to 5.10 because snaps currently don’t work on 4.19. This is because I want to use a specific snap package; I previously didn’t have any installed. Could the failed snap package install have to do with this? In the lsblk output above, the loopX entries are new to me, I guess they are connected to the (failed) snap package install?

Thank you in advance!

Could be related to this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1842320

Change GRUB_GFXMODE=auto for example to GRUB_GFXMODE=800x600.

OR

Add this GRUB_DISABLE_SUBMENU=y.

Otherwise it could be also possible, that the 5.10 image is just too big…

Use a better compression at /etc/mkinitcpio.conf like this:

COMPRESSION="xz"
COMPRESSION_OPTIONS=(-T0)

and

sudo mkinitcpio -P

Best regards :wink:

Thanks! Unfortunately, none of these suggestions fixed it.
Both grub config changes had their effect, but didn’t help. sudo mkinitcpio -P's output also looked like it did the compression.

Too big for what? Do I need to tidy up somewhere?

That was only my intention, but it seems this error is grub and UEFI related somehow…

Did you try reinstalling grub completely? grub-install and update-grub
https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader

Can you boot with the fallback image ?

No, using the 5.10 fallback image results in the same error. 4.19 fallback works.

No. The article you linked to scares me a bit. There is too much I don’t even remotely understand, and changing stuff with grub without exactly knowing what I’m doing sounds uncomfortable … I don’t want to end up with a non-booting machine.
I’m afraid that article is too advanced for me. I’m not even sure where I am supposed to execute the commands listed in the wiki article: Using a USB-booted OS?

I’m willing to try it (I would need a few questions answered before), but rather as a last resort. Do you maybe have another idea?

Or is reinstalling grub not as much a big deal as I think it is?

It is not a big deal. It just recreates the efi files and the menu as i know and does also a self check.

If you have installed manjaro in efi mode then this works:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
sudo update-grub

There is no need to boot a ISO if you have access to your local installation.

Thanks for the explanation! grub-install and update-grub ran without errors.
However, still the same error on 5.10 boot attempt. :no_mouth: Damn!

I would try to manjaro-chroot into your system from a LIVE ISO boot and then within the chroot environment enter

pacman -S linux510 linux510-headers 
mkinitcpio -P 
update-grub
exit

and reboot.

Uh … I can’t boot using a live medium because:

error: out of memory
error: you need to load the kernel first

Wtf did I break? :expressionless:

Have you switched off Secure boot and Fast boot in your firmware?

Fast boot was enabled at first, switched it off after your comment, but that didn’t fix it.
I don’t see an option for secure boot. These are my BIOS settings at the moment:


The USB device is the live ISO.

Anything relevant?

Bump – problem still persists. Does anybody have any more suggestions?
Without being able to boot a live iso, I could not even reinstall my system, could I? (Not that I would want to reinstall everything right now, but I need this possibility …)

When shutting down, I see these errors:

sd-umount[5741]: Failed to unmount /oldroot: Device or resource busy
sd-umount[5741]: Failed to unmount 22: No such file or directory
shutdown[1]: Failed to finalize file systems, ignoring.

This seems to be a known thing that I can just ignore (Failed to mount oldroot: Device or resource busy).
Could it have something to do with my kernel issue here?

I tinkered a bit more with my firmware settings and could finally fix it:

Under Boot Mode I can select UEFI and Legacy Support. With UEFI, I can now boot any kernel. I wonder what caused this setting to have this effect – it worked with Legacy Support before and I didn’t change it.

Thank you for your time, @megavolt & @Wollie!
In the course of trying to fix this, I even updated my firmware version, which completely broke the bootloader, removing Manjaro from the list of bootable OSs – that was scary, but thanks to you, I already knew how to reinstall grub!

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