Re: [User Question] How to create a backup of an LVM based maschine without wasting space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 12.10.2012 10:58, schrieb Lukas Laukamp:
Am 12.10.2012 10:42, schrieb Stefan Hajnoczi:
On Fri, Oct 12, 2012 at 08:52:32AM +0200, Lukas Laukamp wrote:
I have a simple user question. I have a few LVM based KVM guests and
wan't to backup them to files. The simple and nasty way would be to
create a complete output file with dd, which wastes very much space.
So I would like to create a backup of the LVM to a file which only
locates the space which is used on the LVM. Would be create when the
output file would be something like a qcow2 file which could be also
simply startet with KVM.
If the VM is not running you can use "qemu-img convert":

   qemu-img convert -f raw -O qcow2 /dev/vg/vm001 vm001-backup.qcow2

Note that cp(1) tries to make the destination file sparse (see the
--sparse option in the man page).  So you don't need to use qcow2, you
can use cp(1) to copy the LVM volume to a raw file.  It will not use
disk space for zero regions.

If the VM is running you need to use LVM snapshots or stop the VM
temporarily so a crash-consistent backup can be taken.

Stefan
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html

Hello Stefano,

thanks for the fast reply. I will test this later. In my case now it would be a offline backup. For the online backup I think about a seperated system which every day makes incremental backups and once a week a full backup. The main problem is, that the systems are in a WAN network and I need encryption between the systems. Would it be possible to do something like this: create the LVM snapshot for the backup, read this LVM snapshot with the remote backup system via ssh tunnel and save the output of this to qcow2 files on the backup system? And in which format could be the incremental backups be stored?

Best Regards

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux