You are not logged in.

#1 2018-01-06 23:28:42

cameo
Member
Registered: 2012-08-18
Posts: 119

[SOLVED] Bailed out when booting fresh Arch w/ LUKS on lvm + btrfs

Hi all and a Happy New Year!


Currently I am setting up an encrypted Arch system (x86_64) with lvm and the root on btrfs, something I thought being used to; /boot is ext4, loaded by syslinux in BIOS mode, installed via the latest live CD.)

It's only that any boot attempt ends like this:

...
:: running early hook [lvm2]
:: running hook [udev]
:: Triggering uevents...
:: running hook [keymap]
:: Loading keymap...done.
:: running hook [encrypt]

A password is required ... (snip)

:: running hook [btrfs]
Scanning for Btrfs filesystems
...
:: running hook [consolefont] 
:: Loading consolefont...done.
:: mounting '/dev/mapper/crvol-root' on real root
:: running late hook [lvm2]
:: running cleanup hook [shutdown]
:: running cleanup hook [lvm2]
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.

sh: can't access tty: job control turned off
[rootfs ]# _

I've been searching the web for about a day now, thinking it must be something about btrfs and the subvolumes, the mkinitcpio.conf, or the fstab. Read tons of wikis and posts, tested countless variations of mkinitcpio.conf settings, generated kernel images, checked for typos, and nearly getting nuts~ So hopefully you guys can help me. ^^

First, either before or after chrooting, despite the error (/mnt)/sbin/init exists, as systemd-sysvcompat is installed (such as btrfs-progs).


This is my latest mkinitcpio.conf:

MODULES=()
BINARIES=("/usr/bin/btrfsck")
FILES=()
HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems consolefont shutdown)

syslinux.cfg is as follows:

DEFAULT arch
PROMPT 0
TIMEOUT 50

UI menu.c32

MENU TITLE Arch Linux
...

LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND cryptdevice=/dev/sda2:crcnt root=/dev/mapper/crvol-root rw lang=de locale=de_DE.UTF-8
    INITRD ../initramfs-linux.img

LABEL archfallback
    MENU LABEL Arch Linux Fallback
    LINUX ../vmlinuz-linux
    APPEND cryptdevice=/dev/sda2:crcnt root=/dev/mapper/crvol-root rw lang=de locale=de_DE.UTF-8
    INITRD ../initramfs-linux-fallback.img

   

This one is the genfstab generated fstab – where the many subvolumes look funny:

# /dev/mapper/crvol-root
UUID=aaa...	/         	btrfs     	rw,relatime,nodatasum,nodatacow,space_cache,subvolid=257,subvol=/@,subvol=@,commit=120	0 0

# /dev/mapper/crvol-root
UUID=aaa...	/home     	btrfs     	rw,relatime,nodatasum,nodatacow,space_cache,subvolid=258,subvol=/@home,subvol=@home,commit=120	0 0

# /dev/mapper/crvol-root
UUID=aaa...	/.snapshots	btrfs     	rw,relatime,nodatasum,nodatacow,space_cache,subvolid=259,subvol=/@snapshots,subvol=@snapshots,commit=120	0 0

# /dev/sda1
UUID=bbb...	/boot     	ext4      	rw,relatime,data=ordered	0 2

# /dev/mapper/crvol-swap
UUID=ccc...	none      	swap      	defaults,pri=-2	0 0

Anyway it makes no difference if I ommit subvol=@ or subvol=/@, use all, or only use the subvolid's (what I currently do)!

This one is the btrfs subvolume list:

ID 257 gen 145 parent 5 top level 5 path @
ID 258 gen 10 parent 5 top level 5 path @home
ID 259 gen 11 parent 5 top level 5 path @snapshots

Any ideas..?

Last edited by cameo (2018-01-07 13:22:12)

Offline

#2 2018-01-06 23:35:37

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Bailed out when booting fresh Arch w/ LUKS on lvm + btrfs

You haven't specified the subvolume to use as your root in your bootloader config. You need to change...

APPEND cryptdevice=/dev/sda2:crcnt root=/dev/mapper/crvol-root rw lang=de locale=de_DE.UTF-8

to...

APPEND cryptdevice=/dev/sda2:crcnt root=/dev/mapper/crvol-root rootflags=subvol=@ rw lang=de locale=de_DE.UTF-8

You may need to escape the @ to /@, but I couldn't say for definite as my root subvolume is just called 'red'.


Edit - Although probably not relevant to this issue I agree that your fstab looks odd, mine only has a single subvol declaration for each mount...

LABEL=vol0              /                           btrfs       rw,noatime,compress=lzo,space_cache,subvol=red      0       0
LABEL=vol0              /home                       btrfs       rw,noatime,compress=lzo,space_cache,subvol=home     0       0
LABEL=vol0              /mnt/data                   btrfs       rw,noatime,compress=lzo,space_cache,subvol=data     0       0
LABEL=vol0              /mnt/@vol0                  btrfs       rw,noatime,compress=lzo,space_cache                 0       0

Last edited by Slithery (2018-01-06 23:50:38)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2018-01-07 00:15:07

cameo
Member
Registered: 2012-08-18
Posts: 119

Re: [SOLVED] Bailed out when booting fresh Arch w/ LUKS on lvm + btrfs

slithery wrote:
... rootflags=subvol=@ ...

You made my day! It felt like it was something stupid – how could I miss this?!


slithery wrote:

You may need to escape the @ to /@ ... I agree that your fstab looks odd, mine only has a single subvol declaration for each mount...

Yeah, I wonder why genfstab did this, as either the @- or the /@-version suffices.


Solved nonetheless – thanks so much!

Last edited by cameo (2018-01-07 13:23:46)

Offline

Board footer

Powered by FluxBB