You are not logged in.

#1 2020-01-27 06:38:22

no-cheating
Member
From: Poland
Registered: 2016-04-26
Posts: 61

[SOLVED] Systemd boot error on installation with encrypted Btrfs root

First time doing encryption and Btrfs

I've already installed Arch decent number of times, but with the installation I'm doing now I've decided to do 2 things (listed below) differently that I've been doing before and I'm having some problems.

  • Use Btrfs filesystem (instead of ext4 I've been always using before)

  • Add encryption to all the system

System information

I'm having dual-boot with Windows with this partition scheme:

$ lsblk -o NAME,FSTYPE,LABEL,PARTLABEL
NAME            FSTYPE      LABEL                PARTLABEL
loop0           squashfs
nvme0n1
|-nvme0n1p1     vfat        esp                  esp
|-nvme0n1p2     ntfs        windows              windows
|-nvme0n1p3     crypto_LUKS arch-linux-encrypted arch-linux-encrypted
  |--arch-linux btrfs       arch-linux

And this is the structure of the btrfs arch-linux partition - 3 subvolumes, for root, home and snapshots:

$ btrfs subvolume list /mnt/btrfs
ID 256 gen 143 top level 5 path root
ID 257 gen 7 top level 5 path home
ID 258 gen 8 top level 5 path snapshots
ID 261 gen 55 top level 256 path var/lib/portables
ID 262 gen 55 top level 256 path var/lib/machines

Arch Linux is installed on root subvolume.

For booting I'm using EFISTUB and I configured the boot entry manually using efibootmgr:

efibootmgr \
  --disk /dev/nvme0n1 \
  --part 1 \
  --create \
  --label "Arch Linux" \
  --loader /EFI/Arch/vmlinuz-linux \
  --unicode "cryptdevice=LABEL=arch-linux-encrypted:arch-linux root=/dev/mapper/arch-linux rootflags=subvol=/root rw initrd=\EFI\Arch\intel-ucode.img initrd=\EFI\Arch\initramfs-linux.img" \
  --verbose

I'm mounting esp partition to /esp and then bind mounting /esp/EFI/Arch to /boot.

I modified HOOKS in /etc/mkinitcpio.conf, as per this recommendation:

(...)
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems btrfs fsck)
(...)
Problem

Arch is already installed, the boot entry is added seems to work fine. During the boot I'm asked for the password of my encrypted partition, but after I give the proper one, I'm getting an error that systemd doesn't exist:

:: running early hook [udev]
Starting version 244.1-1-arch
:: running hook [udev]
:: Triggering uevents...
:: running hook [keymap]
:: Loading keymap...done.
:: running hook [encrypt]

A password is required to access the arch-linux volume:
Enter passphrase for /dev/nvme0n1p3:
:: running hook [btrfs]
Scanning for Btrfs filesystems
:: performing fsck on '/dev/mapper/arch-linux'
:: mounting '/dev/mapper/arch-linux' on real root
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /bin/systemd does not exist.
Bailing out, you are on your own. Good luck.

sh: can't access tty: job control turned off

It seems to me the problem is that what's getting mounted as system root is the top of arch-linux instead of root subvolume. I'm passing rootflags=subvol=/root, which should mount a subvolume root, but it seems to me it doesn't. I may be wrong on that though.

I'll be glad for any help on how to fix that.

Last edited by no-cheating (2020-01-27 07:29:47)

Offline

#2 2020-01-27 07:28:55

no-cheating
Member
From: Poland
Registered: 2016-04-26
Posts: 61

Re: [SOLVED] Systemd boot error on installation with encrypted Btrfs root

Weird, but not long after writing this post the boot started to work. I think I changed a few details, while writing the post, but nothing really important, so I was surprised when it suddenly started to work. Anyway, it seems the help is no longer needed smile, so I'll mark it as solved.

Offline

Board footer

Powered by FluxBB