Configure The Block Size Of Backup
A Longhorn backup is composed of data fragments derived from a snapshot, where each fragment is called a block. Blocks are the fundamental units used for processing, transmission, and storage in the backup target. All blocks within a single backup have the same physical size.
Prior to Longhorn v1.10.0, the backup block size was fixed at 2 MiB. Starting in Longhorn v1.10.0, users can configure the backup block size during volume creation. This value is immutable once the volume is created. The block size used for backups is displayed on the volume detail page in the Longhorn UI, and all backups for a volume will use the size defined at creation.
Longhorn supports two available backup block size, 2 MiB and 16 MiB. The selected block size affects the efficiency of backup creation and storage:
A global setting allows users to define the default backup block size for new volumes. If a backup block size is not explicitly set during volume creation, Longhorn will apply the default value. To change the default backup block size:
Settings > General > Default Backup Block Size
kubectl
:kubectl -n longhorn-system edit settings.longhorn.io default-backup-block-size
To specify a custom backup block size during volume creation:
For volumes provisioned through a Persistent Volume Claim (PVC), you can set the backupBlockSize
in the parameters
section of the StorageClass
.
Example:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: longhorn-example
provisioner: driver.longhorn.io
parameters:
backupBlockSize: 16Mi
...
When restoring a volume from a backup, the restored volume can be configured with a different backup block size than the original.
Caution: Longhorn versions prior to v1.10 lack forward compatibility and cannot restore backups created by v1.10 or later. Restoring a backup with a non-default backup block size (anything other than 2 MiB) on Longhorn v1.9.x or older will result in a volume being created with file system corruption.
© 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.