Can't boot LUKS encrypted install after 2023-03-31 stable update

It derailed so fast so quickly (like in xkcd: Success)

Current problem: I read on Reddit that maybe an erroneous entry in /boot/efi or /boot/grub is causing the “out of range pointer”.

So I deleted (I intended to rename them but moved them both the same location :frowning: ) these folders. (I’m using only one partition for /, home and boot + I’m also using LUKS)

And now grub-install fails: grub-install: error: /boot/efi doesn’t look like an EFI partition. After 20min of googling I found no way to fix this.

Sadly the older BTRFS snapshot does not contain an valid efi.

What can I do?

This were my previous actions:

  • boot into live usb OS
  • cryptsetup luksOpen /dev/nvme0n1p2 my_encypted_device
  • mount -o subvol=@ /dev/mapper/my_encypted_device /mnt
  • manjaro-chroot /mnt /bin/bash

see this

and this

You need to mount your efi partition to /mnt/boot/efi

Can you show us lsblk -f

I was able to boot Manjaro:

  • boot from live usb stick
  • instead of selecting “boot with open source / proprietary drivers” (How to install and run Manjaro Linux - YouTube) I selected “detect EFI bootloaders”
  • there was two .efi files on the same disk. One called system+something and the other Manjaro+something. The system one was broken but the Manjaro one did work

@ stephane I will try this again after I backup some important data :smiley:

@Zesko This is lsblk -f from my now working OS

NAME                                          FSTYPE      FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                                          
|-sda1                                        ntfs                       6230467F304659E5                                    
|-sda2                                        vfat        FAT32          E61E-3D10                                           
|-sda3                                                                                                                       
`-sda4                                        BitLocker   2                                                                  
sdb                                                                                                                          
|-sdb1                                                                                                                       
`-sdb2                                        ntfs              Volume   CAC2B439C2B42B97                                    
sdc                                                                                                                          
|-sdc1                                                                                                                       
`-sdc2                                                                                                                       
  `-veracrypt1                                ntfs                       3ED4C14CD4C1075D                      838.5G    85% /mnt/veracrypt1
sdd                                                                                                                          
|-sdd1                                        exfat       1.0   Ventoy   991D-3E9E                                           
`-sdd2                                        vfat        FAT16 VTOYEFI  B228-8EFB                                           
sr0                                                                                                                          
sr1                                                                                                                          
nvme0n1                                                                                                                      
|-nvme0n1p1                                   vfat        FAT32 NO_LABEL B253-C727                             298.7M     0% /boot/efi
|-nvme0n1p2                                   crypto_LUKS 1              205e4e87-163d-4dae-bd7c-3cda9971fa7f                
| `-luks-205e4e87-163d-4dae-bd7c-3cda9971fa7f btrfs                      e7d503ab-58a1-4148-bbc9-9dccf89b6a20  427.7G    76% /var/log
|                                                                                                                            /home
|                                                                                                                            /var/cache
|                                                                                                                            /
`-nvme0n1p3                                   crypto_LUKS 1              8b452496-c619-4399-b0f5-0e387d52567b                
  `-luks-8b452496-c619-4399-b0f5-0e387d52567b swap        1     swap     a038d7b2-6bad-495b-812e-9e3c33303bf3                [SWAP]

And you are right Zesko - /boot/efi is not an folder, it is the first partition of nvme0n1. I should have figured that out myself.

For you using Grub and Btrfs with encryption

$ cryptsetup luksOpen /dev/nvme0n1p2 my_encypted_device
$ mount /dev/mapper/my_encypted_device -o subvol=@       /mnt
$ mount /dev/nvme0n1p1 /mnt/boot/efi
$ mount /dev/mapper/my_encypted_device -o subvol=@log    /mnt/var/log
$ mount /dev/mapper/my_encypted_device -o subvol=@cache  /mnt/var/cache
$ mount /dev/mapper/my_encypted_device -o subvol=@home   /mnt/home
$ manjaro-chroot /mnt

