Proxmox Backup Server (PBS) - How to Immediately Free Space After Deleting Specific Backups?

zikou

Member
Nov 13, 2024
52
5
8
Hello Proxmox Community,

I'm working to free up disk space on my Proxmox Backup Server (PBS) and running into a common challenge: the reported free space isn't increasing immediately after I delete backup snapshots.

when I click on remove (on the proxmox node) on the backup I want to delete I dont see that space of pbs free up or should I wait some time until the delete affected and free space on pbs

1753045824791.png
 
so the backup I deleted (when I click remove in proxmox node) will be free up when I click start garbage collection is that right?

View attachment 88223
Yes:
The garbage collection (GC) process is performed per datastore and is split into two phases:



Phase one (Mark):



All index files are read, and the access time (atime) of the referenced chunk files is updated.



Phase two (Sweep):



The task iterates over all chunks and checks their file access time against a cutoff time. The cutoff time is given by either the oldest backup writer instance, if present, or 24 hours and 5 minutes before the start of the garbage collection.



Garbage collection considers chunk files with access time older than the cutoff time to be neither referenced by any backup snapshot's index, nor part of any currently running backup job. Therefore, these chunks can safely be deleted.



Chunks within the grace period will not be deleted and logged at the end of the garbage collection task as Pending removals.



Note

The grace period for backup chunk removal is not arbitrary, but stems from the fact that filesystems are typically mounted with the relatime option by default. This results in better performance by only updating the atime property if a file has been modified since the last access or the last access has been at least 24 hours ago.

https://pbs.proxmox.com/docs/maintenance.html#garbage-collection
 
I got this output

2025-07-20T21:31:13+00:00: Removed garbage: 1.765 TiB
2025-07-20T21:31:13+00:00: Removed chunks: 1923384
2025-07-20T21:31:13+00:00: Original data usage: 3.887 TiB
2025-07-20T21:31:13+00:00: On-Disk usage: 212.825 GiB (5.35%)
2025-07-20T21:31:13+00:00: On-Disk chunks: 156468
2025-07-20T21:31:13+00:00: Deduplication factor: 18.70
2025-07-20T21:31:13+00:00: Average chunk size: 1.393 MiB
2025-07-20T21:31:13+00:00: TASK OK

I have this backup schedule
1753047194836.png

and this in the proxmox ui 1753047249722.png

did it delete also the backup of those machine (that are in the schedule)
because now i see 5.82% (229.16 GB of 3.94 TB)
the aggregation of those backup is more than 229.16GB just the first for line storage is plus 400Gb
or my understanding is uncorrect it doesnt back up the whole vm disk
 
or my understanding is uncorrect it doesnt back up the whole vm disk
Read the manual at http://pbs.proxmox.com to get an understanding how it works.
I got this output

2025-07-20T21:31:13+00:00: Removed garbage: 1.765 TiB
2025-07-20T21:31:13+00:00: Removed chunks: 1923384
2025-07-20T21:31:13+00:00: Original data usage: 3.887 TiB
2025-07-20T21:31:13+00:00: On-Disk usage: 212.825 GiB (5.35%)
2025-07-20T21:31:13+00:00: On-Disk chunks: 156468
2025-07-20T21:31:13+00:00: Deduplication factor: 18.70
2025-07-20T21:31:13+00:00: Average chunk size: 1.393 MiB
2025-07-20T21:31:13+00:00: TASK OK

<Snip>

This looks as expected. PBS split the data in a lot of small files called chunks. The actual backups just references these chunks to save disc storage ( deduplication). Actually it's a little bit more complicated but that's the basic idea. So if you remove or prune a backup you only remove the references, the data is still there and might still be referenced in other backups. The garbage collection now removes any data not referenced in a backup for more than 24 hours and five minutes as already explained. So if you remove a backup and the data was still referenced sonewhere else during the last 24 hours+5 minutes before garbage collection, it won't be removed.
 
Last edited:
Read the manual at http://pbs.proxmox.com to get an understanding how it works.


This looks as expected. PBS Splitt the data in a lot of small files called chunks. The actual backups just references these chunks to save disc storage ( deduplication). Actually it's a little bit more complicated but that's the basic idea. So if you remove or prune a backup you only remove the references, the data is still there and might still be referenced in other backups. The garbage collection check now removes any data not referenced in a backup for more than 24 hours and five minutes as already explained. So if you remove a backup and the data was still referenced sonewhere else on the last 24 hours+5 minutes before garbage collection, it won't be removed.
so the vms backup that are backed up using that schedule (in proxmox) are not deleted after running GC
sorry I bother you a lot
 
so the vms backup that are backed up using that schedule (in proxmox) are not deleted after running GC

Not right now yes, but 24h+5m after their data isn't referenced in any other backups. This is a good thing since this saves lots of storage space if you have a lot of backups with overlapping data ( due to same operating system, same running applications or same userdata due to multiple backups of the same vm etc)


sorry I bother you a lot
You are welcome ;)
 
Last edited:
  • Like
Reactions: UdoB
Not right now yes, but 24h+5n after their data isn't referenced in any other backups. This is a good thing since this saves lots of storage space if you have a lot of backups with overlapping data ( due to same operating system, same userdata due to multiple backups of the same vm etc)



You are welcome ;)
so after the retention period that configured,the backup will we be deleted in the proxmox node ui it will became unreferenced then GC will delete those data
thanks for your help
 
  • Like
Reactions: Johannes S
Please note, the 24h + 5min was used as safety measure to be sure that filesystems using the relatime mount option might not ignore atime updates used by PBS to mark chunks as in use. See https://pbs.proxmox.com/docs/maintenance.html#gc-background

Since most of the filesystems do respect the direct atime updates, an option to check and reduce the cutoff time has been introduced since, configurable on a per-datastore basis in the datastore tuning options, see https://pbs.proxmox.com/docs/storage.html#tuning
 
  • Like
Reactions: Johannes S