{ "$comment": "Based on doc/auto_storage.md", "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://github.com/agama-project/agama/blob/master/rust/share/storage.schema.json", "title": "Config", "description": "Storage config.", "type": "object", "additionalProperties": false, "properties": { "boot": { "$ref": "#/$defs/boot" }, "drives": { "description": "Drives (disks, BIOS RAIDs and multipath devices).", "type": "array", "items": { "$ref": "#/$defs/driveElement" } }, "volumeGroups": { "description": "LVM volume groups.", "type": "array", "items": { "$ref": "#/$defs/volumeGroup" } }, "mdRaids": { "description": "MD RAIDs.", "type": "array", "items": { "$ref": "#/$defs/mdRaidElement" } } }, "$defs": { "boot": { "description": "Allows configuring boot partitions automatically.", "type": "object", "additionalProperties": false, "required": ["configure"], "properties": { "configure": { "description": "Whether to configure partitions for booting.", "type": "boolean" }, "device": { "$ref": "#/$defs/alias" } } }, "driveElement": { "anyOf": [ { "$ref": "#/$defs/nonPartitionedDrive" }, { "$ref": "#/$defs/partitionedDrive" } ] }, "nonPartitionedDrive": { "description": "Drive without a partition table (e.g., directly formatted).", "type": "object", "additionalProperties": false, "properties": { "search": { "$ref": "#/$defs/driveSearch" }, "alias": { "$ref": "#/$defs/alias" }, "encryption": { "$ref": "#/$defs/encryption" }, "filesystem": { "$ref": "#/$defs/filesystem" } } }, "partitionedDrive": { "type": "object", "additionalProperties": false, "required": ["partitions"], "properties": { "search": { "$ref": "#/$defs/driveSearch" }, "alias": { "$ref": "#/$defs/alias" }, "ptableType": { "$ref": "#/$defs/ptableType" }, "partitions": { "type": "array", "items": { "$ref": "#/$defs/partitionElement" } } } }, "mdRaidElement": { "anyOf": [ { "$ref": "#/$defs/nonPartitionedMdRaid" }, { "$ref": "#/$defs/partitionedMdRaid" } ] }, "nonPartitionedMdRaid": { "description": "MD RAID without a partition table (e.g., directly formatted).", "type": "object", "additionalProperties": false, "properties": { "search": { "$ref": "#/$defs/mdRaidSearch" }, "alias": { "$ref": "#/$defs/alias" }, "name": { "$ref": "#/$defs/baseName" }, "level": { "$ref": "#/$defs/mdRaidLevel" }, "parity": { "$ref": "#/$defs/mdRaidParity" }, "chunkSize": { "$ref": "#/$defs/sizeValue" }, "devices": { "$ref": "#/$defs/mdRaidDevices" }, "encryption": { "$ref": "#/$defs/encryption" }, "filesystem": { "$ref": "#/$defs/filesystem" } } }, "partitionedMdRaid": { "type": "object", "additionalProperties": false, "required": ["partitions"], "properties": { "search": { "$ref": "#/$defs/mdRaidSearch" }, "alias": { "$ref": "#/$defs/alias" }, "name": { "$ref": "#/$defs/baseName" }, "level": { "$ref": "#/$defs/mdRaidLevel" }, "parity": { "$ref": "#/$defs/mdRaidParity" }, "chunkSize": { "$ref": "#/$defs/sizeValue" }, "devices": { "$ref": "#/$defs/mdRaidDevices" }, "ptableType": { "$ref": "#/$defs/ptableType" }, "partitions": { "type": "array", "items": { "$ref": "#/$defs/partitionElement" } } } }, "mdRaidLevel": { "title": "MD level", "enum": [ "raid0", "raid1", "raid5", "raid6", "raid10" ] }, "mdRaidParity": { "title": "MD parity", "description": "Only applies to raid5, raid6 and raid10", "enum": [ "left_asymmetric", "left_symmetric", "right_asymmetric", "right_symmetric", "first", "last", "near_2", "offset_2", "far_2", "near_3", "offset_3", "far_3" ] }, "mdRaidDevices": { "description": "Devices used by the MD RAID.", "type": "array", "items": { "$ref": "#/$defs/alias" } }, "ptableType": { "description": "Partition table type.", "$comment": "The partition table is created only if all the current partitions are deleted.", "enum": ["gpt", "msdos", "dasd"] }, "partitionElement": { "anyOf": [ { "$ref": "#/$defs/simpleVolumesGenerator" }, { "$ref": "#/$defs/advancedPartitionsGenerator" }, { "$ref": "#/$defs/regularPartition" }, { "$ref": "#/$defs/partitionToDelete" }, { "$ref": "#/$defs/partitionToDeleteIfNeeded" } ] }, "simpleVolumesGenerator": { "description": "Automatically creates the default or mandatory volumes configured by the selected product.", "type": "object", "additionalProperties": false, "required": ["generate"], "properties": { "generate": { "enum": ["default", "mandatory"] } } }, "advancedPartitionsGenerator": { "description": "Creates the default or mandatory partitions configured by the selected product.", "type": "object", "additionalProperties": false, "required": ["generate"], "properties": { "generate": { "type": "object", "additionalProperties": false, "required": ["partitions"], "properties": { "partitions": { "enum": ["default", "mandatory"] }, "encryption": { "$ref": "#/$defs/encryption" } } } } }, "regularPartition": { "type": "object", "additionalProperties": false, "properties": { "search": { "$ref": "#/$defs/partitionSearch" }, "alias": { "$ref": "#/$defs/alias" }, "id": { "title": "Partition id", "enum": [ "linux", "swap", "lvm", "raid", "esp", "prep", "bios_boot" ] }, "size": { "$ref": "#/$defs/size" }, "encryption": { "$ref": "#/$defs/encryption" }, "filesystem": { "$ref": "#/$defs/filesystem" } } }, "partitionToDelete": { "type": "object", "additionalProperties": false, "required": ["delete", "search"], "properties": { "search": { "$ref": "#/$defs/deletePartitionSearch" }, "delete": { "description": "Delete the partition.", "const": true } } }, "partitionToDeleteIfNeeded": { "type": "object", "additionalProperties": false, "required": ["deleteIfNeeded", "search"], "properties": { "search": { "$ref": "#/$defs/deletePartitionSearch" }, "deleteIfNeeded": { "description": "Delete the partition if needed to make space.", "const": true }, "size": { "$ref": "#/$defs/size" } } }, "volumeGroup": { "description": "LVM volume group.", "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "$ref": "#/$defs/baseName" }, "search": { "$ref": "#/$defs/volumeGroupSearch" }, "extentSize": { "$ref": "#/$defs/sizeValue" }, "physicalVolumes": { "description": "Devices to use as physical volumes.", "type": "array", "items": { "$ref": "#/$defs/physicalVolumeElement" } }, "logicalVolumes": { "type": "array", "items": { "$ref": "#/$defs/logicalVolumeElement" } } } }, "physicalVolumeElement": { "anyOf": [ { "$ref": "#/$defs/alias" }, { "$ref": "#/$defs/simplePhysicalVolumesGenerator" }, { "$ref": "#/$defs/advancedPhysicalVolumesGenerator" } ] }, "simplePhysicalVolumesGenerator": { "description": "Automatically creates the needed physical volumes in the indicated devices.", "type": "object", "additionalProperties": false, "required": ["generate"], "properties": { "generate": { "type": "array", "items": { "$ref": "#/$defs/alias" } } } }, "advancedPhysicalVolumesGenerator": { "description": "Automatically creates the needed physical volumes in the indicated devices.", "type": "object", "additionalProperties": false, "required": ["generate"], "properties": { "generate": { "type": "object", "additionalProperties": false, "required": ["targetDevices"], "properties": { "targetDevices": { "type": "array", "items": { "$ref": "#/$defs/alias" } }, "spacePolicy": { "description": "Policy for creating physical volumes: either using all the available space or only the needed space for allocating the logical volumes.", "enum": ["useNeeded", "useAvailable"], "default": "useNeeded" }, "encryption": { "$ref": "#/$defs/encryption" } } } } }, "logicalVolumeElement": { "anyOf": [ { "$ref": "#/$defs/simpleVolumesGenerator" }, { "$ref": "#/$defs/advancedLogicalVolumesGenerator" }, { "$ref": "#/$defs/logicalVolume" }, { "$ref": "#/$defs/thinPoolLogicalVolume" }, { "$ref": "#/$defs/thinLogicalVolume" }, { "$ref": "#/$defs/logicalVolumeToDelete" }, { "$ref": "#/$defs/logicalVolumeToDeleteIfNeeded" } ] }, "advancedLogicalVolumesGenerator": { "description": "Automatically creates the default or mandatory logical volumes configured by the selected product.", "type": "object", "additionalProperties": false, "required": ["generate"], "properties": { "generate": { "type": "object", "additionalProperties": false, "required": ["logicalVolumes"], "properties": { "logicalVolumes": { "enum": ["default", "mandatory"] }, "encryption": { "$ref": "#/$defs/encryption" }, "stripes": { "$ref": "#/$defs/logicalVolumeStripes" }, "stripeSize": { "$ref": "#/$defs/sizeValue" } } } } }, "logicalVolume": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/baseName" }, "search": { "$ref": "#/$defs/logicalVolumeSearch" }, "size": { "$ref": "#/$defs/size" }, "stripes": { "$ref": "#/$defs/logicalVolumeStripes" }, "stripeSize": { "$ref": "#/$defs/sizeValue" }, "encryption": { "$ref": "#/$defs/encryption" }, "filesystem": { "$ref": "#/$defs/filesystem" } } }, "thinPoolLogicalVolume": { "type": "object", "additionalProperties": false, "required": ["pool"], "properties": { "pool": { "description": "LVM thin pool.", "const": true }, "alias": { "$ref": "#/$defs/alias" }, "name": { "$ref": "#/$defs/baseName" }, "size": { "$ref": "#/$defs/size" }, "stripes": { "$ref": "#/$defs/logicalVolumeStripes" }, "stripeSize": { "$ref": "#/$defs/sizeValue" }, "encryption": { "$ref": "#/$defs/encryption" } } }, "thinLogicalVolume": { "type": "object", "additionalProperties": false, "required": ["usedPool"], "properties": { "name": { "$ref": "#/$defs/baseName" }, "size": { "$ref": "#/$defs/size" }, "usedPool": { "$ref": "#/$defs/alias" }, "encryption": { "$ref": "#/$defs/encryption" }, "filesystem": { "$ref": "#/$defs/filesystem" } } }, "logicalVolumeToDelete": { "type": "object", "additionalProperties": false, "required": ["delete", "search"], "properties": { "search": { "$ref": "#/$defs/deleteLogicalVolumeSearch" }, "delete": { "description": "Delete the logical volume.", "const": true } } }, "logicalVolumeToDeleteIfNeeded": { "type": "object", "additionalProperties": false, "required": ["deleteIfNeeded", "search"], "properties": { "search": { "$ref": "#/$defs/deleteLogicalVolumeSearch" }, "deleteIfNeeded": { "description": "Delete the logical volume if needed to make space.", "const": true }, "size": { "$ref": "#/$defs/size" } } }, "logicalVolumeStripes": { "description": "Number of stripes.", "type": "integer", "minimum": 1, "maximum": 128 }, "searchSortCriterionOrder": { "description": "Direction of sorting at the search results", "enum": ["asc", "desc"] }, "driveSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/driveAdvancedSearch" } ] }, "driveAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/driveSearchCondition" }, "sort": { "$ref": "#/$defs/driveSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchActions" } } }, "driveSearchCondition": { "anyOf": [ { "$ref": "#/$defs/searchConditionName" }, { "$ref": "#/$defs/searchConditionSize" }, { "$ref": "#/$defs/searchConditionDriver" }, { "$ref": "#/$defs/searchConditionBoss" }, { "$ref": "#/$defs/searchConditionFilesystem" }, { "$ref": "#/$defs/searchConditionPartitions" }, { "$ref": "#/$defs/driveSearchConditionAnd" }, { "$ref": "#/$defs/driveSearchConditionOr" }, { "$ref": "#/$defs/driveSearchConditionNot" } ] }, "driveSearchConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/driveSearchCondition" }, "minItems": 2 } } }, "driveSearchConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/driveSearchCondition" }, "minItems": 2 } } }, "driveSearchConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/driveSearchCondition" } } }, "driveSearchSort": { "anyOf": [ { "$ref": "#/$defs/driveSearchSortCriterion" }, { "type": "array", "items": { "$ref": "#/$defs/driveSearchSortCriterion" } } ] }, "driveSearchSortCriterion": { "anyOf": [ { "$ref": "#/$defs/driveSearchSortCriterionShort" }, { "$ref": "#/$defs/driveSearchSortCriterionFull" } ] }, "driveSearchSortCriterionShort": { "enum": ["name", "size"] }, "driveSearchSortCriterionFull": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/searchSortCriterionOrder" }, "size": { "$ref": "#/$defs/searchSortCriterionOrder" } }, "minProperties": 1, "maxProperties": 1 }, "mdRaidSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/mdRaidAdvancedSearch" } ] }, "mdRaidAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/mdRaidSearchCondition" }, "sort": { "$ref": "#/$defs/mdRaidSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchCreatableActions" } } }, "mdRaidSearchCondition": { "anyOf": [ { "$ref": "#/$defs/searchConditionName" }, { "$ref": "#/$defs/searchConditionSize" }, { "$ref": "#/$defs/searchConditionFilesystem" }, { "$ref": "#/$defs/searchConditionPartitions" }, { "$ref": "#/$defs/mdRaidSearchConditionAnd" }, { "$ref": "#/$defs/mdRaidSearchConditionOr" }, { "$ref": "#/$defs/mdRaidSearchConditionNot" } ] }, "mdRaidSearchConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/mdRaidSearchCondition" }, "minItems": 2 } } }, "mdRaidSearchConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/mdRaidSearchCondition" }, "minItems": 2 } } }, "mdRaidSearchConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/mdRaidSearchCondition" } } }, "mdRaidSearchSort": { "anyOf": [ { "$ref": "#/$defs/mdRaidSearchSortCriterion" }, { "type": "array", "items": { "$ref": "#/$defs/mdRaidSearchSortCriterion" } } ] }, "mdRaidSearchSortCriterion": { "anyOf": [ { "$ref": "#/$defs/mdRaidSearchSortCriterionShort" }, { "$ref": "#/$defs/mdRaidSearchSortCriterionFull" } ] }, "mdRaidSearchSortCriterionShort": { "enum": ["name", "size"] }, "mdRaidSearchSortCriterionFull": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/searchSortCriterionOrder" }, "size": { "$ref": "#/$defs/searchSortCriterionOrder" } }, "minProperties": 1, "maxProperties": 1 }, "volumeGroupSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/volumeGroupAdvancedSearch" } ] }, "volumeGroupAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/volumeGroupSearchCondition" }, "sort": { "$ref": "#/$defs/volumeGroupSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchCreatableActions" } } }, "volumeGroupSearchCondition": { "anyOf": [ { "$ref": "#/$defs/searchConditionName" }, { "$ref": "#/$defs/searchConditionSize" }, { "$ref": "#/$defs/volumeGroupSearchConditionAnd" }, { "$ref": "#/$defs/volumeGroupSearchConditionOr" }, { "$ref": "#/$defs/volumeGroupSearchConditionNot" } ] }, "volumeGroupSearchConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/volumeGroupSearchCondition" }, "minItems": 2 } } }, "volumeGroupSearchConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/volumeGroupSearchCondition" }, "minItems": 2 } } }, "volumeGroupSearchConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/volumeGroupSearchCondition" } } }, "volumeGroupSearchSort": { "anyOf": [ { "$ref": "#/$defs/volumeGroupSearchSortCriterion" }, { "type": "array", "items": { "$ref": "#/$defs/volumeGroupSearchSortCriterion" } } ] }, "volumeGroupSearchSortCriterion": { "anyOf": [ { "$ref": "#/$defs/volumeGroupSearchSortCriterionShort" }, { "$ref": "#/$defs/volumeGroupSearchSortCriterionFull" } ] }, "volumeGroupSearchSortCriterionShort": { "enum": ["name", "size"] }, "volumeGroupSearchSortCriterionFull": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/searchSortCriterionOrder" }, "size": { "$ref": "#/$defs/searchSortCriterionOrder" } }, "minProperties": 1, "maxProperties": 1 }, "partitionSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/partitionAdvancedSearch" } ] }, "partitionAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/partitionSearchCondition" }, "sort": { "$ref": "#/$defs/partitionSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchCreatableActions" } } }, "deletePartitionSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/deletePartitionAdvancedSearch" } ] }, "deletePartitionAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/partitionSearchCondition" }, "sort": { "$ref": "#/$defs/partitionSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchActions" } } }, "partitionSearchCondition": { "anyOf": [ { "$ref": "#/$defs/searchConditionName" }, { "$ref": "#/$defs/searchConditionSize" }, { "$ref": "#/$defs/searchConditionPartitionNumber" }, { "$ref": "#/$defs/searchConditionPartitionId" }, { "$ref": "#/$defs/searchConditionFilesystem" }, { "$ref": "#/$defs/partitionSearchConditionAnd" }, { "$ref": "#/$defs/partitionSearchConditionOr" }, { "$ref": "#/$defs/partitionSearchConditionNot" } ] }, "partitionSearchConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/partitionSearchCondition" }, "minItems": 2 } } }, "partitionSearchConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/partitionSearchCondition" }, "minItems": 2 } } }, "partitionSearchConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/partitionSearchCondition" } } }, "logicalVolumeSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/logicalVolumeAdvancedSearch" } ] }, "logicalVolumeAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/logicalVolumeSearchCondition" }, "sort": { "$ref": "#/$defs/logicalVolumeSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchCreatableActions" } } }, "deleteLogicalVolumeSearch": { "anyOf": [ { "$ref": "#/$defs/searchAll" }, { "$ref": "#/$defs/searchName" }, { "$ref": "#/$defs/deleteLogicalVolumeAdvancedSearch" } ] }, "deleteLogicalVolumeAdvancedSearch": { "type": "object", "additionalProperties": false, "properties": { "condition": { "$ref": "#/$defs/logicalVolumeSearchCondition" }, "sort": { "$ref": "#/$defs/logicalVolumeSearchSort" }, "max": { "$ref": "#/$defs/searchMax" }, "ifNotFound": { "$ref": "#/$defs/searchActions" } } }, "logicalVolumeSearchCondition": { "anyOf": [ { "$ref": "#/$defs/searchConditionName" }, { "$ref": "#/$defs/searchConditionSize" }, { "$ref": "#/$defs/searchConditionFilesystem" }, { "$ref": "#/$defs/logicalVolumeSearchConditionAnd" }, { "$ref": "#/$defs/logicalVolumeSearchConditionOr" }, { "$ref": "#/$defs/logicalVolumeSearchConditionNot" } ] }, "logicalVolumeSearchConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/logicalVolumeSearchCondition" }, "minItems": 2 } } }, "logicalVolumeSearchConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/logicalVolumeSearchCondition" }, "minItems": 2 } } }, "logicalVolumeSearchConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/logicalVolumeSearchCondition" } } }, "searchConditionName": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "$ref": "#/$defs/searchName" } } }, "searchConditionSize": { "type": "object", "additionalProperties": false, "required": ["size"], "properties": { "size": { "anyOf": [ { "$ref": "#/$defs/sizeValue" }, { "$ref": "#/$defs/searchConditionSizeEqual" }, { "$ref": "#/$defs/searchConditionSizeGreater" }, { "$ref": "#/$defs/searchConditionSizeLess" } ] } } }, "searchConditionSizeEqual": { "type": "object", "additionalProperties": false, "required": ["equal"], "properties": { "equal": { "$ref": "#/$defs/sizeValue" } } }, "searchConditionSizeGreater": { "type": "object", "additionalProperties": false, "required": ["greater"], "properties": { "greater": { "$ref": "#/$defs/sizeValue" } } }, "searchConditionSizeLess": { "type": "object", "additionalProperties": false, "required": ["less"], "properties": { "less": { "$ref": "#/$defs/sizeValue" } } }, "searchConditionDriver": { "type": "object", "additionalProperties": false, "required": ["driver"], "properties": { "driver": { "description": "Matches devices handled by the given kernel driver, as reported by hwinfo. A device can be handled by several drivers; the condition matches if any of them is the given one. Do not confuse with driver_modules, which values usually use underscore (virtio-pci vs virtio_pci) and subfix (ahci vs ahci_mod).", "type": "string", "examples": ["ahci", "sd"] } } }, "searchConditionBoss": { "type": "object", "additionalProperties": false, "required": ["boss"], "properties": { "boss": { "description": "Whether the device is a BOSS (Boot Optimized Storage Solution) device, a technology introduced by Dell. Use false to match any other device.", "type": "boolean" } } }, "searchConditionPartitionNumber": { "type": "object", "additionalProperties": false, "required": ["number"], "properties": { "number": { "description": "Partition number (e.g., 1 for vda1).", "type": "integer", "minimum": 1 } } }, "searchConditionPartitionId": { "type": "object", "additionalProperties": false, "required": ["id"], "properties": { "id": { "$ref": "#/$defs/partitionIdAny" } } }, "partitionIdAny": { "title": "Partition id", "description": "Any partition id managed by libstorage-ng. Some ids are only valid for a given partition table type.", "enum": [ "dos12", "dos16", "ntfs", "dos32", "extended", "diag", "prep", "swap", "linux", "irst", "lvm", "raid", "xbootldr", "esp", "bios_boot", "windows_basic_data", "microsoft_reserved", "linux_home", "linux_server_data", "linux_root_arm", "linux_root_aarch64", "linux_root_ppc32", "linux_root_ppc64be", "linux_root_ppc64le", "linux_root_riscv32", "linux_root_riscv64", "linux_root_s390", "linux_root_s390x", "linux_root_x86", "linux_root_x86_64", "linux_usr_arm", "linux_usr_aarch64", "linux_usr_ppc32", "linux_usr_ppc64be", "linux_usr_ppc64le", "linux_usr_riscv32", "linux_usr_riscv64", "linux_usr_s390", "linux_usr_s390x", "linux_usr_x86", "linux_usr_x86_64" ] }, "searchConditionFilesystem": { "type": "object", "additionalProperties": false, "required": ["filesystem"], "properties": { "filesystem": { "anyOf": [ { "$ref": "#/$defs/searchFilesystemPresence" }, { "$ref": "#/$defs/filesystemCondition" } ] } } }, "searchFilesystemPresence": { "description": "Shortcut to match by filesystem presence: \"any\" matches formatted devices, \"none\" matches unformatted ones.", "enum": ["any", "none"] }, "filesystemCondition": { "description": "Matches formatted devices whose file system satisfies the condition.", "anyOf": [ { "$ref": "#/$defs/filesystemConditionType" }, { "$ref": "#/$defs/filesystemConditionLabel" }, { "$ref": "#/$defs/filesystemConditionAnd" }, { "$ref": "#/$defs/filesystemConditionOr" }, { "$ref": "#/$defs/filesystemConditionNot" } ] }, "filesystemConditionType": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "$ref": "#/$defs/filesystemTypeAny" } } }, "filesystemConditionLabel": { "type": "object", "additionalProperties": false, "required": ["label"], "properties": { "label": { "description": "File system label.", "type": "string" } } }, "filesystemConditionAnd": { "type": "object", "additionalProperties": false, "required": ["and"], "properties": { "and": { "description": "Matches when all the nested conditions match.", "type": "array", "items": { "$ref": "#/$defs/filesystemCondition" }, "minItems": 2 } } }, "filesystemConditionOr": { "type": "object", "additionalProperties": false, "required": ["or"], "properties": { "or": { "description": "Matches when any of the nested conditions matches.", "type": "array", "items": { "$ref": "#/$defs/filesystemCondition" }, "minItems": 2 } } }, "filesystemConditionNot": { "type": "object", "additionalProperties": false, "required": ["not"], "properties": { "not": { "description": "Matches when the nested condition does not match.", "$ref": "#/$defs/filesystemCondition" } } }, "searchConditionPartitions": { "type": "object", "additionalProperties": false, "required": ["partitions"], "properties": { "partitions": { "anyOf": [ { "$ref": "#/$defs/searchPartitionsPresence" }, { "$ref": "#/$defs/partitionsQuantifier" } ] } } }, "searchPartitionsPresence": { "description": "Shortcut to match by partitions presence: \"any\" matches devices with at least one partition, \"none\" matches devices with no partitions.", "enum": ["any", "none"] }, "partitionsQuantifier": { "description": "Matches devices whose partitions satisfy the quantifier.", "anyOf": [ { "$ref": "#/$defs/partitionsQuantifierAny" }, { "$ref": "#/$defs/partitionsQuantifierNone" }, { "$ref": "#/$defs/partitionsQuantifierAll" }, { "$ref": "#/$defs/partitionsQuantifierCount" } ] }, "partitionsQuantifierAny": { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "description": "Matches when at least one partition satisfies the condition.", "$ref": "#/$defs/partitionSearchCondition" } } }, "partitionsQuantifierNone": { "type": "object", "additionalProperties": false, "required": ["none"], "properties": { "none": { "description": "Matches when no partition satisfies the condition.", "$ref": "#/$defs/partitionSearchCondition" } } }, "partitionsQuantifierAll": { "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "description": "Matches when there is at least one partition and all partitions satisfy the condition.", "$ref": "#/$defs/partitionSearchCondition" } } }, "partitionsQuantifierCount": { "type": "object", "additionalProperties": false, "required": ["count"], "properties": { "count": { "$ref": "#/$defs/partitionsCount" } } }, "partitionsCount": { "type": "object", "additionalProperties": false, "anyOf": [ { "required": ["min"] }, { "required": ["max"] } ], "properties": { "condition": { "description": "Optional condition; omit to count all partitions.", "$ref": "#/$defs/partitionSearchCondition" }, "min": { "description": "Minimum number of matching partitions (must be >= 1).", "type": "integer", "minimum": 1 }, "max": { "description": "Maximum number of matching partitions (must be >= 1).", "type": "integer", "minimum": 1 } } }, "partitionSearchSort": { "anyOf": [ { "$ref": "#/$defs/partitionSearchSortCriterion" }, { "type": "array", "items": { "$ref": "#/$defs/partitionSearchSortCriterion" } } ] }, "partitionSearchSortCriterion": { "anyOf": [ { "$ref": "#/$defs/partitionSearchSortCriterionShort" }, { "$ref": "#/$defs/partitionSearchSortCriterionFull" } ] }, "partitionSearchSortCriterionShort": { "enum": ["name", "size", "number"] }, "partitionSearchSortCriterionFull": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/searchSortCriterionOrder" }, "size": { "$ref": "#/$defs/searchSortCriterionOrder" }, "number": { "$ref": "#/$defs/searchSortCriterionOrder" } }, "minProperties": 1, "maxProperties": 1 }, "logicalVolumeSearchSort": { "anyOf": [ { "$ref": "#/$defs/logicalVolumeSearchSortCriterion" }, { "type": "array", "items": { "$ref": "#/$defs/logicalVolumeSearchSortCriterion" } } ] }, "logicalVolumeSearchSortCriterion": { "anyOf": [ { "$ref": "#/$defs/logicalVolumeSearchSortCriterionShort" }, { "$ref": "#/$defs/logicalVolumeSearchSortCriterionFull" } ] }, "logicalVolumeSearchSortCriterionShort": { "enum": ["name", "size"] }, "logicalVolumeSearchSortCriterionFull": { "type": "object", "additionalProperties": false, "properties": { "name": { "$ref": "#/$defs/searchSortCriterionOrder" }, "size": { "$ref": "#/$defs/searchSortCriterionOrder" } }, "minProperties": 1, "maxProperties": 1 }, "searchMax": { "description": "Maximum devices to match.", "type": "integer", "minimum": 1 }, "searchActions": { "description": "How to handle the section if the device is not found.", "enum": ["skip", "error"], "default": "error" }, "searchCreatableActions": { "description": "How to handle the section if the device is not found.", "enum": ["skip", "error", "create"], "default": "error" }, "searchAll": { "description": "Shortcut to match all devices if there is any (equivalent to specify no conditions and to skip the entry if no device is found).", "const": "*" }, "searchName": { "description": "Search by device name", "type": "string", "examples": ["/dev/vda", "/dev/disk/by-id/ata-WDC_WD3200AAKS-75L9"] }, "alias": { "description": "Alias used to reference a device.", "type": "string" }, "baseName": { "description": "Device base name.", "type": "string", "pattern": "^[^/]+$", "examples": ["system"] }, "size": { "title": "Size", "anyOf": [ { "$ref": "#/$defs/sizeValue" }, { "title": "Size tuple", "description": "Lower size limit and optionally upper size limit.", "type": "array", "items": { "$ref": "#/$defs/sizeValueWithCurrent" }, "minItems": 1, "maxItems": 2, "examples": [ [1024, "current"], ["1 GiB", "5 GiB"], [1024, "2 GiB"], ["2 GiB"] ] }, { "title": "Size range", "description": "Size range.", "type": "object", "additionalProperties": false, "required": ["min"], "properties": { "min": { "$ref": "#/$defs/sizeValueWithCurrent" }, "max": { "$ref": "#/$defs/sizeValueWithCurrent" } } } ] }, "sizeValue": { "anyOf": [ { "$ref": "#/$defs/sizeString" }, { "$ref": "#/$defs/sizeBytes" } ] }, "sizeValueWithCurrent": { "anyOf": [ { "$ref": "#/$defs/sizeValue" }, { "title": "Size current", "description": "The current size of the device.", "const": "current" } ] }, "sizeString": { "description": "Human readable size.", "type": "string", "pattern": "^[0-9]+(\\.[0-9]+)?(\\s*([KkMmGgTtPpEeZzYy][iI]?)?[Bb])?$", "examples": ["2 GiB", "1.5 TB", "1TIB", "1073741824 b", "1073741824"] }, "sizeBytes": { "description": "Size in bytes.", "type": "integer", "minimum": 0, "examples": [1024, 2048] }, "encryption": { "anyOf": [ { "$ref": "#/$defs/encryptionLuks1" }, { "$ref": "#/$defs/encryptionLuks2" }, { "$ref": "#/$defs/encryptionPervasiveLuks2" }, { "$ref": "#/$defs/encryptionTpmFde" }, { "$ref": "#/$defs/encryptionSwap" } ] }, "encryptionLuks1": { "description": "LUKS1 encryption.", "type": "object", "additionalProperties": false, "required": ["luks1"], "properties": { "luks1": { "type": "object", "additionalProperties": false, "required": ["password"], "properties": { "password": { "$ref": "#/$defs/encryptionPassword" }, "cipher": { "$ref": "#/$defs/encryptionCipher" }, "keySize": { "$ref": "#/$defs/encryptionKeySize" } } } } }, "encryptionLuks2": { "description": "LUKS2 encryption.", "type": "object", "additionalProperties": false, "required": ["luks2"], "properties": { "luks2": { "type": "object", "additionalProperties": false, "required": ["password"], "properties": { "password": { "$ref": "#/$defs/encryptionPassword" }, "cipher": { "$ref": "#/$defs/encryptionCipher" }, "keySize": { "$ref": "#/$defs/encryptionKeySize" }, "pbkdFunction": { "$ref": "#/$defs/encryptionPbkdFunction" }, "label": { "description": "LUKS2 label.", "type": "string" }, "tpm": { "description": "Whether to use TPM2 unlocking.", "type": "boolean", "default": false } } } } }, "encryptionPervasiveLuks2": { "description": "LUKS2 pervasive encryption.", "type": "object", "additionalProperties": false, "required": ["pervasiveLuks2"], "properties": { "pervasiveLuks2": { "type": "object", "additionalProperties": false, "required": ["password"], "properties": { "password": { "$ref": "#/$defs/encryptionPassword" }, "apqns": { "description": "List of APQNs used to generate secure keys.", "type": "array", "items": { "examples": ["01.0001", "01.0002"], "type": "string" } }, "keyType": { "description": "Type of the generated secure key.", "enum": ["EP11-AES", "CCA-AESCIPHER", "CCA-AESDATA"] } } } } }, "encryptionTpmFde": { "deprecated": true, "description": "TPM-Based Full Disk Encryption.", "type": "object", "additionalProperties": false, "required": ["tpmFde"], "properties": { "tpmFde": { "type": "object", "additionalProperties": false, "required": ["password"], "properties": { "password": { "$ref": "#/$defs/encryptionPassword" } } } } }, "encryptionSwap": { "description": "Swap encryptions. The snake case names are deprecated.", "enum": ["protected_swap", "secure_swap", "random_swap", "protectedSwap", "secureSwap", "randomSwap"] }, "encryptionPassword": { "description": "Password to use when creating a new encryption device.", "type": "string" }, "encryptionCipher": { "description": "The value must be compatible with the --cipher argument of the command cryptsetup.", "type": "string" }, "encryptionKeySize": { "description": "The value (in bits) has to be a multiple of 8. The possible key sizes are limited by the used cipher.", "type": "integer" }, "encryptionPbkdFunction": { "enum": ["pbkdf2", "argon2i", "argon2id"] }, "filesystem": { "type": "object", "additionalProperties": false, "properties": { "reuseIfPossible": { "description": "Try to reuse the existing file system. In some cases the file system could not be reused, for example, if the device is re-encrypted.", "type": "boolean", "default": false }, "type": { "$ref": "#/$defs/filesystemType" }, "label": { "description": "File system label.", "type": "string" }, "path": { "description": "Mount path.", "type": "string", "examples": ["/var/log"] }, "mountBy": { "title": "Mount by", "description": "How to mount the device.", "enum": ["device", "id", "label", "path", "uuid"] }, "mkfsExtraArguments": { "description": "Additional arguments injected as-is to the mkfs command when creating the file system.", "type": "string" }, "mkfsOptions": { "deprecated": true, "description": "Deprecated in favor of mkfsExtraArguments", "type": "array", "items": { "type": "string" } }, "mountOptions": { "description": "Options to add to the fourth field of fstab.", "type": "array", "items": { "type": "string" } } } }, "filesystemType": { "anyOf": [ { "$ref": "#/$defs/filesystemTypeAny" }, { "$ref": "#/$defs/filesystemTypeBtrfs" } ] }, "filesystemTypeAny": { "enum": [ "bcachefs", "btrfs", "exfat", "ext2", "ext3", "ext4", "f2fs", "jfs", "nfs", "nilfs2", "ntfs", "reiserfs", "swap", "tmpfs", "vfat", "xfs" ] }, "filesystemTypeBtrfs": { "description": "Btrfs file system.", "type": "object", "additionalProperties": false, "required": ["btrfs"], "properties": { "btrfs": { "type": "object", "additionalProperties": false, "properties": { "snapshots": { "description": "Whether to configrue Btrfs snapshots.", "type": "boolean" } } } } } } }