Skip to main content
Talos Linux can declaratively provision Linux Logical Volume Manager (LVM) physical volumes, volume groups, and logical volumes. Use LVM when you need one or more block devices assembled into a volume group and split into logical volumes for a storage system such as a CSI driver. Talos reconciles the desired LVM state from machine configuration documents:
  • LVMVolumeGroupConfig selects existing Talos volumes or whole disks and creates the physical volumes and volume group.
  • LVMLogicalVolumeConfig creates logical volumes inside the volume group.
  • LVM status resources (pvs, vgs, and lvs) expose the final state discovered on the node.

Provision LVM storage

The simplest LVM setup is a volume group backed directly by whole disks. Use this when the entire disk should be dedicated to LVM and no Talos partition needs to be created first. The following example creates vg-pool from two whole disks and provisions a logical volume named lv-data:
Apply the configuration patch to the node:
The volume selector is a CEL expression evaluated against each discovered volume as volume. For whole disks, the expression can also use the disk variable. Use selectors that match only the intended devices: Talos initializes matched devices as LVM physical volumes. You can match disks by stable properties such as serial number, WWID, or symlink, depending on what the node reports in the Disk resource:
For production configurations, prefer stable disk identifiers over /dev/sd* names when possible. Device names can change across boots or when hardware is added or removed.

Configure volume groups

An LVMVolumeGroupConfig document requires:
  • name: the volume group name, 1-63 characters, using ASCII letters, digits, hyphens, and underscores.
  • provisioning.volumeSelector.match: a CEL expression selecting the disks or partitions to use as physical volumes.
Example:
Talos creates one LVMPhysicalVolumeSpec for each matched device, then creates or extends the volume group so it contains those physical volumes. If a selector conflict cannot be resolved, Talos reports it with an LVMValidationError resource.

Configure logical volumes

An LVMLogicalVolumeConfig document requires:
  • name: the logical volume name, 1-63 characters, using ASCII letters, digits, hyphens, and underscores.
  • type: one of linear, raid0, raid1, or raid10.
  • provisioning.volumeGroup: the target volume group name.
  • provisioning.maxSize: the desired maximum size, either an absolute size such as 50GiB or a percentage of the volume group such as 80%.
Optional fields:
  • provisioning.minSize: minimum acceptable size when using an absolute maxSize.
  • mirrors: number of mirror copies for raid1 and raid10; defaults to 1 when unset.
  • stripes: number of stripes for raid0 and raid10; defaults to all available physical volumes when unset and must be at least 2 when set.
Example:
Talos creates the logical volume and activates it. The status resource shows its device path, for example /dev/vg-pool/lv-data. Talos does not format or mount the logical volume through the LVM configuration itself; configure the consumer of the block device separately.

Use raw volume partitions as physical volumes

Instead of selecting whole disks directly, an LVM volume group can be backed by Talos raw volume partitions. This is useful when Talos should first allocate partitions from available disk space, and LVM should use those partitions as physical volumes. The following example creates two raw volumes and selects their partition labels for vg-pool:
Raw volume names are prefixed with r- when Talos creates their partition labels. In this example, the LVMVolumeGroupConfig selector matches the raw volume partitions labeled r-lvm-a and r-lvm-b. A logical volume can also back a Talos user volume. For details, see User Volumes.

Inspect LVM state

Use the LVM status resource aliases to inspect physical volumes, volume groups, and logical volumes.
For detailed output, request YAML:
To debug desired state and validation errors, inspect the LVM spec and error resources:

Remove LVM resources

First remove the LVMLogicalVolumeConfig and LVMVolumeGroupConfig documents from the machine configuration. If the documents remain in configuration, Talos will reconcile them again. Then remove the on-disk LVM objects with talosctl wipe:
Removing a volume group is destructive: Talos removes every logical volume in the group before removing the group itself. The physical volume labels remain until they are wiped with talosctl wipe pv.