[systemd-devel] Using btrfs subvolumes with systemd
Florent Peterschmitt
florent at peterschmitt.fr
Thu Jun 9 20:30:11 UTC 2016
8 juin 2016 22:34 "Chris Murphy" <lists at colorremedies.com> a écrit:
> On Wed, Jun 8, 2016 at 12:48 PM, Florent Peterschmitt
> <florent at peterschmitt.fr> wrote:
>
>> 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?
>
> I take it /dev/mapper/root is a dmcrypt device?
>
> If you can add systemd.log_level=debug at boot time as a boot
> parameter (remove the symlink modification so the boot fails as it has
> been), mount -a, then post the output from 'journalctl -b -o
> short-monotonic > journal.log' somewhere, that might provide a bit
> more context.
>
> That it works for gentoo and not arch makes me wonder if this is
> actually an issue in the initramfs. You could also add rd.debug as a
> boot parameter, but the combination of both debugs makes things super
> slow and the journal output will be quite large.
>
> --
> Chris Murphy
The log with systemd.log_level=debug at boot is located here: http://data.peterschmitt.fr/systemd.log
Here is the output from udevadm about /dev/mapper/root:
# udevadm info /dev/mapper/root
P: /devices/virtual/block/dm-0
N: dm-0
E: DEVNAME=/dev/dm-0
E: DEVPATH=/devices/virtual/block/dm-0
E: DEVTYPE=disk
E: DM_UDEV_DISABLE_DISK_RULES_FLAG=1
E: DM_UDEV_DISABLE_OTHER_RULES_FLAG=1
E: DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1
E: MAJOR=253
E: MINOR=0
E: SUBSYSTEM=block
E: SYSTEMD_READY=0
E: TAGS=:systemd:
E: USEC_INITIALIZED=18904677
Florent Peterschmitt
More information about the systemd-devel
mailing list