Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command line or similar that I can run to force Windows to recalculate disk size on a VM after resizing the hard drive?

share|improve this question
up vote 3 down vote accepted

Yes there is!

  1. Start CMD in an elevated prompt
  2. Run 'diskpart'
  3. Run 'Rescan Devices'
  4. Run LIST VOLUMES to get the list of volumes
  5. Run SELECT VOLUME #, where # is the number of the volume needing expansion
  6. Run EXTEND to expand the volume into the newly visible free space

We use this procedure for volume extensions on physical servers as well, when the volumes are on a SAN.

share|improve this answer
Thank you. This worked for me. I only had to change EXPAND to EXTEND and it worked like a charm. – Dustin Kendall Feb 4 '11 at 0:18
One of the two, and I always seem to guess wrong! Thanks. – sysadmin1138 Feb 4 '11 at 0:29
BTW on 2008 or Win7, you can do it all from Disk Management - There's an 'extend' option on the context menu for the partition, after you've rescanned. Also, on 2008 and Win7, you can do this on boot volumes. On versions prior, you need to use a GParted LiveCD to resize the partition. – Chris Thorpe Feb 4 '11 at 1:36
That's good to know Chris, thanks. For my particular case I need to script this so this answer was just what I needed. – Dustin Kendall Feb 5 '11 at 5:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.