Skip to main content
This guide provides an overview of the disk management features in Talos Linux.

Listing Disks

To obtain a list of all available block devices (disks) on the machine, you can use the following command:
To obtain detailed information about a specific disk, execute the following command:

Discovered Volumes

Talos Linux monitors all block devices and partitions on the machine. Details about these devices, including their type, can be found in the DiscoveredVolume resource.
Talos Linux has built-in automatic detection for various filesystem types and GPT partition tables. Currently, the following filesystem types are supported:
  • bluestore (Ceph)
  • ext2, ext3, ext4
  • iso9660
  • luks (LUKS encrypted partition)
  • lvm2
  • squashfs
  • swap
  • talosmeta (Talos Linux META partition)
  • vfat
  • xfs
  • zfs
The discovered volumes can include both Talos-managed volumes and any other volumes present on the machine, such as Ceph volumes.

Disk Layout

The default disk layout for Talos installation is as follows:
In this diagram:
  • EFI: the EFI partition used for booting the system.
  • META: the partition used for storing Talos metadata.
  • STATE: the partition used for storing the system state, including machine configuration.
  • EPHEMERAL: the partition used for storing container data, downloaded images, logs, etcd data (for controlplane nodes) etc.
Talos Linux hardcodes the partition layout for the EFI, META, and STATE partitions. The EPHEMERAL partition by default consumes all unallocated space, but it can be created on another disk or resized. The EPHEMERAL partition is a catch-all location for storing data, while it might be desired to segregate the data into different partitions. Talos supports creating additional user volumes to be used for different purposes: e.g. local storage for various applications, specific volumes per applications, etc.

Single Disk Layout

In this layout, the EPHEMERAL partition was limited to 200GB, and two additional partitions were created for ceph-data and local-storage.

Multiple Disk Layout

In this layout, the EPHEMERAL partition was limited to 500GB, and two additional partitions were created for ceph-data and local-storage, and they were created on different disks.

Volume Management

Talos Linux implements disk management through the concept of volumes. A volume represents a provisioned, located, mounted, or unmounted entity, such as a disk, partition, or a directory/overlay mount. Talos Linux provides volume configuration using the following machine configuration documents:
  • VolumeConfig: used to configure system volumes (override default values)
  • UserVolumeConfig: used to configure user volumes (extra volumes created by the user)

System Volume Configuration

EPHEMERAL Volume

Note: The volume configuration in the machine configuration is only applied when the volume has not been provisioned yet. So applying changes after the initial provisioning will not have any effect.
To configure the EPHEMERAL (/var) volume, append the following document to the machine configuration:
Every field in the VolumeConfig resource is optional, and if a field is not specified, the default value is used. The default built-in values are:
By default, the EPHEMERAL volume is provisioned on the system disk, which is the disk where Talos Linux is installed. It has a minimum size of 2 GiB and automatically grows to utilize the maximum available space on the disk. If you would like to keep the EPHEMERAL volume on the system disk but limit its size to 40 GiB, you can set the maxSize field to 40GiB:
If you want to create a separate partition for EPHEMERAL on a different disk, you can set the diskSelector field to select the desired disk:
Note: Currently, encryption for EPHEMERAL and STATE volumes is configured using another config document.

IMAGECACHE Volume

This system volume is not provisioned by default, and it only gets created if the Image Cache feature is enabled. See Image Cache configuration for more details.

User Volumes

User Volumes allow to treat available disk space as a pool of allocatable resource, which can be dynamically allocated to different applications. The user volumes are supposed to be used mostly for hostPath mounts in Kubernetes, but they can be used for other purposes as well. When a user volume configuration is applied, Talos Linux will either locate an existing volume or provision a new one. The volume will be created on the disk which satisfies the diskSelector expression and has enough free space to satisfy the minSize requirement. The user volume is identified by a unique name, which is used both as a mount location and as a label for the volume. The volume name must be unique across all user volumes, and it should be between 1 and 34 characters long, and can only contain ASCII letters, digits, and - (dash) characters. The volume label is derived from the volume name as u-<volume-name>, and it is used to identify the volume on the disk after initial provisioning. The volume mount location is /var/mnt/<volume-name>, and it gets automatically propagated into the kubelet container to provide additional features like subPath mounts. Disk encryption can be optionally enabled for user volumes.

Creating User Volumes

