[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] how to expand disk inside of domU?



On Mon, Apr 26, 2010 at 9:12 PM, Dan Waterloo <dan@xxxxxxx> wrote:
> i'm trying to find a way to expand a selected partition in my DomU...
>
> when in a console in the domU, here are the disks available:
>
> [root@localhost ~]# df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/mapper/VolGroup00-LogVol00
>                        13G  3.5G  8.1G  30% /
> /dev/xvda1             99M   21M   74M  22% /boot
> tmpfs                 257M     0  257M   0% /dev/shm
>
> I'd like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G
>
> The domU is based on an image file, 'webs.img' that resides on a disk in the
> Dom0.
> In the dom0, I add space to the webs.img file with the following command:
>
> dd if=/dev/zero bs=1024k count=12288 >> webs.img

That command is highly useful when use file images directly as partition.
However, when using LVM on domU, that's not the recommended way to
increase domU's storage (at least according to RedHat). It's much
easier to just add new disk to domU, and use
pvcreate+vgextend+lvresize+resize2fs.

>
> then, when i create the webs domu, i.e. xm create webs;
> it starts, and the new space shows up as "unintialized' space
> in the domu. (I see this using vnc to reach the desktop, and
> open the LVM tool to see the new space).
>
> The problem that I'm having is to 'attach' the unintialized space in the
> domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the
> LogVol00 disk to take advantage of the space.
>
> I'm running Centos5 on the dom0, and in the domU. Xen is version 3.
>
> Any suggestions? if so, can you please be explicit as to _where_ to run the
> various
> commands, in the Dom0 or DomU? At this point, I'm pretty confused about
> what to do where....

all on domU, try:
- adjust domU's partition (e.g. using fdisk), so the partition
containing the PV (should be xvda2 on your setup) uses all available
disk  space. A domU reboot afterwards might be necessary. BE CAREFUL
though, this could potentially be dangerous if you accidently mess up
existing partition table.
- run pvresize to get LVM recognize the extra space
- run lvresize+resize2fs

-- 
Fajar

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.