Resizing a Linux disk image file
Here’s a quick how-to on creating a larger Linux disk image file and transferring the contents of an existing image to it. For example, most of the Xen images on this site are 1 GB – but you probably would want them to be much larger if you were going to actually *use* them. Here’s what to do:
- Create a new disk image fileUsing the dd command, create a blank image file of whatever size you need (I’ll use 5 GB as an example here):
dd if=/dev/zero of=new_image.img bs=1 count=1 seek=5G
- Format the disk image
In this case, I’ll use the ext4 filesystem. You’ll get a warning because you are formatting something that is not a block device (disk). Just say yes when it asks you to proceed anyway.
Continue reading this post »