Then follow:

4 Likes

I did not use cryptsetup + mount + manjaro-chroot because I was able to boot into my OS with some tricks.

update-grub seems to work

But mkinitcpio throws some errors. How can I remove the preset for 6.0? The kernel application and mhwd-kernel do not list it as installed (I think because the kernel was removed) EDIT: I will move /etc/mkinitcpio.d/linux60.present to my desktop

==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux60.preset: 'default'
  -> -k /boot/vmlinuz-6.0-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.0-x86_64.img
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-6.0-x86_64'
==> Building image from preset: /etc/mkinitcpio.d/linux60.preset: 'fallback'
  -> -k /boot/vmlinuz-6.0-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.0-x86_64-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-6.0-x86_64'

But for my current kernel 6.2 there are no errors

==> Building image from preset: /etc/mkinitcpio.d/linux62.preset: 'default'
  -> -k /boot/vmlinuz-6.2-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.2-x86_64.img --microcode /boot/amd-ucode.img
==> Starting build: '6.2.8-1-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: 'qat_4xxx'
  -> Running build hook: [openswap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-6.2-x86_64.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux62.preset: 'fallback'
  -> -k /boot/vmlinuz-6.2-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.2-x86_64-fallback.img -S autodetect --microcode /boot/amd-ucode.img
==> Starting build: '6.2.8-1-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: 'qat_4xxx'
  -> Running build hook: [openswap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-6.2-x86_64-fallback.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful

And grub-install fails too:

Installing for x86_64-efi platform.
grub-install: warning: disk does not exist, so falling back to partition device /dev/nvme0n1p1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/nvme0n1p1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/nvme0n1p1.
grub-install: error: disk `hostdisk//dev/nvme0n1p1' not found.

What can I fix this error?

I’m currently to afraid to reboot just for testing :smiley:

rm /etc/mkinitcpio.d/linux60.preset

Can you show us df -H /boot/efi in chroot?

Can you show us df -H /boot/efi in chroot?

I see - the one website explicitly says “Boot from a rescue disk and reinstall grub from there!”. Give me a sec

@Zesko grub-install have worked in chroot (and I forget to execute and write down the result of df -H /boot/efi - but I think this is no longer necessary). So I guess I have successfully reinstalled grub.

@Zesko Can you fix the typo in sudo mkinicpio -P to sudo mkinitcpio -P for the next person who will execute this command?

The current situation is, that my mainboard detects two possible boot methods.

So my current workaround will be to change the boot order of my mainboard. I will google to check if there is a better solution.

1 Like

I had the same error trying to boot an encrypted system & followed the steps to reinstall Grub. Unfortunately, now I am just in some weird loop where it keeps taking me to the boot menu where all I can do is select my main SSD & it starts all over again.

I am trying to find a solution online but finding it very confusing. I think I need to some how mount my encrypted disk & chroot into it. I’m lost currently! I do have a Timeshift restore point but don’t know how to get to it.

Thanks, Ruziel :slight_smile:

@ruziel Can you

  • create a live Manjaro usb stick? (Normally used to install or test Manjaro). E.g. with Ventoy
  • boot from the USB stick
  • select “Detect EFI bootloaders”
  • and select the /efi/Manjaro/grubx64.efi?

I was able to boot into my normal OS and access my personal files.

But if you want to chroot/reinstall grub, you have to select “Boot with * drivers”.


1 Like

@Tobiwan Thanks! Okay, so I’m into my system. I’m just unsure how to fix my system from here. There seem to be several approaches suggested. When I followed the “sudo mkinitcpio -P” and then updated Grub, that’s when my problems got worse. Before that, I could at least boot into my system. I have a Timeshift restore point. Should I apply that & try the update again? Thanks a lot for your help. Ruziel…

Maybe copy grubx64.efi to the correct location?

sudo -s
cd /boot/efi/EFI
mv boot/bootx64.efi boot/bootx64.efi.backup
cp Manjaro/grubx64.efi boot/bootx64.efi

I will try this - please wait for my confirmation, that this will not break my/your system.

Edit: It works. Copying important system files to other places is madness but hopefully a good enough solution :smiley:

2 Likes

Hey, wow it worked! I’m in! I really appreciate you stepping in to assist. Your name is well chosen.

Does this have any longer-term implications? :slight_smile:

I was a bit nervous installing full encryption on my laptop but need the security - I dunno how often this kind of issue can happen with an update.

Much appreciated. R :slight_smile:

1 Like

Thanks :slight_smile: - It is a give and take - and why should I not return the favour after other users helped me.

I sadly don’t know what the longer-term implications are. Maybe this error will return?

1 Like

Thanks - greatly appreciated. The Force is strong in you. Wishing you a great weekend.

1 Like

Hero of the day !!!
I did encounter some errors while mkinitcpio -P but it worked after all , this was a nasty bug .
Thanks again man !!!

1 Like

I have the exact same issue as cscrt.

I assumed maybe grub got my disks mixed up or something, so at the “error: no such cryptodisk found…” error message, I unplugged my external USB drive. This allowed the system to continue booting to the grub menu, where I selected to fall back to an old kernel (5.19).

So the system is running now but I am afraid to reboot.

I am looking into restoring a Timeshift snapshot to fix this, however other post on this forum indicate that Timeshift does not support restoring of full disk encrypted drives.

Waiting for a solution. This is very. very bad.

Thanks @philm.

I was able to follow the wiki article (after I first fsck’d my LUKS partitions via gnome-disk-utility) until I got to the command grub-mkconfig -o /boot/grub/grub.cfg, at which point I get the following errors:

grub-mkconfig errors
[manjaro /]# grub-mkconfig -o /boot/grub/grub.cfg 
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
ERROR: mkdir /var/lock/dmraid
grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Adding boot menu entry for UEFI Firmware Settings ...
Root filesystem isn't btrfs
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Found memtest86+ image: /boot/memtest86+/memtest.bin
Found memtest86+ EFI image: /boot/memtest86+/memtest.efi
done

 

Here's my `lsblk --fs`:
[manjaro manjaro]# lsblk --fs
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                    0   100% /run/miso/sfs/livefs
loop1
     squash 4.0                                                    0   100% /run/miso/sfs/mhwdfs
loop2
     squash 4.0                                                    0   100% /run/miso/sfs/desktopfs
loop3
     squash 4.0                                                    0   100% /run/miso/sfs/rootfs
sda  iso966 Jolie MANJARO_KDE_2205
                        2023-03-16-12-31-50-00                     0   100% /run/miso/bootmnt
├─sda1
│    iso966 Jolie MANJARO_KDE_2205
│                       2023-03-16-12-31-50-00                              
└─sda2
     vfat   FAT12 MISO_EFI
                        623B-25B9                                           
nvme0n1
                                                                            
├─nvme0n1p1
│    vfat   FAT32       0A2B-F175                             298.9M     0% /mnt/boot/efi
├─nvme0n1p2
│    crypto 1           50e84c44-c88f-4510-b2f7-1ba000eacf58                
│ └─luks-50e84c44-c88f-4510-b2f7-1ba000eacf58
│    ext4   1.0         b7887177-a906-4e57-a1b4-ab61b86ae43f  644.2G    24% /mnt
└─nvme0n1p3
     crypto 1           41345911-b30a-4da7-878b-6c5ca9dd482e                
  └─luks-41345911-b30a-4da7-878b-6c5ca9dd482e
     swap   1     swap  2b0572ca-0ba8-4f27-840c-80fe947365b0                

Same problem afterwards: I enter the password, it says “Slot 0 Opened,” then after a couple seconds, the system powers off, then powers itself back on and goes into the BIOS screen