linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Diego Guella <diego.guella@deviltechnologies.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: raid1 bitmap and multiple removed disks
Date: Thu, 24 Nov 2016 11:26:54 +1100	[thread overview]
Message-ID: <87fumhbu41.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <ce2ba842-22f0-eebf-856c-f07d38574489@deviltechnologies.com>

[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]

On Wed, Nov 23 2016, Diego Guella wrote:

> (2nd attempt: the previous one didn't make it)
> Hi,
>
> I am using linux raid1 for a double-purpose: redundancy and backup.
>
> I have a raid1 array of 5 disks, 3 of which are kept for backup purposes.
> Let's call disks A, B, C, D, E.
> Disks A and B are _always_ connected to the system.
> Disks C, D, E are backup disks.
> Here follows a description of how I use the backup disks.
> This morning I connect disk C, and let it resync.
> Tomorrow morning, I shut down the system, remove disk C and keep it away 
> as a daily backup.
> I connect the next disk (D), then start up the system.
> Linux raid1 recognizes the "old" disk and does not allow it to enter the 
> array (this is evidenced by system logs).
> I then add disk D to the array, and let it resync.

So this would be a full resync - right?

> The next day, I connect the next disk (E), and so on, rotating them.
> The "connect and disconnect" is always performed when the system is 
> powered off, although sometimes I hot-connect the disk with the system 
> already powered up.
> The purpose of this is to have an emergency backup: I can disconnect ALL 
> disks from the system and connect only one of the daily backups, going 
> "back to the past"(TM).
>
> This array has a write-intent bitmap, in order to speed up the resync 
> (it is a 4TB array, and sometimes it needs nearly 20 hours to resync 
> without bitmaps due to system load).
>
> This worked flawlessly (for some years) until some days ago, when the 
> array suffered a strange inconsistency, and the filesystem nearly gone 
> nuts in about 20 minutes of uptime. I will elaborate more on this
> later.

Did you ever test your backups?

>
> Since that problem happened, some questions come to my mind:
> What raid1 bitmaps allow me to do?

- accelerate resync after a crash.
- accelerate recovery when you remove a drive and re-add it.

> Can they record _correctly_ the state of multiple removed disks, in 
> order to overwrite only out-of-sync chunks of multiple removed disks?

All that is recorded is the set of regions which have been written to
since the array was last in a non-degraded state.

> In other words, am I allowed to do what I described above?

If the recovery that happened when you swapped drives was not a full
recovery, then probably not.

> If not, can I change something in my actions in order to have a daily 
> backup using raid1?

I wrote something about this a few years ago...
 http://permalink.gmane.org/gmane.linux.raid/35074

or this thread
  http://www.spinics.net/lists/raid/msg35532.html

NeilBrown

>
>
> System details:
> # cat /etc/debian_version
> 6.0.10
> # mdadm --version
> mdadm - v3.1.4 - 31st August 2010

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  reply	other threads:[~2016-11-24  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  8:50 raid1 bitmap and multiple removed disks Diego Guella
2016-11-24  0:26 ` NeilBrown [this message]
2016-11-24  8:46   ` Diego Guella

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=87fumhbu41.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=diego.guella@deviltechnologies.com \
    --cc=linux-raid@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).