Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted:

> Add 'btrfs remove missing-all' to remove all the missing devices at once
> for improving usability.
> 
> Example:
>  sudo mkfs.btrfs -f -d raid1 /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4
>  sudo wipefs -a /dev/sdb1 /dev/sdb3
>  sudo mount -o degraded /dev/sdb2 /mnt
>  sudo btrfs filesystem show /mnt
>  sudo btrfs device remove missing-all /mnt
>  sudo btrfs filesystem show /mnt


There's a reason remove missing-all hasn't yet been implemented.

Note that the above would be very unlikely to work once a filesystem has 
been used in any significant way, because raid1 and raid10 are explicitly 
chunk pairs, *NOT* duplicated N times across N devices.  So with two 
devices missing, chances are that both copies of some chunks will be 
missing as well, so the filesystem would no longer be mountable degraded-
writable, only degraded-readonly, in which case device remove won't work 
at all because the filesystem is readonly.

In fact, until the recent per-chunk check patches went in, it was 
impossible to mount-writable a raid1 missing two devices at all, because 
the safeguards simply assumed some chunks would be entirely missing.

The only case in which more than a single device missing is likely to be 
mountable degraded-writable (so device remove will work at all) is raid6, 
tho with recent patches there's narrow cases in which it /might/ be 
doable with raid1 as well.

Now you may still wish to implement remove missing-all for raid6 mode and 
for the unusual corner-case raid1/raid10 in which it might work, but the 
documentation should be pretty clear that save for raid6 it can't be 
expected to work in most cases.

Given that, I think remove missing-all hasn't been implemented as it 
simply hasn't been considered to be worth the bother for the narrow use-
cases in which it will actually work.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to