[systemd-devel] Using btrfs subvolumes with systemd

Florent Peterschmitt florent at peterschmitt.fr
Wed Jun 8 18:48:07 UTC 2016


Hi,

I have a recurrent problem at boot time, when mounting filesystems.

First :

o This problem was on systemd v229 and is still here with v230
o I use BTRFS for everything
o I have 6 subvolumes
o I use a subvolume as root filesystem, then mount other subvolumes
o I use Gentoo as main distribution.

Here are some outputs:

# btrfs subvolume list /
ID 257 gen 90 top level 5 path archlinux
ID 258 gen 4296 top level 5 path gentoo
ID 259 gen 2715 top level 5 path lib.modules
ID 260 gen 4225 top level 5 path SteamLibrary
ID 261 gen 613 top level 5 path ubuntu
ID 262 gen 2875 top level 5 path usr.src

# cat /etc/fstab 
/dev/mapper/root / btrfs autodefrag,noatime,subvol=gentoo 0 0
tmpfs /var/tmp/portage/ tmpfs defaults 0 0
UUID=98c23f22-566e-4a17-b663-3c0ce781a897 /boot ext4 defaults,noatime,nodev 0 0
/dev/mapper/root /lib64/modules btrfs autodefrag,noatime,subvol=lib.modules 0 0
/dev/mapper/root /usr/src btrfs autodefrag,noatime,subvol=usr.src 0 0
/dev/mapper/root /home/florent/SteamLibrary btrfs autodefrag,noatime,subvol=SteamLibrary 0 0

/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
/dev/fd0 /mnt/floppy auto noauto 0 0

As you can see, /dev/mapper/root is the btrfs filesystem, created with "mkfs.btrfs
/dev/mapper/root", nothing special. Same for subvolumes.



Here is the problem:

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.
[...]

After StartExecTimeout (reduced to 10s…), i'm dropped into an emergency shell. There, i fire "mount -a", then quit, and the system boots.

But only gentoo does continue booting, with ArchLinux (v230 too), i'm simply dropped into emergency shell forever until i mask usr-src.mount and lib-modules.mount before quitting!


Is this a miss-configuration or a problem with systemd's device handling?


Thanks.

Florent Peterschmitt


More information about the systemd-devel mailing list