ndctl-write-infoblock - generate and write an infoblock
As described in the theory of operation section of ndctl-create-namespace , the raw capacity of a namespace may encapsulate a personality, or mode of operation. Specifically, the mode may be set to one of "sector", "fsdax", and "devdax". Each of those modes is defined by an info-block format that uniquely identifies the mode of operation. The write-infoblock command knows how to generate an "fsdax" or "devdax" info-block relative to the specified image size.
The generated block can be written to an existing namespace (provided that namespace is not presently active), written to a file, or piped to standard-out.
This command is a debug facility that can generate image files with valid infoblocks, but also invalid infoblocks for testing the kernel. Use the --offset and --align options with care. Namely --offset must match the actual physical address offset of the namespace it is applied to, and --align must be one of the architectures supported page sizes.
# ndctl write-infoblock -s 1T -c | ndctl read-infoblock -j
wrote 1 infoblock
read 1 infoblock
One or more namespaceX.Y device names. The keyword all can be specified to operate on every namespace in the system, optionally filtered by bus id (see --bus= option), or region id (see --region= option).
Write the infoblock to stdout
Write the infoblock to the given file (mutually exclusive with --stdout).
Override the default size determined from the size of the file specified to --output. In the --stdout case, this option is required.
Specify the "align" value in the infoblock. In the --mode=devdax case "align" designates a page mapping size. There is no validation of this value relative to the page mapping capabilities of the platform.
Override the default autogenerated UUID with the given value.
When the infoblock is stored on a labelled namespace the UUID of the namespace must match the "parent uuid" attribute in the infoblock. This option defaults to the UUID of the namespace when --output and --stdout are not used, otherwise it defaults to a NULL UUID (all zeroes).
By default the assumption is that the infoblock is being written to a namespace or namespace-image that is aligned to its size. Specify this EXPERT/DEBUG option to experiment / test the kernel’s handling of namespaces that violate that assumption.
A regionX device name, or a region id number. Restrict the operation to the specified region(s). The keyword all can be specified to indicate the lack of any restriction, however this is the same as not supplying a --region option at all.
Copyright (c) 2016 - 2019, Intel Corporation. License GPLv2: GNU GPL version 2 http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.