From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f47.google.com ([209.85.214.47]:37810 "EHLO mail-it0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751171AbcGFSE6 (ORCPT ); Wed, 6 Jul 2016 14:04:58 -0400 Received: by mail-it0-f47.google.com with SMTP id f6so1979875ith.0 for ; Wed, 06 Jul 2016 11:04:57 -0700 (PDT) Subject: Re: 64-btrfs.rules and degraded boot To: Chris Murphy , Andrei Borzenkov References: <20160705212706.719397fc@jupiter.sol.kaishome.de> Cc: Kai Krakow , Btrfs BTRFS From: "Austin S. Hemmelgarn" Message-ID: <44c18e92-69b4-1409-1bf3-b1d08f6f84db@gmail.com> Date: Wed, 6 Jul 2016 14:04:50 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 2016-07-06 13:19, Chris Murphy wrote: > On Wed, Jul 6, 2016 at 3:51 AM, Andrei Borzenkov wrote: >> 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 ~]# You won't get any output from it regardless, you have to check the return code as it's intended to be a tool for scripts and such.