Use cases for "mdadm --create" vs. "mdadm --build"?

From the mdadm man page, --build section:

This usage is similar to --create. The difference is that it creates a legacy array without a superblock.

^^ So no superblock with --build. 10-4. This is followed by:

With these arrays there is no difference between initially creating the array and subsequently assembling the array, except that hopefully there is useful data there in the second case.

^^ I'm confused by this statement. Can anyone rephrase?

What would be a use case for --build, instead of --create?


Solution 1:

If you want to create arrays in legacy format, you would use --build. This may be because you have to connect this array to an old system which lacks metadata/superblock support.

You most likely want to use --create for common use cases.

To clarify the confusing text:

As there is no metadata/superblock on the disks, arrays created by --build cannot store any additional data about the array. If you choose to work with arrays without metadata (by using --build) the applied operation is the same even if you have brand new disks or you have a previously used array. The lack of metadata prevents any possible detection.

In arrays with metadata, you create a new array on new disks with --create and subsequent uses of the array is conducted by --assemble, which uses the metadata on the disk to verify status of the array and correctness of the assembly.

Lacking the distinction with first time initialization and regular assembly process, --build option would create an array when you first call it on some new disks. Then you probably use the disk and write some useful data on it. On your next --build action, you expect to see the previously recorded data after the build operation, so you hopefully find some useful data on the array in succeeding invocations of --build