Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Systemd not mounting btrfs subvolumes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
crater2150
n00b
n00b


Joined: 04 Mar 2008
Posts: 22

PostPosted: Mon Sep 15, 2014 7:48 am    Post subject: Systemd not mounting btrfs subvolumes Reply with quote

I wanted to try out systemd by installing it on a already fully working gentoo install (which uses openrc), but I can't get it to boot correctly.

I'm using an encrypted root partition, which is formatted as btrfs. The root filesystem is in a btrfs subvolume, the paths /home and /usr/portage are btrfs subvolumes, which are separate from the rootfs subvolume and need to be mounted.
My initramfs opens the LUKS partition, creating /dev/mapper/enc_root and mounting the root-subvolume. With OpenRC this is working without problems, all other subvolumes are mounted and the system boots.

With systemd, the boot process stalls at "A start job is running for dev-mapper-enc_root.device". After 1min30 the job times out and it drops me into a rescue shell. This is, where it gets weird. The mapped device is still there,, "mount /home" runs without error but /home is not mounted afterwards. No non-zero exit code, no output in dmesg, nothing.
Did I miss any necessary configuration for mounting subvolumes or setting up the encrypted root? The timeout part looks to me like systemd is waiting for /dev/mapper/enc_root to appear (but it is already there, created by the initramfs).


Here's the useflags used for systemd, the fstab and crypttab. I'm not sure, which systemd configuration files are relevant, but I did not change anything from the default values, except adding services, which should run later (like cups, dhcp etc.).

emerge --info systemd:
Code:
sys-apps/systemd-216 was built with the following:
USE="acl cryptsetup doc firmware-loader gudev introspection kmod pam policykit seccomp ssl -audit -curl -elfutils -gcrypt -http -idn (-kdbus) -lz4 -lzma -python -qrcode (-selinux) -test -vanilla" ABI_X86="32 64 -x32" PYTHON_SINGLE_TARGET="python2_7 -python3_2 -python3_3 -python3_4" PYTHON_TARGETS="python2_7 python3_3 -python3_2 -python3_4"


/etc/fstab:
Code:
/dev/sda1               /boot                   vfat    noauto,noatime                                                  1 2
/dev/mapper/enc_root    /                       btrfs   ssd,ssd_spread,noatime,nodiratime                               0 1
tmpfs                   /tmp                    tmpfs   defaults,nosuid,mode=1777                                       0 0

# btrfs subvolumes
/dev/mapper/enc_root    /home                   btrfs   ssd,ssd_spread,noatime,nodiratime,subvol=home                   0 0
/dev/mapper/enc_root    /usr/portage            btrfs   ssd,ssd_spread,noatime,nodiratime,subvol=portage                0 0
# ... more btrfs subvolumes, but none that are required for boot (containing distfiles etc.)


/etc/crypttab
Code:
enc_root     /dev/sda3        -                   discard,luks
swap         /dev/sda2        /etc/cryptkeys/swap swap,luks,discard


I already tried without the crypttab entry for root, as it is not needed for openrc (the dmcrypt initscript only handles the swap part, as everything else is already mapped). Same result.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sat Sep 20, 2014 4:18 pm    Post subject: Reply with quote

without an initramfs nothing will work usually. The encrypton has to be in the kernel, do not build modules.

you need to think about the boot / init process.

how should anyone understand the encryption / btrfs ... without an initramfs / proper kernel / setup?

You need to start from scratch, making a proper kernel, proper initframs, and proper bootmanger entry. when you have done this it should work.

I use myself a similar setup without s.... and build my initramfs wiht genkernel.
Back to top
View user's profile Send private message
crater2150
n00b
n00b


Joined: 04 Mar 2008
Posts: 22

PostPosted: Sun Sep 21, 2014 8:46 pm    Post subject: Reply with quote

As I said, I have a working Initramfs and Kernel, encryption built in and not as modules.

The system works fine with the same initramfs when booting OpenRC (which is also on the encrypted root), so this is not the problem. But systemd seems to ignore any device nodes in /dev/mapper created by the initramfs.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6108
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Sep 21, 2014 10:54 pm    Post subject: Reply with quote

what kernel version ?

related:

http://marc.info/?l=linux-btrfs&m=141105243303570 ?
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
crater2150
n00b
n00b


Joined: 04 Mar 2008
Posts: 22

PostPosted: Mon Sep 22, 2014 10:00 am    Post subject: Reply with quote

I'm using gentoo-sources 3.16.2, but the patch is just 4 days old anyway. I will definitely try it later today, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum