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

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.



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