Re: recommended way to allow mounting of degraded array at boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



30.04.2019 10:38, Chris Murphy пишет:
> 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

This has nothing to do with udev. udev simply assigns properties to
device nodes and announces them to subscribers. One subscriber is
systemd which implements timeout logic.

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

That is exactly what happens for non-root mount points (except default
timeout is 90 seconds). For root mounts it is really up to initramfs
implementations. dracut sets infinite timeout indeed with rather terse
commit message

commit 8ee18253644a812184c60e31d7ee3d3f6d8f45c0
Author: Harald Hoyer <harald@xxxxxxxxxx>
Date:   Tue Mar 4 13:46:14 2014 +0100

    dracut: don't let devices timeout

    https://bugzilla.redhat.com/show_bug.cgi?id=949697

Current dracut provides rd.timeout to override it.




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux