Depending on the operating system that your virtual machine is using, you need to make a few changes within the VM after you have resized its disk.

The following instructions are for existing disks.

Windows Server (2012 R2 in this case | the steps are similar for other versions)

  1. Always make sure you have a recent backup
  2. Connect to your VM via Remote Desktop
  3. Open the Disk Management tool by right clicking the start button and choosing “Disk Management”
  4. Right click the volume of the disk that you resized
  5. Choose “Extend”
  6. Extend to the size that you would like the volume to have
  7. Confirm and wait for the process to complete

win2012-disk-management

win2012-extend-volume

Linux (RedHat 7.2 in this case | the steps are similar for other distributions and OS versions)

  1. Always make sure you have a recent backup
  2. Connect to your VM via SSH
  3. Perform a df -h to check the current state of the file system
  4. Assume root permissions by typing sudo su
  5. Run an fdisk on the disk that needs its partition to change
  6. Use the p option to explore the current partitions
  7. Use d to delete the partition that you would like to extend; this will not remove any files currently using this partition
  8. Use n to create a new partition and run through the available option to create a larger partition as the one you just deleted
  9. Verify the configuration again with p
  10. Choose w to write the changes back to the configuration
  11. If you changed the partition table of the OS disk you may need to restart the machine at this point, for the changes to fully apply.
  12. The disk is now adjusted but we still need to run resize2fs (ext4 file systems) or xfs_growfs (xfs file systems) on the partition we just created to resize the file system.
    This will extend the file system to the size of the partition.
    The process can take several minutes to complete. (depending on your machine’s processing power, the file system used, and the size of the disk)