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?
Asked
Active
Viewed 9,099 times
1 Answers
7
Yes there is!
- Start CMD in an elevated prompt
- Run 'diskpart'
- Run 'Rescan Devices'
- Run LIST VOLUMES to get the list of volumes
- Run SELECT VOLUME #, where # is the number of the volume needing expansion
- 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.

sysadmin1138
- 133,124
- 18
- 176
- 300
-
Thank you. This worked for me. I only had to change EXPAND to EXTEND and it worked like a charm. – Dustin Kendall Feb 04 '11 at 00:18
-
1One of the two, and I always seem to guess wrong! Thanks. – sysadmin1138 Feb 04 '11 at 00:29
-
2BTW 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 04 '11 at 01: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 05 '11 at 05:25