LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   What is the easiest way to increase the size of a Xen Image made from an image? (http://www.linuxquestions.org/questions/linux-software-2/what-is-the-easiest-way-to-increase-the-size-of-a-xen-image-made-from-an-image-775088/)

abefroman 12-11-2009 10:45 PM

What is the easiest way to increase the size of a Xen Image made from an image?
 
What is the easiest way to increase the size of a Xen Image made from an image?

TIA

worm5252 12-12-2009 03:55 PM

30 seconds on google mate, http://www.vinacis.net/content/view/32/32/

I am using Xen to create Virtual Machines, but how can I resize the virtual disk image?

Solution:

This solution is to increase your virtual disk size:

cd /var/lib/xen/images/vlinux1

#use dd to create a 1 GB file

dd if=/dev/zero of=Tempfile bs=1024 count=1000000

#append this file to virtual image file (in this case is hda)

cat Tmpfile >> hda

resize2fs -f hda

abefroman 12-14-2009 09:51 PM

Quote:

Originally Posted by worm5252 (Post 3789160)
30 seconds on google mate, http://www.vinacis.net/content/view/32/32/

I am using Xen to create Virtual Machines, but how can I resize the virtual disk image?

Solution:

This solution is to increase your virtual disk size:

cd /var/lib/xen/images/vlinux1

#use dd to create a 1 GB file

dd if=/dev/zero of=Tempfile bs=1024 count=1000000

#append this file to virtual image file (in this case is hda)

cat Tmpfile >> hda

resize2fs -f hda

Not much help, considering /var/lib/xen/images/ is empty.

worm5252 12-14-2009 09:58 PM

Instead of /var/lib/xen/images/ cd to the location of your xen images.

abefroman 12-14-2009 10:11 PM

Quote:

Originally Posted by worm5252 (Post 3791734)
Instead of /var/lib/xen/images/ cd to the location of your xen images.

I figured that much, but the last command still doesn't work:
Code:

[root@xen100 xen]# resize2fs -f testsrv1.img
resize2fs 1.39 (29-May-2006)
resize2fs: Bad magic number in super-block while trying to open testsrv1.img
Couldn't find valid filesystem superblock.
[root@xen100 xen]# resize2fs -f /dev/hda2
resize2fs 1.39 (29-May-2006)
open: No such file or directory while opening /dev/hda2
[root@xen100 xen]#



All times are GMT -5. The time now is 01:03 PM.