backup needs much more space than the LXC itself

fruchtzwerg

Member
Apr 3, 2023
44
2
13
I have a lxc container in pve. The webgui shows me an amount of storage of 12.69 GB.
Bildschirmfoto vom 2025-09-29 19-31-15.png

The backup in PBS needs more than 20GB.
Bildschirmfoto vom 2025-09-29 19-33-43.png
I cannot afford this amount of storage and would like to shrink the storage of the backup.
But how?
 
Can you check if it gets smaller if you call pct fstrim CTIDHERE first? Maybe some files change very often or there's some sparse files or something.
 
Last edited:
I tried pct fstrim CTIDHERE

with the output:
Code:
fstrim: /var/lib/lxc/306/rootfs/: the discard operation is not supported

Maybe I should mention that I use zfs.
The lxc is a yunohost server. Nothing special.
 
Last edited:
Hi,
it could be that ZFS just reports a lower value because of compression (you can check with zfs get all path/to/your/subvol | grep compress) or there could also be sparse files. But please note that the PBS storage usage is not at all the sum of those sizes, it also has compression and also deduplication: https://pbs.proxmox.com/docs/introduction.html#main-features See the Deduplication Factor in your Datastore summary
 
Hi,
it could be that ZFS just reports a lower value because of compression (you can check with zfs get all path/to/your/subvol | grep compress) or there could also be sparse files. But please note that the PBS storage usage is not at all the sum of those sizes, it also has compression and also deduplication: https://pbs.proxmox.com/docs/introduction.html#main-features See the Deduplication Factor in your Datastore summary
I'm confused. Does that mean that the lxc has indeed an amount of round about 22GB?
My purpose was to shrink its size.
 
I didn't find a solution yet. But I'm really disturbed and confused by the difference between the size of the LXC. The PVE-gui reports with 32GiB a different size than the PBS with 46GiB. So one of the values has to be wrong:
Bildschirmfoto vom 2025-11-27 07-12-07.png

Output of PBS:

Details​

VMIDNameStatusTimeSizeFilename
xxx xxxxok 13m 20s46.329 GiBct/402/2025-11-27T03:00:09Z

Total running time: 13m 20s
Total size: 46.329 GiB

I asume the pve-gui is not right. But how can I get proxmox to show the real size of the LXC?
 
Last edited:
So one of the values has to be wrong:
That's a wrong assumption. If the underlying storage is different, the space usage can be different even if it's the same data. Again, could be compression (you haven't provided the output from the zfs get command or sparse files (which are not problematic per se!) or something along those lines.
 
Thanks for the reply. Maybe I should add some infos:
- PVE and PBS or on the same host on a VPS with zfs.
- The LXC ist on local-zfs and not on a separate drive
- PBS stores backups simply in a folder on the root system /backups (to sync later with a remote PBS)

Because they are both on the same zfs system I asumed that the the amount of storage the LXC uses is "= or >" than the amount of PBS_Backup_of_LXC.

Edit: In fact that seems to be right because I just discovered that the LXC uses 53,69GB

Bildschirmfoto vom 2025-11-27 11-59-51.png
So why does the summary in the pve webgui show only 32,06GB?
 
Code:
zfs get all | grep compress

gives
Code:
....

rpool/data/subvol-402-disk-0  compressratio         1.56x                          -

rpool/data/subvol-402-disk-0  compression           on                             inherited from rpool

rpool/data/subvol-402-disk-0  refcompressratio      1.56x                          -

.....

zfs get all rpool/data | grep compress
gets
Code:
rpool/data  compressratio         1.56x                  -
rpool/data  compression           on                     inherited from rpool
rpool/data  refcompressratio      1.00x                  -
 
On PBS, a backup is stored as chunks and the calculated size will reflect the sum of these chunks which is the logical size of the data. If you have 1.56x compression for the ZFS dataset, that seems to match up: 53.69 / 1.56 is about 34.4.
 
On PBS, a backup is stored as chunks and the calculated size will reflect the sum of these chunks which is the logical size of the data. If you have 1.56x compression for the ZFS dataset, that seems to match up: 53.69 / 1.56 is about 34.4.
Okay, so the Webgui shows the compresed amount of storage used on the pool. Although the amount inside the container is bigger. That's a great benefit.
 
Last edited: