Design decisions

Concept

These pages take the Linux `md` driver as their reference because its source is public. Every statement is marked by where a reader can check it: a public source, a derivation kept with the code, or not yet. Where a source leaves something open, the choice the sandbox made is a note on the page that rests on it, and this page lists them all.

Why Linux md is the reference

Linux md is the reference of these pages for one reason: its source can be read, and that makes every rule stated here accountable.

Checking the sources

The Linux kernel is published under the GPL-2.0 licence, and the md driver is the directory drivers/md/ of its source tree: raid0.c, raid1.c, raid5.c (which also implements RAID 4 and RAID 6), raid10.c, md-linear.c. When a page here says how a sector is mapped to a disk, where the parity of a stripe goes, or what the driver does with two disks where a level asks for three, the sentence points at the function that does it, and anyone can open the file and see whether the sentence is true. A controller's firmware and Windows' driver do the same jobs, but their code is not published; what can be checked about them is their documentation, which describes behaviour and does not show it.

The vocabulary is not the reference

RAID is not a Linux thing. The same layouts run on a controller card, under Windows Storage Spaces, in a NAS appliance, and they were defined before any of these existed. Taking md as the reference for rules does not make its words the standard. Each family names the same things its own way, and the pages give both:

  • the piece of data on one disk is a chunk in md, a strip on most controllers
  • the device the array becomes is an md device in Linux, a virtual drive on a controller, a storage space in Windows
  • disks joined end to end are linear in md, a spanned volume or a simple space elsewhere, and JBOD in common speech

Where md is not the reference

Some things exist only outside it. A protected write cache and its BBU are controller hardware, and what a page says about them comes from the vendor. What Storage Spaces does for crash consistency is Microsoft's to document, and the page quotes Microsoft or stays silent. Every entry lists its sources, and the list shows which kind of source each sentence rests on.

How the pages are sourced

Every strong statement on these pages is in one of four states, named by where you would go to check it.

  • Cited. A public source says it: a paper, a man page, the kernel, a vendor's document. The Sources section of a page is that bibliography and nothing else — every entry is a link a reader can follow. This is the default, and a page in this state carries no mark.
  • Derived. The statement rests on a table derived by hand from the kernel's rule — where every chunk, parity block and copy of a small array goes — and the sandbox is tested against that table, not the other way round. A page in this state says so under its heading. The derivations are kept with the code.
  • Chosen. A decision made for the sandbox where the sources leave something open. It is marked where it bites, as a numbered note on the sentence, and every such choice is listed in the next chapter.
  • To verify. Not yet checked against a primary source. The page says so under its heading. The mark is temporary: every statement carrying it is on its way to one of the other three states, or out.

Nothing on these pages names a file of the project's own as a source. The repository is public, and anyone who wants to see how a number is computed can read it.

The model's choices

Where the sources leave something open the sandbox decided, and the page that rests on the choice explains it in a note. The list:

  • Under RAID 6 the sandbox draws Q on the disk before P, the DDF convention, where an array mdadm creates as left-symmetric puts Q after P: algorithm, raid6.
  • The RAID engine is one of three things — a computing chip, a metadata-only chip, or the operating system — and hardware against firmware RAID is decided by which object sits on the path, not by where it sits: raid engine.
  • Of the copies of a mirrored chunk, the one drawn as the original is the first the driver places; the driver's copies are equals: raid10.
  • In a stripe over parity spans (RAID 50, RAID 60) or over RAID 10 spans (RAID 100), the outer stripe hands each span one whole span-stripe per round, spans in order. The kernel defines the layout inside a span and leaves the interleave across spans to the stripe's chunk size.
  • The RAID level is never selected: it is recognized from what is composed. Two disks in a mirror are RAID 1 because of their shape, not because the player named them.
  • A stripe of mirrors and a mirror of stripes — RAID 1+0 and RAID 0+1 — write at the same speed here, because a mirror writes at one copy's width; the two therefore satisfy the same challenges.

Sources