To create a user volume, append the following document to the machine configuration:
In this example, a user volume named ceph-data is created on the first NVMe disk which has 100GB of disk space available, and it will be created as maximum of 200GB if that space is available. The status of the volume can be checked using the following command:
If the volume fails to be provisioned, use the -o yaml flag to get additional details. The volume is immediately mounted to /var/mnt/ceph-data:
It can be used in a Kubernetes pod as a hostPath mount:
Please note, the path inside the container can be different from the path on the host.

Removing User Volumes

Before removing a user volume, ensure that it is not mounted in any Kubernetes pod. In order to remove a user volume, first remove the configuration document from the machine configuration. The VolumeStatus and MountStatus resources will be removed automatically by Talos Linux.
Note: The actual disk data hasn’t been removed yet, so you can re-apply the user volume configuration back and it will be re-provisioned on the same disk.
To wipe the disk data, and make it allocatable again, use the following command:
The nvme0n1p2 is the partition name, and it can be obtained from the VolumeStatus resource before the user volume is removed, or from the DiscoveredVolume resource any time later.
Note: If the wipe disk command fails with blockdevice is in use by volume, it means the user volume has not been removed from the machine configuration.

Common Configuration

Disk Selector

The diskSelector field is utilized to choose the disk where the volume will be provisioned. It is a Common Expression Language (CEL) expression that evaluates against the available disks. The volume will be provisioned on the first disk that matches the expression and has sufficient free space for the volume. The expression is evaluated in the following context:
  • system_disk (bool) - indicates if the disk is the system disk
  • disk (Disks.block.talos.dev) - the disk resource being evaluated
Note: The system_disk variable is only populated after Talos installation, so you might see an error about system_disk not being defined before installation finishes.
For the disk resource, any field available in the resource specification can be used (use talosctl get disks -o yaml to see the output for your machine):
Additionally, constants for disk size multipliers are available:
  • KiB, MiB, GiB, TiB, PiB, EiB - binary size multipliers (1024)
  • kB, MB, GB, TB, PB, EB - decimal size multipliers (1000)
The disk expression is evaluated against each available disk, and the expression should either return true or false. If the expression returns true, the disk is selected for provisioning.
Note: In CEL, signed and unsigned integers are not interchangeable. Disk sizes are represented as unsigned integers, so suffix u should be used in constants to avoid type mismatch, e.g. disk.size > 10u * GiB.
Examples of disk selector expressions:
  • disk.transport == 'nvme': select the NVMe disks only
  • disk.transport == 'scsi' && disk.size < 2u * TiB: select SCSI disks smaller than 2 TiB
  • disk.serial.startsWith('deadbeef') && !cdrom: select disks with serial number starting with deadbeef and not of CD-ROM type
  • '/dev/disk/by-path/pci-0000:00:1f.2-ata-1' in disk.symlinks: select disks with a specific stable symlink

Minimum, Maximum and Grow

The minSize and maxSize fields define the minimum and maximum size of the volume, respectively. Talos Linux will always ensure that the volume is at least minSize in size and will not exceed maxSize. If maxSize is not set, the volume will grow to utilize the maximum available space on the disk. The grow flag controls what happens when the volume already exists:
  • On initial creation: grow is ignored. The new volume is created between minSize and maxSize (or full disk if maxSize is unset).
  • On subsequent boots (when the volume already exists):
    • If grow: false, the existing volume size is never changed.
    • If grow: true, and the current volume is smaller than maxSize (or maxSize is unset), Talos will expand the volume to fill available space after it.

Resources

The configuration of volumes is defined using the VolumeConfig resource, while the current state of volumes is stored in the VolumeStatus resource.

Configuration

The volume configuration is managed by Talos Linux based on machine configuration. To see configured volumes, use the following command:
In the provided output, the volumes EPHEMERAL, META, and STATE are system volumes managed by Talos, while u-extra, u-p1 and u-p2 are user configured volumes. To get details about a specific volume configuration, use the following command:

Status

Current volume status can be obtained using the following command:
Each volume goes through different phases during its lifecycle:
  • waiting: the volume is waiting to be provisioned
  • missing: all disks have been discovered, but the volume cannot be found
  • located: the volume is found without prior provisioning
  • provisioned: the volume has been provisioned (e.g., partitioned, resized if necessary)
  • prepared: the encrypted volume is open
  • ready: the volume is formatted and ready to be mounted
  • closed: the encrypted volume is closed, and ready to be unmounted