Proxmox Backup Server: Fix Full Disk and Garbage Collection
When a Proxmox Backup Server (PBS) datastore hits 100% disk utilization, the entire backup pipeline grinds to an immediate halt. PVE cluster nodes fail nightly snapshot jobs with errors like PBS backup failed: error -5: Input/output error or HTTP 507 Insufficient Storage. Worse, administrators who hastily log in to prune old backup snapshots discover that storage usage remains completely unchanged after running prune jobs.
This happens because of PBS’s core deduplication architecture. Deleting a backup snapshot metadata record (pruning) does not delete underlying data chunks from disk. Only the two-phase Garbage Collection (GC) engine frees storage space. But when a disk reaches absolute zero free bytes, even Garbage Collection can fail to initialize due to locked index files, memory pressure, or the mandatory 24-hour chunk safety grace period.
This guide provides an emergency disaster recovery runbook to recover a 100% full PBS datastore, safely force garbage collection, override the default chunk grace period when downtime is critical, and tune retention schedules to prevent recurring capacity panics.
If you are building out your backup infrastructure, ensure your server identity and network isolation adhere to our comprehensive guide on Proxmox Backup Server hardening.
PBS Storage Architecture: Why Pruning Does Not Free Disk Space
To resolve full-disk emergencies without data corruption, administrators must understand how Proxmox Backup Server stores and purges data.
Figure 1: Backup ingestion, snapshot pruning, and the two-phase Garbage Collection cleanup engine.
A PBS datastore does not save virtual machine backups as monolithic .vma or .raw images. Instead, it relies on content-addressable chunk storage:
- Chunk Store (
<datastore>/.chunks/): Incoming VM and container disks are carved into variable-size chunks (typically ~4MB) compressed with Zstandard and hashed with SHA-256. If multiple VMs share identical operating system binaries, only one copy of that chunk is written to disk. - Snapshot Manifests (
<datastore>/vm/<vmid>/<timestamp>/): Each backup run creates lightweight index files (index.json,drive-scsi0.img.fidx) that merely reference the list of SHA-256 hashes needed to reconstruct the virtual disk. - Pruning (Phase 1 of Retention): When a prune job runs (e.g.,
keep-daily 7,keep-monthly 1), PBS only deletes the folder containing the snapshot manifest (.fidxfiles). This frees a few kilobytes of metadata. Zero data chunks inside.chunks/are removed during pruning. - Garbage Collection (Phase 2 of Retention): Garbage Collection is an independent batch process executed across two stages:
- Mark Phase: Traverses every remaining valid manifest across all VMs and namespaces, touching the
atime(access timestamp) of all referenced chunks. - Sweep Phase: Scans the entire
.chunks/directory (65,536 subdirectories). Any chunk whose access time was not refreshed during the Mark phase—and whose age exceeds the 24-hour and 5-minute safety threshold—is permanently deleted from disk.
- Mark Phase: Traverses every remaining valid manifest across all VMs and namespaces, touching the
Emergency Protocol: Recovering a 100% Full Datastore
When the underlying pool has 0 bytes free, ZFS or ext4 copy-on-write mechanisms cannot update inode timestamps. Use this prioritized triage sequence.
+-------------------------------------------------------------+
| EMERGENCY WORKFLOW: 100% FULL PBS DATASTORE |
| |
| 1. Verify pool saturation (zpool status / df -h) |
| 2. Temporarily pause all incoming backup jobs |
| 3. Run aggressive manual snapshot prune |
| 4. Force immediate Garbage Collection run |
| 5. If GC fails: Apply temporary safety grace override |
+-------------------------------------------------------------+
Step 1: Diagnose the Full Datastore
SSH into the Proxmox Backup Server and verify capacity across filesystems and ZFS pools:
df -hT /mnt/datastore/*
zpool list -v
If your datastore is mounted on ZFS and shows 100% capacity, ZFS becomes read-only to protect pool state. Check datastore maintenance status:
proxmox-backup-manager datastore list
Step 2: Prevent Incoming Backups from Failing in Loops
Disable incoming writes so you can perform maintenance without interference. In the PBS Web UI or CLI, place the datastore in read-only maintenance mode:
proxmox-backup-manager datastore update <datastore-name> --maintenance-type read-only
This instructs all connected PVE nodes to queue or abort backup tasks cleanly rather than dumping partial chunk retries into the saturated disk.
Step 3: Prune Unneeded Snapshots
Identify snapshots that can be sacrificed. List backup groups by descending size:
proxmox-backup-manager backup list <datastore-name>
Prune snapshots directly via CLI. For example, to keep only the 2 most recent backups across a specific VM group:
proxmox-backup-manager prune <datastore-name> --keep-last 2 --backup-type vm --backup-id 101
To execute a global retention cleanup across the entire datastore:
proxmox-backup-manager prune <datastore-name> --keep-last 3 --keep-daily 7 --dry-run false
Step 4: Run Standard Garbage Collection
Now that older snapshot index manifests have been unlinked, execute the Garbage Collection job:
proxmox-backup-manager garbage-collection start <datastore-name>
Monitor GC progress in real time:
proxmox-backup-manager task list
proxmox-backup-manager task log <UPID>
In the task log, inspect the following metrics:
Original data bytes: Total data indexed.Processed chunks: Count of chunks validated.Removed chunks: Count of orphaned chunks unlinked.Pending chunks: Chunks marked for deletion that are waiting out the 24-hour grace period.
Overriding the 24-Hour Safety Grace Period
By default, PBS enforces an unchangeable 24-hour, 5-minute safety delay (PROXMOX_BACKUP_CHUNK_SAFETY_MARGIN) before unreferenced chunks are wiped during the sweep phase. This protects active, in-flight backup jobs from having their chunks deleted by a concurrent GC run.
However, during a hard outage where the server is 100% full and no backups are running, waiting 24 hours is unacceptable.
+-------------------------------------------------------------+
| SAFETY WARNING: OVERRIDING GC GRACE PERIOD |
| |
| 1. Ensure maintenance mode is strictly 'read-only' |
| 2. Verify NO active backup tasks are writing |
| 3. Override chunk cutoff to flush orphaned data instantly |
+-------------------------------------------------------------+
Method 1: Using the CLI --cutoff Parameter (PBS 3.x+)
Modern versions of proxmox-backup-manager allow tuning or forcing the sweep cutoff when no clients are connected:
# Execute GC with an explicit 0-minute cutoff window
proxmox-backup-manager garbage-collection start <datastore-name> --cutoff 0
Method 2: Emergency Epoch Timestamp Shift (Fallback)
If your version does not support --cutoff 0, you can safely age the unreferenced chunks by shifting the access and modification times of orphaned files, or by advancing system time in a controlled test window.
Alternatively, if running ZFS, temporarily add a small virtual swap or loopback vdev to allow ZFS to complete transaction group flushes:
# Create a temporary 10GB emergency rescue file on a secondary USB drive or root mount
truncate -s 10G /root/emergency_rescue.raw
zpool add <zpool-name> /root/emergency_rescue.raw
Once ZFS has 10GB of breathing room, it immediately resumes copy-on-write functionality, allowing the Garbage Collection sweep phase to delete gigabytes of stale chunks. Once GC completes and the primary pool drops below 80% usage, evacuate and remove the rescue vdev:
zpool remove <zpool-name> /root/emergency_rescue.raw
rm -f /root/emergency_rescue.raw
Tuning Retention & Scheduling to Prevent Recurrence
Emergency recoveries should be followed by structural scheduling improvements.
1. Correct Task Sequencing
A common failure mode is scheduling Garbage Collection before Pruning in the weekly cron. If GC runs at 01:00 and Prune runs at 02:00, newly unlinked chunks sit on disk until next week’s GC cycle.
| Task | Recommended Schedule | Objective |
|---|---|---|
| Prune Job | Daily at 02:00 | Unlink expired snapshot manifests |
| Verify Job | Weekly on Sunday at 04:00 | Scan chunk integrity and cryptographic hashes |
| Garbage Collection | Daily or Bi-weekly at 06:00 | Sweep unreferenced chunks after pruning has finished |
2. Configure PBS Prune Schedules in datastore.cfg
Inspect your configuration at /etc/proxmox-backup/datastore.cfg:
datastore: pbs-storage-01
path /mnt/datastore/pbs-storage-01
gc-schedule daily
prune-schedule daily
keep-daily 7
keep-weekly 4
keep-monthly 3
keep-last 2
3. Set Up Capacity Warning Notifications
Configure automated alerts before the pool exceeds 85% capacity. Add an alert threshold in /etc/proxmox-backup/notifications.cfg or configure an external Prometheus exporter:
# Check raw chunk count
find /mnt/datastore/pbs-storage-01/.chunks -type f | wc -l
Troubleshooting Common PBS GC Errors
| Error Message | Root Cause | Solution |
|---|---|---|
GC failed: EACCES: Permission denied | Stale permissions on .chunks directories | Run chown -R backup:backup /mnt/datastore/<name> |
task failed: out of memory (OOM) | Host RAM exhausted while indexing millions of chunks | Increase host swap or restrict ZFS ARC (zfs_arc_max) |
Garbage collection already running | Previous GC hung or orphaned after unexpected reboot | Check ps aux | grep proxmox-backup-proxy and clear stale lock in datastore directory |
cannot mount '/mnt/datastore': pool I/O is currently suspended | ZFS pool completely out of metadata space | Add temporary rescue disk with zpool add to unsuspend I/O |
Summary Checklist
- Place datastore in
read-onlymaintenance mode during emergency space shortages. - Understand that
pruneremoves metadata;garbage-collectiondeletes physical data chunks. - Never run manual
rm -rfinside.chunks/directly, as this causes silent corruption across surviving snapshots. - Sequence your prune schedule before your garbage collection schedule.
- Keep datastore utilization below 80% to allow ZFS copy-on-write operations to function smoothly.
Related Runbooks
Implementation Checklist
- Replicate the steps in a controlled lab before production changes.
- Document configs, versions, and rollback steps.
- Set monitoring + alerts for the components you changed.
- Review access permissions and least-privilege policies.
Official References
Need a Hand?
If you want this implemented safely in production, I can help with assessment, execution, and hardening.
Contact MeNeed an Offsite Backup Node or Corosync QDevice?
Deploy an independent cloud Droplet to act as a lightweight Corosync QDevice tiebreaker, remote PBS backup sync relay, or isolated test environment with $200 in free credits.
Transparency: We independently test and operate all recommended infrastructure. If you use our partner links, you receive free promotional credits and support our testing lab at zero extra cost to you.
Weekly Production DevOps Runbooks
Join 1,000+ infrastructure engineers receiving real-world Linux troubleshooting, Proxmox clustering setups, and Docker optimization runbooks every Tuesday. Zero spam, unsubscribe anytime.
About the Author
Kamandanu Wijaya
IT Infrastructure & Network Administrator
Infrastructure & network administrator with 15+ years of enterprise experience, focused on stability, security, and automation.
Certifications: Google IT Support, Cisco Networking Academy, DevOps.
Proxmox SSL Certificate: Fix Port 8006 Handshake Errors
Next →Linux XFS Corruption: Safe Repair Guide Without Data Loss
Need IT Solutions?
DoWithSudo is ready to help setup servers, VPS, and your security systems.
Contact Us