29.04.2019 21:25, Austin S. Hemmelgarn пишет: > On 2019-04-29 13:31, Andrei Borzenkov wrote: >> 29.04.2019 20:20, Austin S. Hemmelgarn пишет: >>> >>>>>> As of today there is no provision for automatic mounting of >>>>>> incomplete >>>>>> multi-device btrfs in degraded mode. Actually, with systemd it is >>>>>> flat >>>>>> impossible to mount incomplete btrfs because standard framework only >>>>>> proceeds to mount it after all devices have been seen. >>>> Do you talk about the mount during boot or about mounting in general? >>> Both, >> >> Sorry for chiming in, but the quoted part was mine, and I was speaking >> about automatic mount during boot. Manual mount using "mount" command >> after boot is of course possible (and does not involve systemd in any >> way). There is systemd-mount tool which will likely have the same issue. >> > Based on my own experience, it still has issues in some cases, even if > mounted manually. In the past, I've had systemd _unmount_ degraded > BTRFS volumes I had just manually mounted because it thought they > shouldn't be mounted (because devices were missing, therefore the device > ready ioctl was returning false). Only ever seems to happen for volumes > in `/etc/fstab` or managed as native mount units, but still an issue. >
Ah, OK, that's true and has been plaguing systemd users for quite some time. It should be fixed in current systemd which hopefully no more decides to unmount filesystem even when it believes underlying device is not present. Here is initial commit: commit 628c89cc68ab96fce2de7ebba5933725d147aecc Author: Lennart Poettering <lenn...@poettering.net> Date: Fri Feb 27 21:55:08 2015 +0100 core: rework device state logic This change introduces a new state "tentative" for device units. Device units are considered "plugged" when udev announced them, "dead" when they are not available in the kernel, and "tentative" when they are referenced in /proc/self/mountinfo or /proc/swaps but not (yet) announced via udev. This should fix a race when device nodes (like loop devices) are created and immediately mounted. Previously, systemd might end up seeing the mount unit before the device, and would thus pull down the mount because its BindTo dependency on the device would not be fulfilled.