Resize a Xen Image

Published on Nov. 8, 2006

So, you've got a few Xen images around, and they are starting to fill up. How do you add a few more gigs to 'em?

 root@tpe:/# xm shutdown vm01
root@tpe:/# cd /xenimages
root@tpe:/xenimages# dd if=/dev/zero bs=1024 count=1000000 >> vm01.img
root@tpe:/path/to/images# resize2fs -f vm01.img
That's it, you just added a gig to your image called 'vm01.img'.

Tagged As: Virtualization | Tips, Tricks and Hacks | My Big Fat Server
Jun 21 2007
12:13 p.m. mexico
#1

I tried the above and upon givine the resize2fs command I get this:
"resize2fs: Bad magic number in super-block while trying to open vm01.img
Couldn't find valid filesystem superblock."

any advice?

Jun 24 2007
1:15 a.m. taiwan
#2

Are you 100% sure the image is formated as ext2/ext3? If it is as reiserfs, you'll need to use the 'resize_reiserfs' command.

Comments are currently closed for this entry.