All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Can't remount a BTRFS partition read write after a drive failure
Date: Fri, 19 May 2017 02:23:26 +0000 (UTC)	[thread overview]
Message-ID: <pan$ca9bb$47dac8b6$6d24a133$f405d287@cox.net> (raw)
In-Reply-To: d76bbe8f-af4a-36a0-2eb0-45384a8fee79@chicoree.fr

Sylvain Leroux posted on Thu, 18 May 2017 09:22:55 +0200 as excerpted:

> Thank you Chris, Ivan, for your answers.

> Here we are in a very special use case. But I think we would see a
> similar behavior if some drive case or cable was dying, the
> administrator replaced it, but was unable to remount rw the drive after
> having fixed the problem. Or did I missed something?

What you seem to have missed is my earlier reply, saying, effectively...

Known issue.  Btrfs currently doesn't really have a concept of devices 
coming and going while it's mounted.  If a device disappears, btrfs will 
continue to try to write to it until there are enough errors to kick it 
into read-only mode.  Even then, it continues to be part of the 
filesystem.

So when the kernel kicks the device and it reappears as another device, 
btrfs is still tracking the first, now non-existent device, for that 
filesystem (which is tracked by UUID, so it will be considered the same 
filesystem even when appearing as a different device, because the UUID is 
the same), and will attempt to add the second device to it (which is 
logical because unlike most filesystems, btrfs can actually /be/ multi-
device).

But the filesystem properties still say only one device, so btrfs knows 
there's /something/ wrong and won't mount the filesystem at its new 
device location except read-only, to prevent further damage due to the 
confusion.

There's patches in the pipeline to give btrfs this dynamic appearing and 
disappearing devices sense that it currently lacks, but they're in a 
patch-set (the btrfs global hot-spare feature patch set, which obviously 
requires btrfs knowing when a device is gone and needs replaced by the 
hot-spare) that has been held up waiting for a different patch set, that 
itself hasn't been integrated yet.

So try again in a few kernel cycles...

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


  reply	other threads:[~2017-05-19  2:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 12:56 Can't remount a BTRFS partition read write after a drive failure Sylvain Leroux
2017-05-17  4:10 ` Chris Murphy
2017-05-17  9:22 ` Duncan
2017-05-17 15:21 ` Ivan Sizov
     [not found] ` <CAMG9ccz555xia-FpqGsoy-uzYXcyYwG6H0EC18O2AC9yLUuBpg@mail.gmail.com>
2017-05-18  7:22   ` Sylvain Leroux
2017-05-19  2:23     ` Duncan [this message]
2017-05-20  9:11       ` Sylvain Leroux

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='pan$ca9bb$47dac8b6$6d24a133$f405d287@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.