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] Resize Guest Disk

To: Nick Couchman <Nick.Couchman@xxxxxxxxx>
Subject: Re: [Xen-users] Resize Guest Disk
From: Grant McWilliams <grantmasterflash@xxxxxxxxx>
Date: Tue, 8 Sep 2009 13:52:00 -0700
Cc: Florian Rahmann <admin@xxxxxxxxxxxxxxxxxxxxx>, xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 08 Sep 2009 13:53:11 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=D9vW0/UmP7LxBsRiwRAY/EO81XxVN+jDJG96DroQcm4=; b=kw+jMyvGeWWWi1fl/GLcmA5h7qedWd5hyir1DrYZ0Eb0BPffEsYsR61u41yFJLMy8d R8Kq+3cW2o5cc4QEf11kBLO+k2vCmaN7eJcvC21bouZ/55/yrfF7yBoSkhmUfq6gHedT Fg+9BssWRlHv3fuSGSiIofntNOxiISlKOgswk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=IIn8xPmm3BgPy9y8jgek2q3QiJjn6iJ4uUfzU+mUd46z7L8ZKMjR2ZeH8MITwpLIzZ 5d7kQjPlWtw7FCEk2jD4H1xGIUt8ExN9LwZKetTh3rRC8xw8kyaZVxIjD8VDrGao+JcQ 12yFt/cYlmR66jc1KDd6NFRpoCmdGjT2Hu9dI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AA64D8C020000990001B96B@xxxxxxxxxxxxxxxxxxxxx>
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: <4AA64D8C020000990001B96B@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, Sep 8, 2009 at 11:26 AM, Nick Couchman <Nick.Couchman@xxxxxxxxx> wrote:

Oh, and if you've partitioned the LV inside the guest, you'll also need to resize the partition (BEFORE you do a resize2fs, etc.).  There are two ways to do this - the safest is to use parted, which works if you're using ext2/ext3 (and a couple other of the most popular filesystems - reiser, I think).  The other method is to delete the partition and recreate it with the extended end points.  This isn't quite as safe and requires that 1) you're start point for the partition is exactly the same as it was before, and 2) the partition is the last (or only) one on the LV.


-Nick



Yep, this is true.

Boot the guest and cat /proc/partitions, it should reflect the increased disk size. If you have one partition on it start fdisk, delete the one partition (don't sweat it, just DO NOT reboot in the middle) and create a new one with the same number and starting cylinder (probably the default cylinder for both start and end). Now save and exit. You'll probably have to reboot the domU.

Once rebooted do a resize2fs on the filesystem eg. resize2fs / and you're done.

If you used LVM in the domU then you can resize the LV the same way you did on the dom0 and then resize2fs the filesystem.

If however that one LV is used in the domU as a harddrive (/dev/xvda) and you have multiple partitions things get messier. Hopefully the partition you want to resize is the last one and you can just follow the instructions above. If it's in the middle you have a lot more work ahead.

If you used LVM in the domU then you can resize the LV the same way you did on the dm0 and then resize2fs the filesystem.

-- Grant McWilliams

Some people, when confronted with a problem, think "I know, I'll use Windows."
Now they have two problems.
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>