Monday, November 15, 2010

Extend Windows Server 2003 C Drive

Sooner or later the chances of encountering a Windows based system that is exhausting its free space on C: are pretty good. After years of Windows patching, application updates, etc, even a system that started with a healthy amount of free space on C: can find itself running low. If you happen to be in a virtualized environment you have some good, semi non-disruptive options to resolve this issue.

In the "old days" when the C drive was carved out of physical disk, the only option was to backup the system, repartition, reformat, reinstall, and restore the system(maybe there are/were some advanced partitioning managers that could do this much more simply?). A very lengthy, disruptive and risky operation. With the advent of Windows 7 and Server 2008 R2 (maybe Vista/Server 2008?) Microsoft built in the very handy feature of extending the C: drive live while the system is running - very cool indeed! As long as you have some available space to add, it is a zero downtime operation on those operating systems.

Back to Windows 2000 and 2003. I recently had some Server 2003 virtual machines that have been in service long enough to start running low on C drive space. All the (conservative) cleanup I could muster wasn't going recover enough space for the long haul. If you turn to Google you'll find several ways to accomplish extending the C drive - here I offer what I though was one of the most straight forward and conservative(safe) methods in a VMware environment.

Preparation Steps
  • Get a good backup of the system to be modified (you already regularly do this though - right?)
  • Have a "Helper" Windows 2003 or newer virtual machine you can power on / off without disrupting user services. This system will need access to the vmdk to be extended.
  • Make sure you have free disk space on the vmfs/nas volume to extend your C drive.
  • Downtime required - although minimal it must be planned accordingly
  • Backup, Backup, Backup the original system
  • Shutdown the original System
  • Edit the Virtual Machine's properties and adjust the disk size to the total desired capacity
  • In the Helper Virtual Machine
  • Add the existing, newly extended drive as a new hard drive device
  • Boot up the Helper Virtual Machine
  • Fire up diskpart, execute list volume
  • Execute select volume # where # is the volume number to be extended
  • Execute extend, then exit
  • Shutdown the Helper Virtual Machine and remove the disk device configuration from it (but don't delete the VMDK!)
  • Boot up the original system
  • You may see a checkdisk run - this is OK
  • You may get the "New hardware install please reboot" prompt, go ahead and reboot
  • The system will now have a larger C drive!
This method appealed to me for following key reasons:
  1. Uses Windows native tools to modify Windows partitions.
  2. No copying of data from one disk to another.
  3. It's relatively quick. This can manually be done in around 15 minutes(excluding the backup time).
One potential downside stems from a VMware technical matter. For those who might think: "I'll take a snapshot of my virtual machine before messing with its disk size", you'll quickly notice the VMDK size can not be altered when a snapshot is present. If you are looking to the concept of "Snapshot" as a quick fall-back option, you'll have to get that from your storage or backup solution.

Stumble Upon Toolbar


Rex said...

personally, I don't use the other windows box, I just boot the VM off a bootable BartPE ISO with diskpart and run it from there..

JeffHengesbach said...

Great idea Rex - thanks for the feedback. There's always a few ways to 'skin the cat'.

Matt said...

I do this a few times every week it seems like. It actually works better if your "helper machine" stays up the whole time. This way the drive you're extending will definitely just be an extra drive on the helper and not become the C: drive of the helper. It also helps to pay attention to what virtual SCSI controller you use on the helper machine. The LSI Logic Parallel controller seems to be able to add and remove disks quickly and easily without having to re-scan. The VMWare paravirtual controller, not so much.

xiao said...

Romantic pink is a tender pretty girl can best embody the links of london color; the stars also began to become links of london followers of and romanticpink, aroused a sweet and romantic links of london agitation. See below nine groups links of london pink star.

Microgood said...

Another article about how to extend c drive on server 2003

Michael said...

my favorite is extpart


Oh, and why turn the machine off?