Device initialization options

The disk_init_helper tool is a configuration helper for a StorPool server node; see Using disk_init_helper. It has two main commands, init and discover. Here you can find detailed information about the options of this tool.

discover

The discover command helps preparing a configuration file with disks to be later initialized with the init command, with options to filter out disks either by size or other parameters It has the following format:

disk_init_helper discover [-h] [-q] [-d [DUMP_FILE]]
                          [--minimum-sata-size MINIMUM_SATA_SIZE] [--minimum-nvme-size MINIMUM_NVME_SIZE]
                          [--minimum-pmem-size MINIMUM_PMEM_SIZE] [--maximum-sata-size MAXIMUM_SATA_SIZE]
                          --start START [--nvme-split-size NVME_SPLIT_SIZE]
                          [--offsets OFFSETS] [--disk-journal-override {njo,sj,None,rj,nj}]
                          [glob [glob ...]]

Positional arguments

As shown above, you can provide one or more glob overrides. They are useful when devices are incorrectly detected for any reason as something different than what they are. For example, if an SSD is incorrectly detected as an HDD due to its rotational property in /sys (for example, because it is behind a RAID controller) it could be overridden to an SSD.

Another useful case for overrides is to exclude (override type as “x”) from the discovery.

Each glob could be specified as a single or more strings (Default: ‘*’).

Each glob is in the form: <main-part>:<type>[:<journal-type>]

  • <main-part> could be the identifier part of the device as visible in /dev/disk/by-id.

    For example, a glob matching the full disk name would be (the :<type> is required when overriding):

    ata-MICRON_M510DC_MTFDDAK240MBP_1517107FDBA4:s
    

    or just part of it:

    *1517107FDBA4:s
    

    The above will override the device as “s” or the SSD type (see below for all options).

    For cases where multiple devices are of the same type, the following could be used:

    *Hitachi*:h:nj
    

    This way all disks matching the glob will require an NVMe for their journals.

    When overrides are provided, the first matching glob for the disk will be the one used for the overrides, and any further globs will be ignored.

  • <type> could be one of:

    • s for an SSD drive override

    • sj for an SSD drive ready to be used as a journal drive (unlikely)

    • n for an NVMe drive

    • nj for an NVMe drive ready to be used as a journal drive

    • njo for an NVMe drive that is a journal only (no StorPool disk on it)

    • h for a hard-disk drive

  • journal-type (optional) - the type of the journal if necessary (makes sense mostly for HDDs):

    • nj - journal on an NVMe drive - requires at least one nj device

    • njo - journal on an NVMe drive dedicated for writes only - requires at least one njo device

    • sj - journal on SSD drive (unusual, but useful for testing); requires at least one sj device

    • rj - journal device on a write backed VD behind a RAID controller

Optional arguments

-d DUMP_FILE, --dump-file DUMP_FILE

Dump prepared configuration in this file (Default: None, will just show discovered disks).

--disk-journal-override OVERRIDE

Override the journal type for all discovered disks; values njo,sj,None,rj,nj are described above. Default: None; auto detection is performed in the following order: Optane, any other NVMe, no journal. Note that this override does not take precedence over matching glob journal overrides.

-h, --help

Show this help message and exit.

--minimum-sata-size MINIMUM_SATA_SIZE

Narrow the search for SATA drives larger than this size (Default: 400GB).

--minimum-nvme-size MINIMUM_NVME_SIZE

Narrow the search for NVMe drives larger than this size (Default: 90GB).

--minimum-pmem-size MINIMUM_PMEM_SIZE

Narrow the search for Persistent memory NVMe larger than this size (Default: 1GB).

--maximum-sata-size MAXIMUM_SATA_SIZE

Narrow the search for SATA drives lower than this max size (Default: 8TB).

--nvme-split-size NVME_SPLIT_SIZE

Drives larger than this size will be split into a size/nvme-split-size number of partitions (Default: 4398046511104).

--offsets OFFSETS

Offsets for SSDs, NVMes and HDDs StorPool disk IDs (defaults: 0,0,20).

-q, --quiet

Includes debug messages on stderr where applicable.

--start START

Staring StorPool disk ID for this node (for example 101).

Depending on the selected --offsets and number of disks, different disks will be added with different IDs starting with this one. Default example will result in 101 for the first SSD, 111 for the first NVMe, 131 for the first HDD, and so on. In case of more than 10 disks of each type the numbers will be bumped with 10 for each next type in this exact sequence - SSD/NVMe/HDD.

init

The init command is used for initializing multiple disks with inter-related journals. It has the following format:

disk_init_helper init [-h] [-q] [-e] [-i] [-b]
                      [--ssd-args SSD_ARGS] [--hdd-args HDD_ARGS]
                      [--wipe-new-partitions] [--gen-nvme-pci-ids]
                      read_dump

Positional arguments

read_dump

Read JSON data from this file (Default: None)

Optional arguments

-b, --batch

Batch mode: if any of the disks is already initialized, just checks all parameters, and skips all disks already added/validated (Default: False).

-e, --exec

The tool just shows what will be executed by default. This option instructs it to perform what was shown (Default: False).

--gen-nvme-pci-ids

Generate the now deprecated SP_NVME_PCI_ID addresses so that the earliest production release could be tested with nodes equipped with NVME devices.

-h, --help

Show this help message and exit.

--hdd-args HDD_ARGS

Additional list of space separated arguments for storpool_initdisk for all HDD disks (Default: None).

-i, --init

Whether to add -I to the first storpool_initdisk (Default: False).

-q, --quiet

Includes debug messages on stderr where applicable.

--ssd-args SSD_ARGS

Additional list of space separated arguments for storpool_initdisk for all flash disks (Default: None).

--wipe-new-partitions

Wipe each new partition with sgdisk -z in order to cleanup any old data (Default: False).

Warning

The wipe-new-partitions option is DANGEROUS.