linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Doug Ledford <dledford@redhat.com>
Cc: Rob Bray <raid@bymeinc.com>,
	linux-raid mailing list <linux-raid@vger.kernel.org>
Subject: Re: avoiding the initial resync on --create
Date: Thu, 12 Oct 2006 01:24:06 +0400	[thread overview]
Message-ID: <452D60F6.5060000@tls.msk.ru> (raw)
In-Reply-To: <1160423139.2917.112.camel@fc6.xsintricity.com>

Doug Ledford wrote:
> On Mon, 2006-10-09 at 15:10 -0400, Rob Bray wrote:
[]
> Probably the best thing to do would be on create of the array, setup a
> large all 0 block of mem and repeatedly write that to all blocks in the
> array devices except parity blocks and use a large all 1 block for that.
> Then you could just write the entire array at blinding speed.  You could
> call that the "quick-init" option or something.  You wouldn't be able to
> use the array until it was done, but it would be quick.  If you wanted
> to be *really* fast, at least for SCSI drives you could write one large
> chunk of 0's and one large chunk of 1's at the first parity block, then
> use the SCSI COPY command to copy the 0 chunk everywhere it needs to go,
> and likewise for the parity chunk, and avoid transferring the data over
> the SCSI bus more than once.

Some notes.

First, raid array gets created sometimes in order to repair a broken array.
Ie, you had an array, you lose it for whatever reason, and re-create it,
avoiding initial resync (--assume-clean option), in a hope your data is
still here.  For that, you don't want to zero-fill your drives, for sure! :)

And second, at least SCSI drives have FORMAT UNIT command, which has a
range argument (from-sector and to-sector), and, if memory serves me
right, also "filler" argument as well (the data, 512-byte block, to
write to all the sectors in the range).  (Well, it was long ago when
I looked at that stuff, so it might be some other command, but it's
here anyway).  I'm not sure it's used/available in block device layer
(most probably it isn't).  But this is the fastest way to fill (parts
of) your drives with whatever repeated pattern of bytes you want.
Including this initial zero-filling.

But either way, you don't really need to do that in kernel space --
Userspace solution will work too.  Ok ok, if kernel is doing it after
array creation, the array is available immediately for other use,
which is a plus.

And yes, I'm not sure implementing it is worth the effort.  Unless
you're re-creating your multi-terabyte array several times a day ;)

/mjt

  parent reply	other threads:[~2006-10-11 21:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 12:57 avoiding the initial resync on --create martin f krafft
2006-10-09 13:49 ` Erik Mouw
2006-10-09 16:32   ` Doug Ledford
2006-10-09 19:10     ` Rob Bray
2006-10-09 19:45       ` Doug Ledford
2006-10-09 21:33         ` Neil Brown
2006-10-09 21:45           ` Doug Ledford
2006-10-09 23:14             ` Neil Brown
2006-10-11 21:24         ` Michael Tokarev [this message]
2006-10-10  9:55     ` Gabor Gombas
2006-10-10 17:47       ` Doug Ledford
2006-10-10 19:18         ` Sergey Vlasov
2006-10-10 20:38           ` Doug Ledford
2006-10-10 20:37         ` Gabor Gombas
2006-10-10 21:26           ` Doug Ledford
2006-10-10 22:14             ` Rev. Jeffrey Paul

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=452D60F6.5060000@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=dledford@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=raid@bymeinc.com \
    /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).