From: Chris Murphy <lists@colorremedies.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>,
Kai Krakow <hurikhan77@gmail.com>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: 64-btrfs.rules and degraded boot
Date: Wed, 6 Jul 2016 11:19:55 -0600 [thread overview]
Message-ID: <CAJCQCtSZ=7v5PgD4mYKhayg03UfVqCV0ADBSjTsFDHiVcdxAjw@mail.gmail.com> (raw)
In-Reply-To: <CAA91j0VbaRpt46tYf_oqd7fRuRn_ev-=Zxf_Bwiwd=TUHR+2Ow@mail.gmail.com>
On Wed, Jul 6, 2016 at 3:51 AM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> On Tue, Jul 5, 2016 at 11:10 PM, Chris Murphy <lists@colorremedies.com> wrote:
>> I started a systemd-devel@ thread since that's where most udev stuff
>> gets talked about.
>>
>> https://lists.freedesktop.org/archives/systemd-devel/2016-July/037031.html
>>
>
> Before discussing how to implement it in systemd, we need to decide
> what to implement. I.e.
Fair.
> 1) do you always want to mount filesystem in degraded mode if not
> enough devices are present or only if explicit hint is given?
Right now on Btrfs, it should be explicit. The faulty device concept,
handling, and notification is not mature. It's not a good idea to
silently mount degraded considering Btrfs does not actively catch up
the devices that are behind the next time there's a normal mount. It
only fixes things passively. So the user must opt into degraded mounts
rather than opt out.
The problem is the current udev rule is doing its own check for device
availability. So the mount command with explicit hint doesn't even get
attempted.
> 2) do you want to restrict degrade handling to root only or to other
> filesystems as well? Note that there could be more early boot
> filesystems that absolutely need same treatment (enters separate
> /usr), and there are also normal filesystems that may need be mounted
> even degraded.
I'm mainly concerned with rootfs. And I'm mainly concerned with a very
simple 2 disk raid1. With a simple user opt in using
rootflags=degraded, it should be possible to boot the system. Right
now it's not possible. Maybe just deleting 64-btrfs.rules would fix
this problem, I haven't tried it.
> 3) can we query btrfs whether it is mountable in degraded mode?
> according to documentation, "btrfs device ready" (which udev builtin
> follows) checks "if it has ALL of it’s devices in cache for mounting".
> This is required for proper systemd ordering of services.
Where does udev builtin use btrfs itself? I see "btrfs ready $device"
which is not a valid btrfs user space command.
I never get any errors from "btrfs device ready" even when too many
devices are missing. I don't know what it even does or if it's broken.
This is a three device raid1 where I removed 2 devices and "btrfs
device ready" does not complain, it always returns silent for me no
matter what. It's been this way for years as far as I know.
[root@f24s ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move
Log Cpy%Sync Convert
1 VG Vwi-a-tz-- 50.00g thintastic 2.55
2 VG Vwi-a-tz-- 50.00g thintastic 4.00
3 VG Vwi-a-tz-- 50.00g thintastic 2.54
thintastic VG twi-aotz-- 90.00g 5.05 2.92
[root@f24s ~]# btrfs fi show
Label: none uuid: 96240fd9-ea76-47e7-8cf4-05d3570ccfd7
Total devices 3 FS bytes used 2.26GiB
devid 1 size 50.00GiB used 3.00GiB path /dev/mapper/VG-1
devid 2 size 50.00GiB used 2.01GiB path /dev/mapper/VG-2
devid 3 size 50.00GiB used 3.01GiB path /dev/mapper/VG-3
[root@f24s ~]# btrfs device ready /dev/mapper/VG-1
[root@f24s ~]#
[root@f24s ~]# lvchange -an VG/1
[root@f24s ~]# lvchange -an VG/2
[root@f24s ~]# btrfs dev scan
Scanning for Btrfs filesystems
[root@f24s ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move
Log Cpy%Sync Convert
1 VG Vwi---tz-- 50.00g thintastic
2 VG Vwi---tz-- 50.00g thintastic
3 VG Vwi-a-tz-- 50.00g thintastic 2.54
thintastic VG twi-aotz-- 90.00g 5.05 2.92
[root@f24s ~]# btrfs fi show
warning, device 2 is missing
Label: none uuid: 96240fd9-ea76-47e7-8cf4-05d3570ccfd7
Total devices 3 FS bytes used 2.26GiB
devid 3 size 50.00GiB used 3.01GiB path /dev/mapper/VG-3
*** Some devices missing
[root@f24s ~]# btrfs device ready /dev/mapper/VG-3
[root@f24s ~]#
--
Chris Murphy
next prev parent reply other threads:[~2016-07-06 17:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 18:53 64-btrfs.rules and degraded boot Chris Murphy
2016-07-05 19:27 ` Kai Krakow
2016-07-05 19:30 ` Chris Murphy
2016-07-05 20:10 ` Chris Murphy
2016-07-06 9:51 ` Andrei Borzenkov
2016-07-06 11:45 ` Austin S. Hemmelgarn
2016-07-06 11:55 ` Andrei Borzenkov
2016-07-06 12:14 ` Austin S. Hemmelgarn
2016-07-06 12:39 ` Andrei Borzenkov
2016-07-06 12:48 ` Austin S. Hemmelgarn
2016-07-07 16:52 ` Goffredo Baroncelli
2016-07-07 18:23 ` Austin S. Hemmelgarn
2016-07-07 18:58 ` Chris Murphy
2016-07-07 19:14 ` Chris Murphy
2016-07-07 19:59 ` Austin S. Hemmelgarn
2016-07-07 20:20 ` Chris Murphy
2016-07-08 12:24 ` Austin S. Hemmelgarn
2016-07-11 21:07 ` Chris Murphy
2016-07-12 15:34 ` Austin S. Hemmelgarn
2016-07-07 20:13 ` Goffredo Baroncelli
2016-07-07 19:41 ` Goffredo Baroncelli
2016-07-06 12:49 ` Tomasz Torcz
2016-07-06 17:19 ` Chris Murphy [this message]
2016-07-06 18:04 ` Austin S. Hemmelgarn
2016-07-06 18:23 ` Chris Murphy
2016-07-06 18:29 ` Andrei Borzenkov
2016-07-06 19:17 ` Austin S. Hemmelgarn
2016-07-06 20:00 ` Chris Murphy
2016-07-07 17:00 ` Goffredo Baroncelli
2016-07-06 18:24 ` Andrei Borzenkov
2016-07-06 18:57 ` Chris Murphy
2016-07-07 17:07 ` Goffredo Baroncelli
2016-07-07 16:37 ` Goffredo Baroncelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJCQCtSZ=7v5PgD4mYKhayg03UfVqCV0ADBSjTsFDHiVcdxAjw@mail.gmail.com' \
--to=lists@colorremedies.com \
--cc=arvidjaar@gmail.com \
--cc=hurikhan77@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).