On Mon, Apr 29, 2019 at 5:57 AM Andrei Borzenkov <arvidjaar@xxxxxxxxx> wrote: > > On Mon, Apr 29, 2019 at 2:38 PM Austin S. Hemmelgarn > <ahferroin7@xxxxxxxxx> wrote: > > > * If you're doing this on a system using systemd, it actually doesn't do > > what you are trying to do. Systemd will refuse to mount the volume if > > all the constituent devices aren't present, > > > > It is not quite correct. systemd will not even attempt to mount > incomplete btrfs because it will wait for all devices (including > missing ones) to appear before proceeding to mount it. And if this > check is disabled, it will actually just call mount.btrfs, it will > certainly not "refuse" to do anything. So the following may work > > - disable udev rule calls "btrfs device ready" (it actually calls > internal variant, but it does not matter). > - replace mount.btrfs with your own script that tries to mount btrfs > and if it fails tries to mount it degraded. Yeah what I don't like about this udev rule is the indefinite hang. I don't know enough about udev, whether it can support a timeout? If the missing devices haven't appeared in 30 seconds, good chance they won't appear, and then either fail at this rule or continue on with the mount attempt (which then fails). But either way, the user gets to a prompt, and can troubleshoot the problem from there rather than being stuck with force poweroff being the only alternative. -- Chris Murphy
