From: Robin Hill <robin@robinhill.me.uk>
To: Steven Reddie <steven.reddie@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: mdadm --create parameter ordering
Date: Mon, 13 Jul 2015 11:59:28 +0100 [thread overview]
Message-ID: <20150713105928.GA19366@cthulhu.home.robinhill.me.uk> (raw)
In-Reply-To: <CAFcup8E3iKxb8H-Fz76bKJQhjmhq1FuVu11rEPb-k=g2U_nX=w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2960 bytes --]
On Mon Jul 13, 2015 at 08:26:48PM +1000, Steven Reddie wrote:
> Hi,
>
> Given the following command:
>
> mdadm -Cf /dev/md3 -e1.2 -n5 -l6 /dev/sdga5 /dev/sdgb5 /dev/sdgc5
> /dev/sdgd5 /dev/sdge5 -u<uuid>
>
> Is the order that the disks are specified on the command-line significant?
>
Yes, it specifies the disks' position within the array.
> Somebody suggested this command to put the disks back in the correct
> order (though I believe he was mistaken about the correct order). It
> seems to me that if the order on the command-line is significant that
> this would have caused parity to get recalculated (based on the
> [incorrect] order of the disks) and the new parity to be written over
> actual data blocks. I see no evidence that this has occurred, which
> leads me to believe that the actual ordering within the array is
> detected and everything proceeds as it should, in which case issuing
> the command above likely was a very time-consuming no-op.
>
You're creating a new array, so there is no "actual ordering" to detect
- any old array will be ignored. If you are re-creating the array in
order to fix an issue (which you should only do as a very last resort,
and only after seeking help and advice here) then an incorrect order
will definitely cause new parity information to be written over data
blocks (which is why you should always leave "missing" disks, or use
--assume-clean, to prevent parity calculation until after you've
verified the order is correct and the data is readable), If the
filesystem shows as readable (and error free) then the order specified
would appear to be correct.
> Also, it seems that I should be able to issue such a command without
> the full scan of the disks. Is that what the "--run" option is for? If
> so, does "--readonly" protect me from harm that improper use of
> "--run" may cause?
>
The --run option is to start an array which has been assembled but not
started. The udev auto-assemble rule, for example, will add disks into
the array as they're discovered but only start it once the array is
complete (or as complete as it was the last time it was assembled), so
in the case of a missing disk, a manual --run command may be required.
I'm not entirely sure what the --readonly option will do in the case of
a create command. Possibly just the metadata will be written and the
parity calculation will be paused.
The --assume-clean option will prevent parity calculation (as it assumes
that the parity on disk is already correct), which may be what you're
after. It should only be used it you're absolutely certain of the data
though, as it can lead to large-scale corruption otherwise.
Cheers,
Robin
--
___
( ' } | Robin Hill <robin@robinhill.me.uk> |
/ / ) | Little Jim says .... |
// !! | "He fallen in de water !!" |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-07-13 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 10:26 mdadm --create parameter ordering Steven Reddie
2015-07-13 10:59 ` Robin Hill [this message]
2015-07-13 13:17 ` Phil Turmel
2015-07-18 3:08 ` Steven Reddie
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=20150713105928.GA19366@cthulhu.home.robinhill.me.uk \
--to=robin@robinhill.me.uk \
--cc=linux-raid@vger.kernel.org \
--cc=steven.reddie@gmail.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).