Optimizing LXC Backups in Proxmox with vzdump
Learn how to optimize Proxmox LXC backups using vzdump. We cover snapshot modes, zstd compression trade-offs, and the critical limitation regarding bind mounts.
21 Aug 2025, 07:48 UTC

The Risk of the 'Full Backup' Bottleneck
When managing Linux Containers (LXC) in Proxmox VE, the default instinct is often to schedule a full backup of every container nightly. However, as container disks grow, this approach creates a performance ceiling: high I/O wait times during the backup window and rapidly depleting storage on your backup target. The goal is to maintain a recovery point objective (RPO) of hours rather than days without crashing your host's disk throughput.
The solution is leveraging vzdump with snapshot mode and LVM thin provisioning. By shifting from full archives to incremental snapshots, you reduce the amount of data written to disk and minimize the time a container remains in a "frozen" state during the snapshot process.
Choosing the Right Backup Mode
Proxmox offers different modes for vzdump, but for production LXC workloads, Snapshot mode is the standard. Unlike 'Stop' mode, which shuts down the container, or 'Suspend' mode, which pauses it, Snapshot mode allows the container to keep running.
- Snapshot Mode: Uses LVM or ZFS snapshots to create a point-in-time copy of the disk. The container remains online, though a brief pause occurs during the snapshot creation.
- Stop Mode: Ensures total data consistency by powering off the container. Use this only for databases that cannot handle snapshot-based consistency.
- Suspend Mode: Pauses the container state. This is rarely used for LXC compared to VMs.
Balancing Compression and CPU Overhead
Compression is a critical decision in vzdump. While reducing the backup size saves storage, it consumes CPU cycles. Proxmox supports several algorithms, with zstd being the modern recommendation for most users.
| Algorithm | CPU Impact | Compression Ratio | Best Use Case |
|---|---|---|---|
| None | Very Low | None | Fast local NVMe storage |
| gzip | Medium | Good | Legacy compatibility |
| zstd | Medium/High | Excellent | General production workloads |
Implementation Example: CLI Backup and Restore
While the Web UI is convenient, using the command line allows for precise control over compression and destination. Run these commands on the Proxmox host shell as a root user.
Creating a Compressed Snapshot
To back up container ID 101 using zstd compression to the local backup storage:
vzdump 101 --mode snapshot --compress zstd --storage local-zfs
Expected Check: Monitor the output for TASK OK. You can verify the resulting file in /var/lib/vz/dump/ (or your configured storage path) to ensure the file size is significantly smaller than the container's allocated disk space.
Restoring to a New ID
To avoid overwriting the existing container, restore the backup to a new VMID (e.g., 102):
pct restore 102 /var/lib/vz/dump/vzdump-lxc-101-DATE.tar.zst
Risk: If you restore to an ID that already exists, Proxmox will overwrite the existing container without a confirmation prompt. Always use a unique ID for testing restores.
Critical Limitations and Trade-offs
vzdump is powerful, but it is not a universal filesystem backup tool. There are two primary scenarios where it fails to capture all data:
- Bind Mounts: If you have mounted a directory from the Proxmox host into the LXC (e.g.,
/mnt/dataon host mapped to/datain container),vzdumpwill not back up the data in that folder. You must back up those host directories separately using a tool likersyncorBorgBackup. - LVM Requirements: Incremental backups and efficient snapshots require an LVM-thin pool. If you are using standard LVM or a directory-based storage, you are limited to full backups, which significantly increases I/O load.
Verifying Your Strategy
A backup is only successful if the restore works. To validate your configuration, perform a "Fire Drill":
- Execute a
vzdumpof a non-critical container. - Restore that backup to a new ID on the same host.
- Boot the restored container and verify that application logs and data files are intact.
- Delete the restored container to reclaim space.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.