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] Recovering space or "shrink" disk img?

To: James Pifer <jep@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Recovering space or "shrink" disk img?
From: John Haxby <john.haxby@xxxxxxxxxx>
Date: Fri, 12 Sep 2008 10:11:14 +0100
Cc: Xen List <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 12 Sep 2008 02:12:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1221178848.11534.43.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: <1221178848.11534.43.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.16 (X11/20080723)
James Pifer wrote:
That's the same thing I got before removing the 4 gb file. Should I
expect disk0 to "recover" the space automatically? VMware has a shrink
disk option, does something similar need to be done in xen?


As previously commented, Linux doesn't recover "unused" space from a file. However, if you shut down the guest then you can use "cp --sparse=always" to "recover" sparse blocks. At the cost of temporarily allocating all the sparse blocks on the disk you can do "dd if=/dev/zero of=/tmp/hugefile; rm /tmp/hugefile" to make it possible to recover more disk space. Overwriting blocks that are not in use and contain non-null bytes is possible but I don't know of an easy way to do it except in one or two special cases.

jch

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

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