.. _storage: ======= Storage ======= Curtin supports a user-configurable storage layout. This format lets users (including via MAAS) to customize their machines' storage configuration by creating partitions, RAIDs, LVMs, formatting with file systems and setting mount points. Custom storage configuration is handled by the ``block-meta custom`` command in curtin. Partitioning layout is read as a list of in-order modifications to make to achieve the desired configuration. The top level configuration key containing this configuration is ``storage``. This key should contain a dictionary with at least a version number and the configuration list. **Config Example**:: storage: version: 1 config: - id: sda type: disk ptable: gpt serial: QM00002 model: QEMU_HARDDISK The ``storage`` configuration can also have a ``device_map_path`` key that specifies a file path where curtin will record (in JSON format) a mapping from device id as specified in the action to the path to the device node for the block device this action ended up modifying or creating. Config versions --------------- The current version of curtin supports versions ``1`` and ``2``. These only differ in the interpretation of ``partition`` actions at this time. ``lvm_partition`` actions will be interpreted differently at some point in the future. .. note:: Config version ``2`` is under active development and subject to change. Users are advised to use version ``1`` unless features enabled by version ``2`` are required. Configuration Types ------------------- Each entry in the config list is a dictionary with several keys which vary between commands. The two dictionary keys that every entry in the list needs to have are ``id: `` and ``type: ``. An entry's ``id`` allows other entries in the config to refer to a specific entry. It can be any string other than one with a special meaning in yaml, such as ``true`` or ``none``. An entry's ``type`` tells curtin how to handle a particular entry. Available commands include: - Dasd Command (``dasd``) - Disk Command (``disk``) - Partition Command (``partition``) - Format Command (``format``) - Mount Command (``mount``) - LVM_VolGroup Command (``lvm_volgroup``) - LVM_Partition Command (``lvm_partition``) - DM_Crypt Command (``dm_crypt``) - RAID Command (``raid``) - Bcache Command (``bcache``) - Zpool Command (``zpool``) **Experimental** - ZFS Command (``zfs``)) **Experimental** - Device "Command" (``device``) Any action that refers to a block device (so things like ``partition`` and ``dm_crypt`` but not ``lvm_volgroup`` or ``mount``, for example) *can* specify a ``path`` key but aside from ``disk`` actions this is not used to locate the device. A warning will be emitted if the located device does not match the provided path though. Dasd Command ~~~~~~~~~~~~ The ``dasd`` command sets up an ECKD s390x system DASD device for use by curtin. FBA DASD devices do not require this low level set up. ECKD DASD drives can also be passed via virtio to KVM virtual machines and in this case this set up must be done on the host prior to starting the virtual machine. DASD devices require several parameters to configure the low-level structure of the block device. Curtin will examine the configuration and determine if the specified DASD matches the configuration. If the device does not match the configuration Curtin will perform a format of the device to achieve the required configuration. Once a DASD device has been formatted it may be used like regular Linux block devices and can be partitioned (with limitations) with Curtin's ``disk`` command. The ``dasd`` command may contain the following keys: **device_id**: ** The ``device_id`` value is used to select a specific DASD device. **blocksize**: *512, 1024, 2048, 4096* Specify blocksize to be used. ``blocksize`` must be a positive integer and always be a power of two. The default blocksize is 4096 bytes. .. note:: The net capacity of an ECKD™ DASD decreases for smaller block sizes. For example, a DASD formatted with a block size of 512 byte has only half of the net capacity of the same DASD formatted with a block size of 4096 byte. **mode**: *quick, full, expand* Specify the mode to be used to format the device. The default mode is ``full`` which will format the entire disk. Using ``quick`` mode will format the first two tracks and write label and partition information. Only use this option if you are sure that the target DASD has already been formatted in a ``disk_layout`` and ``blocksize`` desired. The ``expand`` mode will format all unformatted tracks at the end of the target DASD. This mode assumes that tracks at the beginning of the DASD volume have already been correctly formatted. **label**: *