From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y70EI-0005ME-RL for qemu-devel@nongnu.org; Fri, 02 Jan 2015 06:17:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y70EF-0002rE-Ls for qemu-devel@nongnu.org; Fri, 02 Jan 2015 06:17:18 -0500 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:35260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6zKP-0003GB-0O for qemu-devel@nongnu.org; Fri, 02 Jan 2015 05:19:33 -0500 Received: by mail-wg0-f47.google.com with SMTP id n12so23976617wgh.20 for ; Fri, 02 Jan 2015 02:19:32 -0800 (PST) Date: Fri, 2 Jan 2015 10:19:29 +0000 From: Stefan Hajnoczi Message-ID: <20150102101929.GA10823@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] implement lvm-aware P2V to reduce time cost significantly for linux server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Haoyu Zhang Cc: Paolo Bonzini , qemu-devel , kvm-devel --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Dec 27, 2014 at 09:28:53AM +0800, Haoyu Zhang wrote: > I want to P2V a redhat server to kvm vm, and lvm was used to manage disks > in the redhat server. > I want to only migrate the really used storage to vm image, which can > reduce the time cost significantly sometimes, > so I need the information of logical volume to physical disks bitmap, to > know which physical sectors were really used, > any ideas? > Is there a tool off-the-shelf have implemented the target? Have you looked at virt-p2v(1)? http://libguestfs.org/virt-p2v.1.html I'm not sure if it sparsifies the disk image during conversion or whether you would have to run virt-sparsify(1) afterwards (http://libguestfs.org/virt-sparsify.1.html). virt-sparsify(1) can definitely unmap LVM's unused space. Stefan --envbJBWh7q8WU6mo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUpnCxAAoJEJykq7OBq3PIpaUIAJlIYtyFCSpIjO+fP/n/gjt0 7/2Y6y1/nkfX2X5lFZs1PYpMRk5Pzeuu5XG6LB+kwI0JrLZfGpUxGwVYrP/5C0nP Eog5l0JnmWOp/9lTYkIoV1UsQ9OxUpbNmxAugTxmn0w26kiWI9afEFM2Tg+b0OXZ EVlcIZ5YOZYMCNKlZCGCI6pJqyI/out96GHNqaPTdJCjPdMT7/w5J9SUaudAO0gb BiPUDkzxYng4o+HbhNYa8GSZ2OHdFgeyPWiFTDHETOoZRUzyiaORcFPNtw3SCOAf bj4afBirMQAsQ0h+/b0qiWmAH6fm53cROlJD+dHVP+4xGXjKmaOg9WINgsmk3uY= =ZdqO -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo--