Unable to boot a LUKS encrypted drive as NVMe, but ok as USB external disk


I’m trying to move a LUKS-encrypted NVMe disk to a new computer. I’m running an i3mw Manjaro with the encryption setup during the installation process (default one).

I’m unfortunately unable to boot from this disk when the disk is inside the new laptop (connected with NVMe). But, if I connect the disk to a USB-C NVMe adapter and boot from the USB disk, there is no issue.

What should I change / edit, to be able to boot from this disk when it is connected internally?

The old Laptop was a Dell Latitude 5400, the new one is an HP EliteBook 1030 G4. It’s using the UEFI boot (not Legacy).

This is what I get when the disk is plugged into the NVMe slot (internally). Unfortunately, in this Grub Rescue Mode, I don’t have access to much information

Enter passphrase for hd0,gpt2 (879689be-84d7-4eb1-a134-d74897347264) :
Attempting to decrypt master key...
error: failure reading sector 0x97040 from 'hdo'.
error: disk 'cryptouuid/875689e81074e614134879897347264' not found.
Entering rescue mode...
grub rescue > 
grub rescue > cryptomount -a 
error: failure reading sector 0x0 from 'hdo'
grub rescue> cryptomount -a -b 
grub rescue > insmod normal
error: disk cruptouuid/879689be84474eb/a134474897347264' not found.
grub rescue > ls
(proc) (hd0)
grub rescue> ls (hd0))
error: failure reading sector 0x2 from 'hdo'
grub rescue> ls (proc)
(proc) : Filesystem is procfs.
grub rescue> ls (proc))
grub rescue>

I tried this solution using sudo mkinitcpio -P, but unsuccessfully:

This is the information I extracted from the HP after booting from the USB-C adapter :

❯ cat /etc/fstab
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=78D9-5343                            /boot/efi      vfat    umask=0077 0 2
/dev/mapper/luks-879689be-84d7-4eb1-a134-d74897347264 /              ext4    defaults,noatime 0 1
/swapfile                                 swap           swap    defaults,noatime 0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
❯ lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                                             8:0    0 931.5G  0 disk  
├─sda1                                          8:1    0   300M  0 part  /boot/efi
└─sda2                                          8:2    0 931.2G  0 part  
  └─luks-879689be-84d7-4eb1-a134-d74897347264 254:0    0 931.2G  0 crypt /

Details from my machine (boot from USB)

❯ inxi -v7azy
  Kernel: 6.5.13-7-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc avail: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64
    root=UUID=8bf163f4-80a5-45a3-bf21-0edd7eed2217 rw
    root=/dev/mapper/luks-879689be-84d7-4eb1-a134-d74897347264 apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: i3 v: 4.23 with: i3bar tools: xautolock avail: i3lock vt: 7
    dm: LightDM v: 1.32.0 Distro: Manjaro base: Arch Linux
  Type: Convertible System: HP product: HP EliteBook x360 1030 G4 v: N/A
    serial: <superuser required> Chassis: type: 31 serial: <superuser required>
  Mobo: HP model: 8637 v: KBC Version 68.32.00 serial: <superuser required>
    part-nu: 6MJ73AV uuid: <superuser required> UEFI: HP v: R94 Ver. 01.12.00
    date: 01/10/2022
  Message: No logical block device data found.
  Device-1: luks-879689be-84d7-4eb1-a134-d74897347264 maj-min: 254:0
    type: LUKS dm: dm-0 size: 931.21 GiB
  p-1: sda2 maj-min: 8:2 size: 931.22 GiB
  Message: No RAID data found.
  Local Storage: total: 931.51 GiB used: 797.17 GiB (85.6%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: PNY model: CS30 30 1000GB SS
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B type: USB
    rev: 3.2 spd: 10 Gb/s lanes: 1 mode: 3.2 gen-2x1 tech: N/A serial: <filter>
    fw-rev: 3106 scheme: GPT
  Message: No optical or floppy data found.
  ID-1: / raw-size: 931.21 GiB size: 915.52 GiB (98.32%)
    used: 796.14 GiB (87.0%) fs: ext4 dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-879689be-84d7-4eb1-a134-d74897347264 label: N/A
    uuid: 8bf163f4-80a5-45a3-bf21-0edd7eed2217
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 464 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: N/A
    uuid: 78D9-5343
  ID-3: /run/user/1000/keybase/kbfs raw-size: N/A size: 250 GiB
    used: 1.03 GiB (0.4%) fs: fuse dev: /dev/fuse label: N/A uuid: N/A
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
  Message: No unmounted partitions found.
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 1-8:2 info: Synaptics Fingerprint reader [HP G6]
    type: <vendor specific> driver: N/A interfaces: 1 rev: 2.0
    speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 power: 100mA
    chip-ID: 06cb:00b7 class-ID: ff00 serial: <filter>
  Device-2: 1-9:3 info: Quanta HP Full-HD Camera type: video driver: uvcvideo
    interfaces: 4 rev: 2.0 speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0
    power: 500mA chip-ID: 0408:5390 class-ID: 0e02 serial: <filter>
  Device-3: 1-10:4 info: Intel AX200 Bluetooth type: bluetooth driver: btusb
    interfaces: 2 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1
    power: 100mA chip-ID: 8087:0029 class-ID: e001
  Hub-2: 2-0:1 info: super-speed hub ports: 6 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-4: 4-0:1 info: super-speed hub ports: 2 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Device-1: 4-1:2 info: JMicron / USA JMS583Gen 2 to PCIe Gen3x2 Bridge
    type: mass storage driver: uas interfaces: 1 rev: 3.2
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 power: 896mA
    chip-ID: 152d:0583 class-ID: 0806 serial: <filter>

Hello @StalMoul :wink:

Honestly, it looks like NVME is slowly dying, or something on the hardware side.

To clarify, please add this:

sudo nvme smart-log /dev/nvme0n1

Hello @megavolt,

Thank you for your time, you were right, I tried the smartctl command (don’t have the nvme tool) and he didn’t even finished the scan process. The scan may have finally finished him off.
This was super strange, I had the same unlocking LUKS process, working in USB, not internally, tried multiples times.

Just to confirm, if the disk wasn’t corrupted, it should have been possible to swap the disk from a computer to another without issue ?

Anyway, thanks again for your time.
Best regards

Usually it should just boot after swapping the disk. Yes. Probably reinstall grub if possible, but as you said, it died? Well you are in front of it, so you must be sure :man_shrugging: