Sunday, December 18, 2011

Converting a Clustered Shared Volume (CSV) from MBR to GPT without data loss

Today i converted a MBR disk to GPT without data loss. The goal is to overcome the 2TB volume limit
The disk was a CSV disk in a Windows 2008 R2 Hyper-V Cluster.

Here is the procedure :

  • Export the VM on your CSV or check your VM backups first in case something goes wrong
  • Put HA VMs offline in order to quiesce I/O on the CSV for additional security.
  • Put your CSV on maintenance mode. Check the node on which the CSV resource is online
  • Download GPT fdisk at http://sourceforge.net/projects/gptfdisk/ and extract on the node on wich the CSV is online
  • On the said node, run GDISK on a command prompt
  • Say yes to the prompt to accept MBR to GPT conversion
  • Type w to commit changes to the disk. It will not overwrite your partitions in the sense that it will erase data on it, so say yes again
  • Rescan disks in Disk management. Check the disk properties, volume, and verify that the disk type is now GPT
  • Disable maintenance mode on the cluster and disable redirected access, if unable to disable redirected access,take the CSV offline and back online
  • Put your HA VM back online. to test everything is OK before extending the Windows volume
  • Try to move your VM (ideally using live migration) from one node to the other and back. If unable to do so, stop the cluster service on the offending node and start it again using the cluster console. Retry moving VMs. It should work now.
  • Now you will be able to extend your Windows CSV volume beyond 2TB (you can stop VMs and put back on maintenance mode and extend on the node that owns the CSV disk if you want total security)
Notes : MBR to GPT should work fine in most scenarios (in my case 1 primary partition, large offset  (2048 sectors) to the beginning of the first partition to fit MBR structures, plenty of space at the end of the partition (since i was preparing an extension)