Wednesday, March 19, 2014

Expand a Basic Drive with Dell ExtPart

Last night I was assigned the task of expanding the C: drive on a Windows Server 2003 virtual machine. But wait, when I right click on the C: drive within Disk Management I'm not seeing the option 'Expand Drive'....


What to do now...


First we must Increase the virtual machines c: drive space from within VMware.

Right click the VM > Click 'Edit Settings' > Increase the size to the size you would like to expand the drive to.
From the computer you are expanding the drive on you can open a PowerShell prompt and type:
"rescan" | diskpart 
which will in turn pipe the Diskpart command(rescan) into Diskpart. Pretty neat huh?

 Now you should be able to see the unallocated space that you just assigned to this computer in VMware. 

Now for the really fun part..

Since this C: drive is a basic disk we won't be able to expand this drive via the GUI or with Diskpart(Diskpart cannot expand C: drives)
Download and save the Dell Extpart utiltiy to a location of your choosing (I always choose C:\Dell\ExtPart\).
1. Open an elevated command prompt > browse to the extpart.exe location . In my case C:\Dell\ExtPart by typing "cd c:\dell\extpart\". Now hit 'Enter' and type "extpart.exe".


2. Type the Drive letter which you want to extend and then the number of MB's you would like to add
C: <MB to expand drive by>
which will expand the drive specified by 60 GB.



3. Now specify how many MB you would like to expand your C: drive by. We have 60 GB of unallocated space so I specified  61440 MB which will hopefully consume all of the unallocated space..
The drive has now been extended and is showing a new volume size of 81981 MB! 








Looks like we have 16 MB hanging around yet...
That's easy, follow the same steps as above only this time there shouldn't be much math involved, just run the command:

extpart.exe c: 16


Boom, our C: drive has been successfully expanded!!

SystemName Drive Size (GB) FreeSpace (GB) PercentFree
---------- ----- --------- -------------- -----------
COMPUTERNAME C:    80.0      61.6           77.06 %