Systemd Failed to mount /sysroot on boot

Hi everyone,

I have installed Manjaro with CLI, systemd-boot, LUKS following a few guides like [HowTo] LUKS encrypted system using systemd-boot

Mainly followed Arch’s Installation Guide until needed otherwise.

Had tried installing multiple times on both main machine and VM, same error.

systemd[1]: Failed to mount /sysroot.
[FAILED] Failed to mount /sysroot.
See ‘sysctl status sysroot.mount’ for details.
[DEPEND] Dependency failed for Initrd Root File System.
[DEPEND] Dependency failed for Reload Configuration from the Real Root.
You are in emergency mode. After logging in,…
Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.

Will be posting the settings of the VM as I had already wiped the main’s drive.

sda
├─sda1
│ vfat FAT32 3900-B87D
└─sda2
crypto 1 4d5fc22c-1966-45d3-a51f-45505b0102f9
└─cryptroot
f2fs 1.13 e9e89c3e-b080-4bdf-8ab0-df8ce770fb60

mkinitcpio.conf:

HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems fsck)

loader.conf:

timeout 3
#console-mode keep
default manjaro

manjaro.conf (/boot/loader/entries/*.conf):

title Manjaro
linux /vmlinuz-5.10-x86_64
initrd /intel-ucode.img
initrd /initramfs-5.10-x86_64.img
options rd.luks.name=4d5fc22c-1966-45d3-a51f-45505b0102f9=cryptroot root=dev/mapper/cryptroot

#/dev/sda2 4d5fc22c-1966-45d3-a51f-45505b0102f9
#/dev/mapper/cryptroot e9e89c3e-b080-4bdf-8ab0-df8ce770fb60

I did not configure the /etc/fstab.conf.

Would have tried getting the “sysctl status sysroot.mount” but I could not access the emergency console. I have already set passwd after chroot.

Hi and welcome to the forum :wave:

For clarity (and since new users can’t post links) are you referring to this Howto?

1 Like

No, it was a guide made by linux-aarhus on May '20.

Ah this one on the archived forum:


Pinging @linux-aarhus
1 Like

I don’t know - I see one thing - as you have used f2fs - you may have forgotten to add f2fs in the modules section of mkinitcpio.conf.

I also note that I didn’t mention that in the original guide - but since my encryption experiments are carried out using USB devices - I probably forgot to write it down - even though I may have used it.

If you omit configuring fstab - did you ensure the correct partition type is set on the root partition? 0x8304 for a 64-bit root partition

Other than the above I can’t see why it shouldn’t work.

Just spotted this - if the root account is locked - you may have forgotten to set a root password - and this is an important step for any Arch based system - as the arch defaults for the shadow file prevents login using passwordless root.

Hi @linux-aarhus! Sorry I forgot to mention, have already tried setting root password with passwd before and after chroot. Still shows that root account is locked. Will attempt the rest of your suggestions.

Edit: Ran again after redoing the hooks section and it ran without the errors.

Saw a couple weird lines when running mkinitcpio -P

manjaro-architect# mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: ‘default’
-> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64.img
==> Starting build: 5.10.2-2-MANJARO
-> Running build hook: [base]
-> Running build hook: [autodetect]
-> Running build hook: [keyboard]
-> Running build hook: [sd-vconsole]
/usr/lib/initcpio/install/sd-vconsole: line 41: add_udev_rule: command not found
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [sd-encrypt]
/usr/lib/initcpio/install/sd-encrypt: line 22: add_systemd_unit: command not found
/usr/lib/initcpio/install/sd-encrypt: line 26: add_systemd_unit: command not found
/usr/lib/initcpio/install/sd-encrypt: line 27: add_systemd_unit: command not found
-> Running build hook: [filesystems]
-> Running build hook: [fsck]
==> ERROR: file not found: `fsck.overlay’
==> WARNING: No fsck helpers found. fsck will not be run on boot.
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64.img
==> WARNING: errors were encountered during the build. The image may not be complete.
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: ‘fallback’
-> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64-fallback.img -S autodetect
==> Starting build: 5.10.2-2-MANJARO
-> Running build hook: [base]
-> Running build hook: [keyboard]
-> Running build hook: [sd-vconsole]
/usr/lib/initcpio/install/sd-vconsole: line 41: add_udev_rule: command not found
-> Running build hook: [modconf]
-> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: aic94xx
-> Running build hook: [sd-encrypt]
/usr/lib/initcpio/install/sd-encrypt: line 22: add_systemd_unit: command not found
/usr/lib/initcpio/install/sd-encrypt: line 26: add_systemd_unit: command not found
/usr/lib/initcpio/install/sd-encrypt: line 27: add_systemd_unit: command not found
-> Running build hook: [filesystems]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64-fallback.img
==> Image generation successful

Could this be the cause of the error?

I did not include the f2fs in the modules section of mkinitcpio.conf before.

so now it looks like:

MODULES=(f2fs)
HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems fsck)

Ran into the same error even after fixing mkinitcpio.conf and making sure root partition is 64-bit root partition with cfdisk.

These message could be the cause of your issue - because if the modules are not in initramfs you will not be able to open the the encrypted root.

For the time being I have no spare time to play with encrypted installations - I am in neck deep in a project which requires a lot of my time - I will put it on my to-do-list - to recheck the guide.

title Manjaro
linux /vmlinuz-5.10-x86_64
initrd /intel-ucode.img
initrd /initramfs-5.10-x86_64.img
options rd.luks.name=4d5fc22c-1966-45d3-a51f-45505b0102f9=cryptroot root=dev/mapper/cryptroot

is the dev/mapper/cryptroot a copy error or did you forget a slash here.
it should be /dev/mapper/cryptroot