How to improve backup

claudiomiguelmuller

Active Member
Oct 8, 2013
30
0
26
Hello,
I wanted to take a course.

I have a VM with CentOS.

the backup it is 8gb.

I copied some large files into the CentOs, then the backup to 15GB.

Now, these deleted files from CentOS, but the backup continues to 15GB.

what can be done to lower this backup and return to something around 8gb?
 
The general problem is, that deleting the file will not delete the contents on disk, only remove the pointers to the data. The backup mechanism is scanning which blocks on storage are filled, so there is always something there except you really overwrite it with zeros.

This problem is common to all virtualization products, whereas there exist solutions of e.g. vmware that scan the actual file allocation table for used blocks and only back up those, but this only applies to mainstream OS like Windows Server, etc.
 
If you have SSD storage or any other block storage (ie. RBD) which supports TRIM, you can activate "discard" in PVE and then shrink the used space with "fstrim" from inside the VM. We're doing this on a regular base on all our VMs.
 
No, you have to wipe every "real" mountpoint by yourself.

The best way is to use a storage backend with trim as @robhost explained, but it is easier than said.
 
i have:

-bash-3.00$ df -h
Sist. Arq. Tam Usad Disp Uso% Montado em
/dev/vda1 29G 4,1G 24G 15% /
none 2,5G 0 2,5G 0% /dev/shm
/dev/vda3 263G 217G 34G 87% /home


in this case I do DD 3 times?
 
dd if=/dev/zero of=/zero bs=1M; sync; sync; sync; rm -f /zero

and

dd if=/dev/zero of=/home/zero bs=1M; sync; sync; sync; rm -f /home/zero

?
 
TRIM is both.

Your storage backend has to have TRIM support (e.g. SSD in hardware, or e.g. ZFS in software), then this information will be propagated to your VM and you can then run fstrim inside Linux to signalize free blocks to the underlying storage system and the storage system itself will then mark the blocks as free. This is the same than the dd command, but much more efficient and much faster.
 
Hi,
Thank you for your help,
after DD & SYNC & RM or SDelete

VM 1 (centos): backup before 18gb, after 5gb
VM 2 (centos-web): backup before 10gb, after 9gb
VM 3 (LinuxMint-printers): backup before 10gb, after 5gb
VM 4 (Win7-web-printers): backup before 44gb, after 11gb
VM 5 (postfix): backup before 37gb, after 15gb

119gb to 45gb.
 
Yes, that's really good. I also run TRIM on all machines supporting it and dd'ing everything else.

For linux, you can also replace rm with wipe, which can overwrite with zeros automatically. That's good with logroate.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!