From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: what is the best way to monitor raid1 drive failures?
Date: Tue, 14 Oct 2014 22:00:09 +0000 (UTC) [thread overview]
Message-ID: <pan$83686$251b2d40$6e8ece38$bc60b89e@cox.net> (raw)
In-Reply-To: CAPF83mtWrTRyfT34nNm7yjLDq+6uRegNJStkDK6+n_7fpmRTDQ@mail.gmail.com
Suman C posted on Tue, 14 Oct 2014 07:48:01 -0700 as excerpted:
> Here's a simple raid1 recovery experiment that's not working as
> expected.
>
> kernel: 3.17, latest mainline progs: 3.16.1
>
> I started with a simple raid1 mirror of 2 drives (sda and sdb). The
> filesystem is functional, I created one subvol, put some data,
> read/write tested etc..
>
> yanked the sdb out. (this is physical/hardware). btrfs fi show prints
> drive missing, as expected.
>
> powered the machine down. removed the "bad"(yanked out sdb) drive and
> replaced it with a new drive. Powered up the machine.
>
> The new drive shows up as sdb. btrfs fi show still prints drive missing.
>
> mounted the filesystem with ro,degraded
>
> tried adding the "new" sdb drive which results in the following error.
> (-f because the new drive has a fs from past)
>
> # btrfs device add -f /dev/sdb /mnt2/raid1pool /dev/sdb is mounted
While I'm not sure it'll get you past the error, did you try...
# btrfs replace ...
That's the new way to /replace/ a missing device, adding a new one and
deleting the old one (which can be missing) at the same time. See the
btrfs-replace manpage.
While the btrfs-replace manpage says that you have to use the <devid>
format if the device is missing, it isn't particularly helpful in telling
what that format actually is. Do a btrfs fi show and use the appropriate
devid /number/ from there. =:^)
Please report back as I'm using btrfs raid1 as well, but my own tests are
rather stale by this point and I'd have to figure it out as I went. So
I'm highly interested in your results. =:^)
(FWIW, personally I'd have made that btrfs device replace, instead of
btrfs replace, to keep it grouped with the other device operations, but
whatever, it's its own top-level command, now. Tho at least the
btrfs-device manpage mentions btrfs replace and its manpage as well. But
I still think having replace as its own top-level command is confusing.)
--
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
next prev parent reply other threads:[~2014-10-14 22:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-12 23:50 what is the best way to monitor raid1 drive failures? Suman C
2014-10-13 2:21 ` Anand Jain
2014-10-13 19:50 ` Suman C
2014-10-14 2:13 ` Anand Jain
2014-10-14 14:48 ` Suman C
2014-10-14 14:52 ` Rich Freeman
2014-10-14 15:05 ` Suman C
2014-10-14 19:15 ` Chris Murphy
2014-10-14 20:11 ` Suman C
2014-10-24 16:13 ` Chris Murphy
2014-10-14 22:00 ` Duncan [this message]
2014-10-15 4:11 ` Anand Jain
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$83686$251b2d40$6e8ece38$bc60b89e@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 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).