Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-users

Re: [Xen-users] shrink or grow disk image?

To: Jonathan Ervine <JErvine@xxxxxxxxxx>
Subject: Re: [Xen-users] shrink or grow disk image?
From: John Haxby <john.haxby@xxxxxxxxxx>
Date: Wed, 30 Apr 2008 12:06:33 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 30 Apr 2008 04:07:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4818358E.8030004@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <1209496880.29921.59.camel@xxxxxxxxxxxxxxxxxxxxxxxx> <200804301025.23379.jervine@xxxxxxxxxx> <4818358E.8030004@xxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (X11/20080226)
John Haxby wrote:
Of course, if your original file is sparse then shrinking isn't going to actually free disk space but as you've just copied it (using, presumably, cp) then you've filled all the holes with zeroes. If you copy the file with tar and the --sparse options then the holes won't get filled in and you won't be using space that you don't need. I suspect, though I haven't tried it, that copying a file with lots of zero-filled blocks using tar --sparse will convert those blocks into holes. Does that help?

On Fedora 8, at least, cp handles sparse files quite nicely and "cp --sparse=always" seems to do a good job of turning blocks of zeros into holes.

You learn something new every day.

jch

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

<Prev in Thread] Current Thread [Next in Thread>