[systemd-devel] Using btrfs subvolumes with systemd

Florent Peterschmitt florent at peterschmitt.fr
Thu Jun 9 11:10:04 UTC 2016


9 juin 2016 11:53 "Lennart Poettering" <lennart at poettering.net> a écrit:
> On Wed, 08.06.16 18:48, Florent Peterschmitt (florent at peterschmitt.fr) wrote:
> 
>> Each time i boot, this error happen:
>> # journalctl -xe
>> [...]
>> systemd[1]: dev-mapper-root.device: Job dev-mapper-root.device/start timed out.
>> systemd[1]: Timed out waiting for device /dev/mapper/root.
>> [...]
> 
> This appears unrelated to the fact that btrfs is used, and most likely
> is caused by borked DM logic. Maybe you built the DM tools without
> proper udev support? They used to have a compile-time option there,
> which defaulted to off, which makes DM incompatible with systemd. Most
> distributions don't bother, and always set it, but given that you use
> Gentoo I figure yours might not, dunno.
> 
> Lennart
> 
> --
> Lennart Poettering, Red Hat

Well, as asked before, /dev/mapper/root is effectively a dmcrypt device, opened with cryptsetup and built with udev support.

Also, I should add that the root filesystem is mounted, it's only subsequent mount points that are failing, after the root filesystem is mounted (the "gentoo" btrfs subvolume).

Just in case i'm unclear, here is how it happend:

1. initramfs boots and cryptsetup opens the crypt device to /dev/mapper/root (cryptsetup luksOpen /dev/sda1 root)
2. /dev/mapper/root is mounted on the new root, using the "gentoo" subvolume (root=/dev/mapper/root rootflags=subvol=gentoo)
3. initramfs starts systemd (init=/usr/lib/systemd/systemd)
4. systemd remounts /dev/mapper/root in rw successfully
5. the autogenerated mount units from fstab fail


My position on that problem is that systemd only looks for the device file's path to generated mount units, and somehow a conflict appears somewhere. With the symlinks it does generate some etc-dev-usr-src, etc-dev-lib-modules... mount units.



But, as requested before, i'll send log files to give you some hints.

Also, I think it could be nice to setup a virtual machine with no dmcrypt, juste some /dev/vda1, btrfs and two subvolumes.


Florent Peterschmitt


More information about the systemd-devel mailing list