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

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



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.