-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Jan 01, 2018 at 06:01:20PM -0800, David Christensen wrote: > On 12/31/17 14:45, Sven Hartge wrote: > >David Christensen <dpchr...@holgerdanske.com> wrote: > >> $ man 4 md > > > >> SCRUBBING AND MISMATCHES > >> ... > >> If check was used, then no action is taken to handle the mismatch, > >> it > >> is simply recorded. If repair was used, then a mismatch > >> will be > >> repaired in the same way that resync repairs arrays. For > >> RAID5/RAID6 > >> new parity blocks are written. For RAID1/RAID10, all but one block > >> are > >> overwritten with the content of that one block. > > > > > >>I wonder how md picks "that one block"? > > > >Only if one drives reports an error. Then data from the good block is > >used to overwrite the bad block, hoping the drive remaps the sector and > >everything is fine again. > > > >If both devices report no error but differing data has been read, > >MD-RAID1 can't know which block is good. > > > >MD-RAID5/6 could calculate all parity combinations and use the data a > >majority agrees upon. (I don't know if it does it, though). > > > >I tried looking at the Kernel RAID code, but I must admit: it is all > >Esperanto to me, the code is far too low level for me to understand. > > That's why "programming systems product" [1] includes architectural, > functional, design, construction, etc., documentation. > > > FreeBSD is better is this regard [2].
Look for documentation in the right shelf. Hint: it's called Documentation (there are books in there, not nuts and bolts). As an example: I'm on 4.9.0 (plus some assorted Debian-specific patches). If I don't want to download the whole kaboodle (although that would be a good idea), I might be tempted to use the nice gitweb interface at git.kernel.org: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/?h=v4.9 The "tree" view (provided above for your convenience, but you mith be able to click your way through), you might perhaps find docs in or around Documentation/md.txt. Reading source only helps if you have a rough idea on what's going on. Cheers - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlpLXwUACgkQBcgs9XrR2kbhgACeJKSDGa3qKVFnu24d7me2YR2v sGYAn310MNqQUtRUQf3YA4UMziMDx4M6 =vVpK -----END PGP SIGNATURE-----