> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siderolabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Raw Volumes

> Configuring raw volumes to allocate unformatted storage.

export const VersionWarningBanner = () => {
  const latestVersion = "v1.13";
  const [latestUrl, setLatestUrl] = useState(null);
  const [currentVersion, setCurrentVersion] = useState(null);
  const [isBeta, setIsBeta] = useState(false);
  const parseVersion = v => v.replace("v", "").split(".").map(Number);
  const isGreaterVersion = (a, b) => {
    const [aMajor, aMinor] = parseVersion(a);
    const [bMajor, bMinor] = parseVersion(b);
    if (aMajor > bMajor) return true;
    if (aMajor === bMajor && aMinor > bMinor) return true;
    return false;
  };
  useEffect(() => {
    if (typeof window === "undefined") return;
    const {pathname, hash, search} = window.location;
    const match = pathname.match(/\/talos\/(v\d+\.\d+)\//);
    if (!match) return;
    const detectedVersion = match[1];
    if (detectedVersion === latestVersion) return;
    setCurrentVersion(detectedVersion);
    if (isGreaterVersion(detectedVersion, latestVersion)) {
      setIsBeta(true);
    }
    const newPath = pathname.replace(`/talos/${detectedVersion}/`, `/talos/${latestVersion}/`);
    setLatestUrl(`${newPath}${search}${hash}`);
  }, []);
  if (!latestUrl || !currentVersion) return null;
  return <div className="not-prose sticky top-6 z-50 my-6">
      <div className="border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 rounded-xl">
        <div className="text-sm">
          {isBeta ? <>
              ⚠️ You are viewing a <strong>beta version</strong> of Talos ({currentVersion}).
              This version may be unstable.
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View latest stable version {latestVersion} →
              </a>
            </> : <>
              ⚠️ You are viewing an older version of Talos ({currentVersion}).
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View the latest version {latestVersion} →
              </a>
            </>}
        </div>
      </div>
    </div>;
};

<VersionWarningBanner />

Raw Volumes allow allocating an unformatted partition, label it, and make it available for use by advanced storage drivers like Container Storage Interface (CSI) drivers.

When a raw 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 raw 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 raw 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 `r-<volume-name>`, and it is used to identify the volume on the disk after initial provisioning.

Disk encryption can be optionally enabled for raw volumes.

> Note: If you need to allocate a volume to be mounted to a container, please see [User Volumes](./user) guide.

### Create raw volumes

To create a raw volume, append the following [document](../../../reference/configuration/block/rawvolumeconfig) to the machine configuration:

```yaml theme={null}
# raw-volume.patch.yaml
apiVersion: v1alpha1
kind: RawVolumeConfig
name: openebs-vol1
provisioning:
  diskSelector:
    match: "!system_disk"
  minSize: 2GB
  maxSize: 2GB
```

For example, this machine configuration patch can be applied using the following command:

```bash theme={null}
talosctl --nodes <NODE> patch mc --patch @raw-volume.patch.yaml
```

In this example, a raw volume named `openebs-vol1` is created on the first disk which is not the system disk and has `2GB` of disk space available.
The volume will be created as a partition with a size of `2GB`.

The status of the volume can be checked using the following command:

```bash theme={null}
$ talosctl get volumestatus r-openebs-vol1 # note r- prefix
NODE         NAMESPACE   TYPE           ID               VERSION   TYPE        PHASE   LOCATION    SIZE
172.20.0.5   runtime     VolumeStatus   r-openebs-vol1   1         partition   ready   /dev/sda1   2.0 GB
```

This volume can be referenced using a stable symlink `/dev/disk/by-partlabel/r-openebs-vol1`, which is created automatically by Talos Linux.

> Note: Ceph will not create a partition if the partition label contains the substring `ceph`. Avoid using such names for your labels.

### Remove raw volumes

Before removing a raw volume, ensure that it is not used anymore.

In order to remove a raw volume, first remove the configuration document from the machine configuration.
The `VolumeStatus` resource will be removed automatically by Talos Linux.

> Note: The actual disk data hasn't been removed yet, so you can re-apply the raw 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:

```bash theme={null}
talosctl wipe disk sda1 --drop-partition
```

The `sda1` is the partition name, and it can be obtained from the `VolumeStatus` resource before the raw volume is removed,
or from the `DiscoveredVolume` resource any time later.
