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] increase size for dom guest using lvm online

To: Simon Hobson <linux@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] increase size for dom guest using lvm online
From: Pasi Kärkkäinen <pasik@xxxxxx>
Date: Wed, 19 Aug 2009 20:35:50 +0300
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 19 Aug 2009 10:36:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <a06240818c6b1c5d29d46@xxxxxxxxxxxxxxxxxxxxxx>
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: <988918.84894.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <a06240806c6ad9c0d7174@xxxxxxxxxxxxxxxxxxxxxx> <a06240818c6b1c5d29d46@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
On Wed, Aug 19, 2009 at 04:17:41PM +0100, Simon Hobson wrote:
> I wrote:
> 
> >It may be possible to detatch a volume and re-attach it with xm but 
> >I've never done that.
> 
> Well now I have. Advance planning says I'll need a bit more space on 
> a volume, and there was a little bit of space available on the iSCSI 
> box (so a case of grab it while it's there, before someone else does 
> !).
> 
> Unmounted the volume in the guest, then :
> 
> # cat backup
> <stuff deleted>
> disk    = [ 'phy:vg0/backuproot,xvda1,w', 
> 'phy:vg0/backupvar,xvda2,w', 
> 'phy:/dev/disk/by-path/ip-<very-long-iscsi-address>,xvda3,w', 
> 'phy:vg0/backupswap,xvda4,w' ]
> 
> # xm list
> Name                                        ID   Mem VCPUs      State   
> Time(s)
> Domain-0                                     0   486     4     r-----  
> 67982.4
> backup                                      11   511     2     -b---- 
> 135441.2
> 
> # xm block-detach 11 xvda3
> 
> <do any other steps required, such as altering partitions or resizing 
> LVM volumes>
> 
> # xm block-attach 11 '/dev/disk/by-path/ip-<very-long-iscsi-address>' 
> /dev/xvda3 r
> Error: Device 51715 (vbd) could not be connected. Hotplug scripts not 
> working.
> Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]
> 
> Create a new virtual block device.
> 
> Checked in teh guest and the device didn't re-appear, so tried again :
> 
> # xm block-attach 11 '/dev/disk/by-path/ip-<very-long-iscsi-address>' 
> /dev/xvda3 r
> Error: Device /dev/xvda3 (51715, vbd) is already connected.
> Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]
> 
> Create a new virtual block device.
> 
> 
> So I still had to shutdown and re-create the guest for the size 
> change to appear.
>

You need to attach a completely new device, not the same xvda3.

-- Pasi
 
> 
> 
> >In any case, at least with ext3, you need the filesystem unmounted 
> >in order to resize it.
> 
> As "Bart Van Kerckhove" <bart@xxxxxxxx> pointed out, you can do 
> online resize of an ext3 filesystem :
> 
> # df -h /store
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/xvda3             99G   44G   51G  47% /store
> 
> # resize2fs /dev/xvda3
> resize2fs 1.41.3 (12-Oct-2008)
> Filesystem at /dev/xvda3 is mounted on /store; on-line resizing required
> old desc_blocks = 7, new_desc_blocks = 10
> Performing an on-line resize of /dev/xvda3 to 39321087 (4k) blocks.
> The filesystem on /dev/xvda3 is now 39321087 blocks long.
> 
> # df -h /store
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/xvda3            148G   44G   97G  31% /store
> -- 
> Simon Hobson
> 
> Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
> author Gladys Hobson. Novels - poetry - short stories - ideal as
> Christmas stocking fillers. Some available as e-books.
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

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