Saturday, November 22, 2008

Fun with partitions

At work, we are preparing for a major release of a new suite of software to run what we call our "back-office." Essentially, without getting too much into details, I am responsible for a 24x7 network service that is, at least in part, dealing with life-safety and we are planning to swap out the software responsible for this with a new generation of software. All this has to be done without skipping a beat. Lots of preparation has gone into planning this move and we're "this close" to releasing.

We have had a few last-minute gotchas pop up recently, though. One of them is that the people who built our SQL Server machines (64-bit Windows Server 2003) built them in such a way that there was a C-drive partition of 10GB for the operating system and a D-drive partition of 22GB for the applications (not to mention a SAN-based area for data storage). Well, the 10GB of operating system storage just wasn't enough, or at least, didn't seem enough. We had gotten to about 100MB of available space and couldn't do OS updates.

So, we began investigating how we could dynamically and non-destructively change the partition sizes. Our network/server engineer made some tech support calls to HP while I resorted to my old stand-by...experts-exchange. I received many postings with great ideas. Some were saying that 10GB should be big enough. Others were linking me to some freeware tools. Still others to more expensive professional tools. Boy, did I learn a lot!

First, I learned that my C-drive was not so clean. There were "installation" folders for both the original O/S install, as well as the service pack installs, sitting on the C-drive. I was able to move them off by copying them to the D-drive and editing my registry to point to the new folder. (See this site for some specifics on moving the "Service Pack Files" folder - there was a similar copy/edit for the AMD64 folder in the C-drive root). So, after these folders were cleared out, I suddenly had almost 2GB free. Probably enough, but I was not satisfied.

I pursued the route of the gnu-tool for partition editing - GPartEd. This was recommended to me, so I figured I'd give it a shot before plunking down $500 or more on some "professional" package to do the same job.

Download and CD creation was a breeze with the ISO image. Booted to the CD and the tool could not be more intuitive and simple to use. Click here, drag there and boom! the partitions were changing right before my eyes. Shrink one, grow the other...2 hours later, I was ready to reboot and feeling confident.

Um...not so fast. When I booted, I got a message that my C-drive had ZERO free space - this after ADDING 5GB to the partition! And to go along with that, my D-drive was nowhere in sight. GONE! I freed up a LITTLE space (140MB or so) and was able to use the Disk Manger to recover the D-drive, which was still there and healthy, thankfully.

Then I rebooted and upon logging in, I saw that there was a new 7GB "pagefile.sys" file sitting on the C-drive. Somehow, GPartEd must have dropped all this newly created space into that file. I confirmed that I was not using this file (my swap file was on the D-drive) and deleted it. Voila! I'm now swimming in free space on my O/S partition. All this I did on a STAGING server and not one that I was planning on using for our upcoming deployment (thankfully).

I probably will not be using GPartEd on my production server(s), as I just don't think I can trust it (they say you only get ONE first-impression, and while the final result was good, the road there was not great). The 2GB I have free on that machine now will suffice for the foreseeable future and should the need arise to fix that, I will probably bite the bullet and purchase some "professional" software to do the job, though I certainly know that it no guarantee, but at least there's someone at the other end of a tech-support line should something go wrong.

No comments: