Hi, I''ve create a image file for a Solaris 10 DomU on my Solaris machine using qemu-img qemu-img create -f raw Solaris10_xen0707.raw 10G That work''s fine; the file only uses the necessary space: bash-3.00# ls -l Solaris10_xen0707.raw -rw-r--r-- 1 root root 10737418240 Jul 21 16:18 Solaris10_xen0707.raw bash-3.00# du -ks Solaris10_xen0707.raw 1351128 Solaris10_xen0707.raw How can I copy this image to my Linux machine without copying the unused space? Copying the image with scp will create a 10 GB file on the Linux machine. Or should I use another file format for the images? regards Bernd This message posted from opensolaris.org
On Sat, Jul 21, 2007 at 10:27:52AM -0700, Bernd Schemmer wrote:> bash-3.00# ls -l Solaris10_xen0707.raw > -rw-r--r-- 1 root root 10737418240 Jul 21 16:18 Solaris10_xen0707.raw > > bash-3.00# du -ks Solaris10_xen0707.raw > 1351128 Solaris10_xen0707.raw > > How can I copy this image to my Linux machine without copying the unused space?Whilst I haven''t tested this, GNU tar has a --sparse option. regards john
On Sat, Jul 21, 2007 at 06:51:59PM +0100, John Levon wrote:> > How can I copy this image to my Linux machine without copying the unused space? > Whilst I haven''t tested this, GNU tar has a --sparse option.wouldn''t that need a target-Filesystem with support for sparse-files, to keep the small amount of allocated disk space? Thomas --
John,>>Whilst I haven''t tested this, GNU tar has a --sparse option.Thanks, that works: # source machine running Solaris: bash-3.00# ls -l Solaris10_xen0707.raw -rw-r--r-- 1 root root 10737418240 Jul 21 23:50 Solaris10_xen0707.raw bash-3.00# du -ks Solaris10_xen0707.raw 1351176 Solaris10_xen0707.raw bash-3.00# ls -l sol10xenimg.tar -rw-r--r-- 1 root root 590704640 Jul 22 08:44 sol10xenimg.tar # target machine running Linux (the filesystem is ext3): root@t30:/data/incoming# ls -l sol10xenimg.tar -rw-r--r-- 1 xtrnaw7 xtrnaw7 590704640 2007-07-22 08:53 sol10xenimg.tar root@t30:/test# ls -l export/xen-images/Solaris10_xen0707.raw ; -rw-r--r-- 1 root root 10737418240 2007-07-21 23:50 export/xen-images/Solaris10_xen0707.raw root@t30:/test# du -ks export/xen-images/Solaris10_xen0707.raw 603908 export/xen-images/Solaris10_xen0707.raw regards Bernd This message posted from opensolaris.org
Thomas,>>wouldn''t that need a target-Filesystem with support for sparse-files, >>to keep the small amount of allocated disk space?Agreed. It looks like ext3 does support sparse files - see my answer to John regards Bernd This message posted from opensolaris.org
On Sat 07/21/07 at 10:27 AM, Bernd.Schemmer@gmx.de wrote:> Hi, > > I''ve create a image file for a Solaris 10 DomU on my Solaris machine using qemu-img > > qemu-img create -f raw Solaris10_xen0707.raw 10G > > That work''s fine; the file only uses the necessary space: > > bash-3.00# ls -l Solaris10_xen0707.raw > -rw-r--r-- 1 root root 10737418240 Jul 21 16:18 Solaris10_xen0707.raw > > bash-3.00# du -ks Solaris10_xen0707.raw > 1351128 Solaris10_xen0707.raw > > How can I copy this image to my Linux machine without copying the unused space?rsync supports sparse files.