Extending the Windows system drive

how to extend a drive

Have you ever run out of space on your system c:\ drive? This causes massive machine headaches, and its totally unnecessary if you are running your Windows machine as a guest operating system in a virtual environment. This is how, without purchasing any special licenses (other than Windows and VMware) that you can extend the system drive.

Note that for Windows 2008R2 and Windows 7, the diskpart utility supports extending system and boot drives, so that there is no reason to go through these steps. These steps are applicable to Server 2003, Server 2003 R2, and XP. You can use these steps on Windows 2000 machines, if you download and install diskpart from the Microsoft website.

  1. First, give the guest a larger physical drive:
    • In vCenter, shut down the machine and collapse all vmware snapshots.
    • In vCenter, edit server settings and increase disk size.
    • In vCenter, using edit server, note where the disk physically rides. You will need this information next.
    • Note: if there are snapshots or the machine is running, this will be greyed.
  2. Then, use a different virtual machine, running the same OS, to extend the NTFS partition:
    • Clone the machine (or find another with the exact same OS).
    • Attach the disk that needs extending to the clone:
      1. In vCenter, edit the clone, remove network connections (to prevent network problems on bootup).
      2. Start the clone (important: if you run steps in the wrong order, 2.3 then 2.2, it does not work!).
      3. In vCenter, edit the clone, add a second harddrive and point to the c:\ drive that needs extending.
    • In the clone, validate the disk and assign it a drive letter:
      1. Open Administrative Tools | Computer Management | Disk Manager.
      2. Highlight the second disk, right-click, and assign a drive letter (e.g. F).
    • Extend the disk in the clone:
      1. Open a DOS prompt in the clone. (Run | CMD)
        diskpart (works in XP, 2003, 2008, Vista, and 7)
      2. List volume (note: not plural).
        ==> Figure out which volume # is the drive letter you just assigned (note: the order varies).
      3. Select volume #
      4. Extend (note: extends to the maximum available space)
      5. Exit (closes DiskPart).
      6. Exit (closes the DOS prompt).
    • Validate and shutdown clone:
      1. Look at Disk Manager and see that the volume has been extended.
      2. Shutdown the clone machine.
  3. Final steps to clean up after yourself:
    • In vCenter, remove the second harddrive settings (do not delete the harddrive!) from the clone.
    • Start the original guest machine. The harddrive will be larger!
    • To avoid confusion, in vCenter, remove the clone from inventory.
    • To save space, using vCenter, you can browse to the datastore, and delete the files associated with the clone.