Multiple Disk Support
Longhorn supports using more than one disk on the nodes to store the volume data.
By default, Longhorn stores volume data in the /var/lib/longhorn
directory on the host. If you want to use a different disk for storage, you can add a new disk and disable scheduling for the default directory. This gives you flexibility to manage storage based on your needs.
Before adding a disk to Longhorn, you need to mount it to a directory on the host of the Longhorn node.
/mnt/example-disk
. Ensure the directory is accessible and properly configured.After the disk is mounted, you can add it to Longhorn using either the UI or the kubectl
command-line tool.
Using the Longhorn UI
Using kubectl
Command
kubectl edit node.longhorn.io <node-name>
to edit the Longhorn node resource.spec.disks
. For example:...
spec:
...
disks:
...
example-disk:
allowScheduling: true
diskDriver: ""
diskType: filesystem
evictionRequested: false
path: /mnt/example-disk
storageReserved: 0
tags: []
...
Once a disk is added:
Notice:
- You cannot add a disk path that is already in use by another Longhorn disk.
- Longhorn uses the filesystem ID to detect duplicate mounts. Therefore, you cannot add a disk with the same filesystem ID as another disk on the same node.
See: Issue #2477
Optionally, you can use the Space Reserved
field in the UI or spec.disks.<disk-name>.storageReserved
to reserve a portion of disk space (in bytes) for other purposes. This reserved space will not be used by Longhorn for volume data.
To maintain node stability when compute resources (for example memory or disk) are under pressure, the kubelet
requires some space to remain free. If these critical resources are exhausted, it can lead to node instability.
Longhorn reserves 30% of the root disk space (/var/lib/longhorn
) by default to prevent issues like DiskPressure
conditions from the kubelet
, particularly after scheduling multiple volumes. This behaviour is controlled by the storage-reserved-percentage-for-default-disk
setting.
If you prefer to use a different path for a disk (rather than the original mount point), you can use mount --bind
to create an alternative path. Do not use symbolic link (lh -s
), as these are not properly resolved inside Longhorn pods.
Make sure the alternative path is remounted after a node reboot, for example, by adding it to /etc/fstab
.
Nodes and disks can be excluded from future scheduling. Note that any storage already scheduled on the node will not be automatically released when scheduling is disabled for the node.
To remove a disk:
Once the disk is empty and scheduling is disabled, you can safely remove it from the node configuration.
There are two global settings affect the scheduling of the volume.
StorageOverProvisioningPercentage
defines the maximum total storage that can be scheduled on a disk, relative to its usable capacity. The formula is:
ScheduledStorage / (MaximumStorage - ReservedStorage)
The default is 100
(%).
On a 200 GiB disk with 50 GiB reserved, Longhorn sees 150 GiB of usable space. With the default setting, it can schedule up to 150 GiB of volume data.
Since workloads typically don’t consume the entire allocated volume size, and Longhorn uses sparse files to store data, increasing this setting is generally safe and can help optimize disk utilization.
StorageMinimalAvailablePercentage
specifies the minimum percentage of free space that must remain on a disk in order to schedule new replicas. The formula is:
AvailableStorage / MaximumStorage
The default is 25
(%).
For a 200 GiB disk with 50 GiB reserved, Longhorn will stop scheduling new replicas if available space falls below 37.5 GiB (25% of 150 GiB). A new volume also will not be scheduled if its size would push available space below that limit.
This setting helps prevent disks from becoming too full, which could lead to scheduling failures or volume operation issues.
Warning:
Currently, Longhorn cannot fully enforce the
StorageMinimalAvailablePercentage
limit in all scenarios because:
- Longhorn volumes may use more space than their requested size, especially when snapshots are taken.
- Longhorn allows over-provisioning by default.
© 2019-2025 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2025 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.