Sunday, February 20, 2011

Aligning VM Disk Partition

Windows:
Very easy, boot Windows using Gparted, resize the partition with 1 MB free space before will be done.

Linux:
If you are not using LVM, simply do it using Gparted.
If you are using LVM (You can do it online, by move VolGroup from disk to disk!),
1. add a disk same size as the disk you want to align (E.g. the original disk /dev/sdb1 is 40G and belongs to VolGroup01)
2. using fdisk, create a new partition on /dev/sdc, moving beginning data to 128 (http://www.tcpdump.com/kb/virtualization/vmware-esx-server/vmware-disk-alignment/vmfs-liux.html)
3. pvcreate /dev/sdc1
4. vgextend VolGroup01 /dev/sdc1
5. pvmove /dev/sdb1 /dev/sdc1
6. vgreduce VolGroup01/dev/sdb1
7. pvremove ./dev/sdb1
8. shutdown your machine and remove your disk /dev/sdb1

REMARK: if you are using thin disk, this method will allocate whole disk size, you might want to shrink it be Storage Vmotion.

No comments:

Post a Comment