Wednesday, May 8, 2013

Expanding System Drive on a Multiple Partition Virtual Disk

One of the most common requests we receive as a VMware admin is to expand the disk space on a VM. This is usually a very quick and simple exercise that takes no more than 5 minutes. However, last week I received a request that did take quiet a bit longer. Here are the details to the situation:

  • Expand the system drive on a Windows 2003 Server
  • Multiple partitions are on the virtual disk as this server was previously a physical server that was P2V'd
  • Changing the Virtual Hardware and expanding the virtual disk only adds unallocated space to the end of the drive, thus not allowing the system drive to be expanded as the unallocated space is not directly after the system disk

In order to expand the system drive, you will need to download a partition editor software. GParted, a free software which I used can be obtained here.

The first thing step to expanding the system disk is to expand the virtual disk within VMware. Next, take a snapshot of the VM. This will allow us to rollback in case anything bad occurs. Once that is done, mount the GParted ISO file onto the VM and boot up the live environment (accept all the defaults). You should now see something like this:

Please note that the system drive is /dev/sda1 and the gray spot is the unallocated space. We will need to move the unallocated space to be directly after the system partition. Using the GUI interface, click on /dev/sda3 and click "Resize/Move". Drag the partition to the right, then repeat this process for /dev/sda2. You should then have something like this:

Hit apply and then the operation will then start. The partitions will be copied onto their new locations. This will take some time depending on the size of the partitions.

Once the operations have finished, restart the VM and let it load into Windows. A chkdsk should occur to rebuild the partition tables.

Once Windows is up and running, you should now have the option to extend the system disk.

No comments:

Post a Comment