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/
Home Products Support Community News


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

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] shrink or grow disk image?
From: Jonathan Ervine <jervine@xxxxxxxxxx>
Date: Wed, 30 Apr 2008 10:25:23 +0800
Delivery-date: Tue, 29 Apr 2008 19:36:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1209496880.29921.59.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/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>
Organization: Novell
References: <1209496880.29921.59.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: Jonathan Ervine <JErvine@xxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.9
On Wednesday 30 April 2008 03:21:20 James Pifer wrote:
> I have installations of sles for 64 and 32 bit in img files. I can
> copy the img file, create a new domU, adjust the networking as
> needed, and I have a new server up and ready to be configured.
> Problem is my img file is a lot bigger than needed for some uses. Is
> there a way to shrink an img file? Or, if I create a new "template"
> server that is smaller, can the img file be grown when needed?

Growing image files is easy enough - you simply create another blank one 
and then cat it to the original one. I've done this a few times - 
although I'd still recommend that you do this on a backup of the 
original image file :-) using image files isn't the best for 
performance- you should look at using LVM and setting up individual 
volumes for your VMs.

Shrinking I'm not so sure about... I don't think you can shrink an image 
file - however you could create a (smaller) new one, and copy the 
contents of the larger used one to the new one. Combinations of dd and 
lomount are probably useful for this...


Xen-users mailing list

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