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

RE: [Xen-users] howto grow a domU disk image


  • To: "Fajar A. Nugraha" <list@xxxxxxxxx>
  • From: "Joe Linoff" <jlinoff@xxxxxxxxxx>
  • Date: Sun, 30 Jan 2011 09:59:26 -0800
  • Cc: xen-users@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Sun, 30 Jan 2011 10:01:37 -0800
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Thread-index: AcvApNq7vu4wFzdnSa6uU397S8YG3wAAWN+A
  • Thread-topic: [Xen-users] howto grow a domU disk image

Hi Fajar:

Thank you for your feedback and insights.

>  You DO know that you can just add a new disk image to domU and add it
> to the LVM, right?

Yup but I appreciate the feedback.

This was a production VM with local data. I ran into trouble when I needed to 
add another set of packages and was out of space. I needed to keep everything 
and simply extend the root partition a bit.

Of course I could also have mounted the image on the dom0, backed up the data, 
re-created the new image and the copied it back but I wanted to try something 
different :-) 

> I'm guessing virt-resize will copy the data from the old disk to the
> new, bigger one.

Yup

> If so, it'd create I/O load to the disk which might not be desirable
> if you have other domUs running.

Agreed. This is an important point that folks who want to try this will want to 
consider but it is pretty fast. If someone wanted to try this, I would strongly 
recommend doing it in a lab system first to if the performance hit was 
acceptable.

> Adding a second disk to the LVM set has the benefit of:
> - doesn't require copying existing data
> - can be done live without shutting down domU

Agreed, but in this case to get the extra packages onto the system I would have 
had to split them between the old and new disks. Of course I could have made 
both disks part of the VG and extended the LV which is also a reasonable option.

Thanks again, as I mentioned earlier, this forum has been just great and I 
really appreciate the help that you and other folks provide.

Cheers,

Joe

-----Original Message-----
From: Fajar A. Nugraha [mailto:list@xxxxxxxxx] 
Sent: Sunday, January 30, 2011 9:40 AM
To: Joe Linoff
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] howto grow a domU disk image

On Mon, Jan 31, 2011 at 12:23 AM, Joe Linoff <jlinoff@xxxxxxxxxx> wrote:
> My particular image had two
> partitions: ext3 for /sda1 (/boot) and lvm2 for /sda2 (/, swap, etc.)
> for the rest. Tools like gparted don't work with lvm (yet).

You DO know that you can just add a new disk image to domU and add it
to the LVM, right?

>   % # Create a new image of the correct size, in this case 16GB.
>   % dd if=/dev/zero of=newdisk bs=1GB count=16
>
>   % # Resize.
>   % virt-resize --expand /dev/sda2 vm01.img newdisk

I'm guessing virt-resize will copy the data from the old disk to the
new, bigger one.
If so, it'd create I/O load to the disk which might not be desirable
if you have other domUs running.

Adding a second disk to the LVM set has the benefit of:
- doesn't require copying existing data
- can be done live without shutting down domU

>   % mv vm01.img{,.too-small}

Good trick, I didn't know you can do that.

Glad to hear you were able to solve your problem.

-- 
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®.