WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Can you convert Windows LVM domU to sparse img file?

To: James Pifer <jep@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Can you convert Windows LVM domU to sparse img file?
From: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
Date: Fri, 16 Jan 2009 10:07:44 +0700
Cc: Xen List <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 15 Jan 2009 19:08:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1232033880.7185.16.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <1231982574.7185.11.camel@xxxxxxxxxxxxxxxxxxxxxxxx> <496EDED7.70201@xxxxxxxx> <496EF093.8090605@xxxxxxxxx> <9DD85BCC-83E1-4349-9A88-A31DDA6A6439@xxxxxxxxx> <005b01c97724$eed7fc30$cc87f490$@Henning@prd-inc.com> <1232033880.7185.16.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081125)
James Pifer wrote:
> I was able to do it using Māris' suggestion using:
> dd if=/dev/vg/winpart of=/home/myuser/winimage.img bs=4096
>
> I made sure the system was shut down cleanly and successfully before
> doing it. Once it was done I used 'cp -v --sparse=always...' and copied
> it to another file. 
>
> Using 'du -s -B1 filename' I confirmed the file size. 
>
> I recreated the machine in virtmanager and it booted up and seems to be
> good. 
>
>   

Good to know then.
Just to add an info, if the unused space on your windows does not
contain zeroes (might happen as a result of file deletion, or running
defrag) then your sparse file might not be 100% effective (as in you
should be able to reduce the size further).

VirtualBox's help page suggests running Microsoft's sdelete tool to
zero-out unsused space.
A similar result can also be achieved using ntfsclone and ntfsresize :
- ntfsresize the original disk to the minimum size
- copy using ntfsclone
- ntfsresize the clone to occupy full space

The sdelete method is easier to use, while the ntfsclone/resize method
has the benefit of being space-efficient (e.g. you don't need to have a
temporary non-sparse image file first).

Regards,

Fajar

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users