[Fedora-xen] extending size of image

Jed Reynolds lists at benrey.is-a-geek.net
Sat Apr 8 07:26:21 UTC 2006


John writes:
> So maybe this should be corrected in that web page.
> I have a question:
> Can the size of a file which was created thus
> (dd if=/dev/zero of=fedora.img bs=1M count=1 seek=1024)
> be changed ***without*** causing a damage to its contents?
> In case there is such a way, how can it be done ?
> Regards,
> John

When managing UML images, I typically create a new image of the same 
size and then rsync across them. This is not the most efficient, but it 
is the most reliable. I've tried changing the seek parameter of an image 
using dd for an image, but I've found that resizing filesystem often 
fails or does not take effect.

You could try changing the seek of the image and then running resize2fs 
against it, but I'd bet you $1 you'd lose that data. Safer to try 
something like this:
dd if=/dev/zero of=additional.img ...
cat fedora.img additional.img > new.img
resize2fs new.img

I'm sure there's other ways. I've seen this discussed on the 
user-mode-linux.org site.

Jed




More information about the Fedora-xen mailing list