Too large size of a backup copy. Why?

Static

Member
Jan 22, 2011
6
0
21
Russia
I install new VM KVM Debian 6. Installation without a graphic environment. Made the schedule for backup. After backup the size of the file of a backup copy makes 20Gb!!! Why so? There is a similar empty VM with Centos 6.2 and there the backup copy occupies 3Gb.
 
do you use lzo compression?
 
Yes!

System:
# uname -a
Linux ais-mfc 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012 x86_64 GNU/Linux

# df -h
/dev/mapper/ais--mfc-root
66G 763M 62G 2% /
tmpfs 4,0G 0 4,0G 0% /lib/init/rw
udev 4,0G 120K 4,0G 1% /dev
tmpfs 4,0G 0 4,0G 0% /dev/shm
/dev/vda1 228M 16M 201M 8% /boot


After backup VM size = 20,3Gb, file format = tar.lzo

The first time such I see
 
try to zero out the free space inside the vm and you'll get very small backup archive:

dd if=/dev/zero of=zero.small.file bs=1024 count=102400
dd if=/dev/zero of=zero.file bs=1024
rm zero.small.file
sync ; sleep 60 ; sync
rm zero.file


in a windows vm you can use sdelete:

sdelete.exe -z c::
 
[root@antispam ~]# dd if=/dev/zero of=zero.small.file bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 6.50482 seconds, 16.1 MB/s
[root@antispam ~]# dd if=/dev/zero of=zero.file bs=1024
dd: writing `zero.file': No space left on device
28806481+0 records in
28806480+0 records out
29497835520 bytes (29 GB) copied, 1268.94 seconds, 23.2 MB/s
[root@antispam ~]# rm zero.small.file
rm: remove regular file `zero.small.file'? yes

Total size is 32 GB and about %80 of it was emtpy. I will need to run it on some other linux machine which has only %30 of total disk size empty. I will probably have no space left on device. Why is that ? Sorry I am not a linux expert.
 
Mil gracias me salvaste por que no sabia como eliminar todo ese espacio vacio.
 
Zeroing out is ok maybe for a one-time. But in general, you should be using VirtIO-SCSI with "discard" enabled and run a periodic fstrim inside the guest. That will mark unused blocks and is much faster. With the dd method, those zeroes are actually written out to disk.

The fstrim we run daily is:
Code:
/sbin/fstrim -a -v -m 16m
 

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!