From: Lukas Laukamp Subject: Re: [User Question] How to create a backup of an LVM based maschine without wasting space Date: Fri, 12 Oct 2012 11:17:50 +0200 Message-ID: <5077E03E.2040507@laukamp.me> References: <5077BE30.5010209@laukamp.me> <20121012084221.GC14822@stefanha-thinkpad.redhat.com> <5077DB9F.6050809@laukamp.me> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mailer0.lippux.de ([5.9.218.245]:47404 "EHLO mailer0.lippux.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238Ab2JLJR7 (ORCPT ); Fri, 12 Oct 2012 05:17:59 -0400 Received: from localhost (localhost [127.0.0.1]) by mailer0.lippux.de (Postfix) with ESMTP id 14F40424FCC for ; Fri, 12 Oct 2012 11:17:55 +0200 (CEST) Received: from mailer0.lippux.de ([127.0.0.1]) by localhost (mailer0.lippux.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ivHB0jQBx3fE for ; Fri, 12 Oct 2012 11:17:54 +0200 (CEST) Received: from ashlynn.lippux.de (unknown [5.9.218.242]) (Authenticated sender: lukas@laukamp.me) by mailer0.lippux.de (Postfix) with ESMTPSA id CDE54424B98 for ; Fri, 12 Oct 2012 11:17:54 +0200 (CEST) In-Reply-To: <5077DB9F.6050809@laukamp.me> Sender: kvm-owner@vger.kernel.org List-ID: 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@vger.kernel.org >> 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