You are not logged in.

#1 2025-08-17 19:34:45

xnand
Member
Registered: 2016-07-28
Posts: 11

LUKS + GPT Auto-mounting partitions + UKI: root partition not mounted

Hi there,

On a fresh install, I followed the wiki under LUKS on a partition with TPM2 and Secure Boot to have LUKS on the root partition, UKI image, and auto-mounting of the necessary partition via systemd.
My system however won't boot. After loading the UKI EFI file (/boot/EFI/Linux/arch-linux.efi), it fails to find and mount the root partition, eventually displaying "Timed out waiting for device /dev/gpt-auto-root".

A few commands from inside the arch-chrooted environment from the Arch USB are below.

Root partition is on /dev/nvme0n1p5 (LUKS encrypted); ESP is on /dev/nvme0n1p1. The other partitions are an existing Windows 11 installation. Fdisk shows the correct partition type for the root fs (Linux root (x86-64), code 8304):

[root@archiso Linux]# fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: CT4000P3PSSD8                           
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0CBF0CE0-581D-403E-848F-926D1C1BFBDA

Device              Start        End    Sectors  Size Type
/dev/nvme0n1p1       2048    8390655    8388608    4G EFI System
/dev/nvme0n1p2    8390656 3905685503 3897294848  1.8T Microsoft basic data
/dev/nvme0n1p3 3905685504 3907016703    1331200  650M Windows recovery environment
/dev/nvme0n1p4 3907018752 3907051519      32768   16M Microsoft reserved
/dev/nvme0n1p5 3907051520 7814035455 3906983936  1.8T Linux root (x86-64)

initcpio hooks (no other modifications in this file):

[root@archiso Linux]# cat /etc/mkinitcpio.conf | grep '^HOOKS'
HOOKS=(base systemd udev autodetect microcode modconf kms keyboard block sd-encrypt filesystems fsck)

Content of ESP (the EFI system partition is mounted on /boot - this directory is empty when not mounted. systemd-boot related files are not relevant since I'm booting up /boot/EFI/Linux/arch-linux.efi directly):

[root@archiso boot]# tree
.
├── EFI
│   ├── Boot
│   │   └── bootx64.efi
│   ├── Linux
│   │   ├── arch-linux-fallback.efi
│   │   └── arch-linux.efi
│   ├── Microsoft
│   │   ├── Boot
│   │   │   ├── BCD
│   │   │   ├── BCD.LOG
│   │   │   ├── BCD.LOG1
│   │   │   ├── BCD.LOG2
│   │   │   ├── BOOTSTAT.DAT
│   │   │   ├── CIPolicies
│   │   │   │   └── Active
│   │   │   │       ├── {5DAC656C-21AD-4A02-AB49-649917162E70}.cip
│   │   │   │       ├── {82443e1e-8a39-4b4a-96a8-f40ddc00b9f3}.cip
│   │   │   │       └── {CDD5CB55-DB68-4D71-AA38-3DF2B6473A52}.cip
│   │   │   ├── Fonts

[SNIPPED font files]

│   │   │   ├── Resources
│   │   │   │   ├── bootres.dll
│   │   │   │   └── en-US
│   │   │   │       └── bootres.dll.mui
│   │   │   ├── SecureBootRecovery.efi
│   │   │   ├── bg-BG
│   │   │   │   ├── bootmgfw.efi.mui
│   │   │   │   └── bootmgr.efi.mui
│   │   │   ├── boot.pnd.stl
│   │   │   ├── boot.stl
│   │   │   ├── bootmgfw.efi
│   │   │   ├── bootmgr.efi

[SNIPPED a bunch of locale .mui files]

│   │   └── Recovery
│   │       ├── BCD
│   │       ├── BCD.LOG
│   │       ├── BCD.LOG1
│   │       └── BCD.LOG2
│   └── systemd
│       └── systemd-bootx64.efi
├── System Volume Information
├── intel-ucode.img
├── loader
│   ├── entries
│   ├── entries.srel
│   ├── keys
│   ├── loader.conf
│   └── random-seed
└── vmlinuz-linux

Kernel cmdline:

[root@archiso cmdline.d]# pwd               
/etc/cmdline.d
[root@archiso cmdline.d]# ls -la
total 12
drwxr-xr-x  2 root root 4096 Aug 17 16:47 .
drwxr-xr-x 46 root root 4096 Aug 17 18:28 ..
-rw-r--r--  1 root root   16 Aug 17 16:47 root.conf
[root@archiso cmdline.d]# cat root.conf 
rw bgrt_disable

initcpio preset:

[root@archiso cmdline.d]# cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
#default_image="/boot/initramfs-linux.img"
default_uki="/boot/EFI/Linux/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
#fallback_image="/boot/initramfs-linux-fallback.img"
fallback_uki="/boot/EFI/Linux/arch-linux-fallback.efi"
fallback_options="-S autodetect"

Bootctl:

System:
Not booted with EFI

Available Boot Loaders on ESP:
          ESP: /boot
         File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot 257.8-2-arch)
               └─/EFI/BOOT/bootx64.efi (systemd-boot 257.8-2-arch)

Boot Loader Entries:
        $BOOT: /boot
        token: arch

Default Boot Loader Entry:
         type: Boot Loader Specification Type #2 (.efi)
        title: Arch Linux (6.16.1-arch1-1)
           id: arch-linux.efi
       source: /boot//EFI/Linux/arch-linux.efi (on the EFI System Partition)
     sort-key: arch
      version: 6.16.1-arch1-1
        linux: /boot//EFI/Linux/arch-linux.efi
      options: rw bgrt_disable

efibootmgr:

[root@archiso cmdline.d]# efibootmgr 
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0004
Boot0000* Windows Boot Manager	HD(1,GPT,017a9624-8697-44c6-ad4f-213c3cfe33d0,0x800,0x800000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0001* Windows Boot Manager	HD(1,GPT,069a6cc0-8641-4800-9b95-21e450cf0ff8,0x800,0x32000)/\EFI\Microsoft\Boot\bootmgfw.efi0000424f
Boot0002* Arch Linux	HD(1,GPT,017a9624-8697-44c6-ad4f-213c3cfe33d0,0x800,0x800000)/\EFI\Linux\arch-linux.efi
Boot0004* UEFI:  USB, Partition 1	PciRoot(0x0)/Pci(0x14,0x0)/USB(25,0)/HD(1,MBR,0xdadb6ea4,0x2000,0xe530000)0000424f

Since I want gpt-auto-root to do its job, I haven't defined any further kernel command-line options, nor any entry in /etc/fstab:

[root@archiso cmdline.d]# cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>

I have the same setup (without the Windows 11 install) on another laptop, which I set up a few months ago, and I've been comparing files and options but can't find any difference.
Secure boot is also disabled for the moment.
The only thing I could think of is that perhaps the LoaderDevicePartUUID EFI variable is not populated, but I have no way of verifying this from the live USB, as far as I know.
I must have missed something, does anyone have any idea?

Offline

#2 2025-08-18 17:21:03

swsnr
Member
Registered: 2024-01-21
Posts: 26

Re: LUKS + GPT Auto-mounting partitions + UKI: root partition not mounted

I understand you're directly booting into the UKI?  If so try to boot with systemd-boot: systemd-gpt-auto-generator needs a boot loader to set the EFI variable LoaderDevicePartUUID to the partition GUID of the EFI partition, in order to identify the disk the system is being booted from.  If you're directly booting into a UKI, there's no bootloader to set this variable, and I doubt that systemd-stub sets it by itself.  Consequently the generator does not not know which disk to probe auto-discovery, and fails to mount the root disk, so the boot process ultimately times out waiting for the root device.

Offline

Board footer

Powered by FluxBB