Enhancing vzdump

f4242

Renowned Member
Dec 19, 2016
114
5
83
Quebec, QC
Hello,

I found that my VM dumps are bigger than the used disk space inside my VMs. I made some searches and found this is because removed files from the disk are just flagged to be deleted but not removed from the disk. I understand that.

I found that I can zero-fill my free space with dd, but I think this is an ugly hack that can cause problems on production servers (this make a lot of IO for nothing and the disk become full for some time, so some process may fail to write real data on the filesystem).

Do you plan to enhance vzdump and backup only useful data blocks (ignoring data blocks marked as removed). I suspect this would need support for specific filesystems.

This would be really useful, because this make a very big waste of disk space on my backups volume.

Thanks!
 
That's what I do. On OSes that don't support it, I do a "dd if=/dev/zero of=zero.img bs=1m ; rm -v zero.img" to zero the space to the same effect though it.
 
Maybe you have to change /etc/fstab and GRUB Config, because virtoi uses "/dev/vda" and virto-scsi "/dev/sda".

Hello,

/etc/fstab use uuid instead of physical device, so I didn't changed anything in this file.

I didn't find references to /dev/vda in grub config either. I see "(hd0)", is it still good with virtio-scsi?
 
Succeeded to switch to virtio-scsi all my Linux VMs.

I have one Windows 10 VM and this is the only VM I didn't succeeded to switch. Windows doesn't boot anymore. I booted from the install media, loaded the virtio-scsi driver and tried to "repair" the installation, Windows tries to repair itself but fail to. Reverted back to virtio and it boots again.