Xen, fdisk, resize, why oh why...

« previous entry | next entry »
Aug. 25th, 2007 | 11:06 am

So last night I had to resized one of my Xen partitions. So what was the magic to make this happen?


dd if=/dev/zero count= >> /var/lib/xen/images/shiitake.dsk


Then? I need to increase the partition map for my disk:


fdisk /dev/xvda


What did I do in fdisk? I deleted the partition, and then recreated it with the new available blocks. Of course the machine was running at the time. What is life without a few risks? But I have to ask myself, why doesn't fdisk have a resize command? I swear that tool hasn't changed in well over a decade.

I am running LVM so then I had to:


pvresize /dev/xvda2
lvresize -L +5G /dev/VolGroup00/LogVol00


And finally since the filesystem is ext3:

e2fsck -f /dev/mapper/VolGroup00-LogVol00
resize2fs /dev/mapper/VolGroup00-LogVol00


So why post all of this here? For one it took me a while to figure it out, so I now have a record.

The other reason is to complain about virt-manager. The GUI, hell the command line controller, could have done all of this for me. The steps to increase a partition are quite byzantine and frankly I can see the entire "pay for time" equation pushing someone into just wanting to buy VMWare.

It works :)

Link | Leave a comment | Share

Comments {0}