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] what's correct way of shrinking LVM based domU?

To: Rudi Ahlers <Rudi@xxxxxxxxxxx>
Subject: Re: [Xen-users] what's correct way of shrinking LVM based domU?
From: John Haxby <john.haxby@xxxxxxxxxx>
Date: Tue, 24 Jun 2008 10:24:28 +0100
Cc: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 24 Jun 2008 02:28:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4860BACE.8090205@xxxxxxxxxxx>
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: <4860BACE.8090205@xxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Rudi Ahlers wrote:
Hi all

I want to shrink one of my LVM based domU's, but don't quite know how to do it.

I have searched the Wiki & HOWTO's, and they all show you how expand / enlarge a LVM based domU, but not shrinking it.

It's the opposite, literally, of growing.
So, I stopped (destroyed) the domU, and then resized it as follows: lvresize /dev/data/cpanel1 -L10GB (It was 100GB), but when I a started it up again, I got some errors about the the disk being corrupt, and then a kernel panic.

Looks like you missed out a vital step: you shrunk the logical volume without first shrinking the file system within it. Note that while you can often grow a file system while it is on-line you almost always need the file system off-line in order to shrink it.

In this case, you need to shrink the file system, logical volume (if any), physical volume (if any) and partition in the guest OS _before_ you shrink the logical volume that contains them all in dom0. Of course, you can do all this from dom0 because the file system(s) contain in the logical volume are all off-line.

jch

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