Resizing a virtual hard disk
Recently, I had to resize a VHD (virtual hard disk) that I installed Windows Server 2008 on. I soon found out that the size of 10GB is not such a hot idea when installing Team Foundation Server 2010 and SQL Server 2008 on the same instance. Hence, I decided to resize the disk instead of re-installing all of the software.
Below is the recipe to resize the virtual hard disk:
Part 1:
The first part is to resize the container of the partition, which is done by means of a sector copy. After the resize completed, the container will have increased but the partition will not be fully extended yet.
- Download VHD Resizer from VMToolkit.
- Install and run VHD Resizer.
- In the file open dialog select the VHD that you want to resize.
- Type in the new filename to use for the extended VHD.
- Type in the size of the new container to create.
- Click on Resize. The process takes a few minutes…
Part 2:
Now that the container is resized, we must now extend the partition to make use of the full container size.
- Attach the new extended VHD as a non-primary drive to another virtual machine. Do not extend the partition using the virtual machine that will make use of it.
- Start the virtual machine to which the extended VHD was attached as the non-primary drive and open a command prompt.
- Type in diskpart and press Enter.
- Type in list disk.
- Ensure that disk 1 or greater is the extended disk.
- Type in select disk 1.
- Type in list partition.

- Ensure that the partition sizes matches the old size.
- Type in extend.
- Wait for the process to complete and type exit.
Remember to change the disk on the original virtual machine to now use the extended disk. The disk is now resized and ready to be used from the original virtual machine.
AWOL CD-ROM
For the second time now I have had the CD-ROM drive on my HP nw8440 disappear from Windows. The Device Manager reports the following for the CD-ROM drive: “Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)”. Why? It was perfect yesterday and today it is missing or corrupted? Weird. According to the Microsoft Knowledge Base article it can happen after removing a CD or DVD burning program.
Although the error is rather annoying, there is a simple fix for it. I have replicated the steps here for your convenience:
Step 1: Start Registry Editor
Start Registry Editor.
Step 2: Delete the UpperFilters registry entry
- In Registry Editor, expand My Computer, and then expand HKEY_LOCAL_MACHINE.
- Expand SYSTEM, and then expand CurrentControlSet.
- Expand Control, and then expand Class.
- Under Class, click {4D36E965-E325-11CE-BFC1-08002BE10318}.
- In the details pane of Registry Editor, on the right side, click UpperFilters.Note You may also see an UpperFilters.bak registry entry. You do not have to remove that entry. Click UpperFilters only.
- If you see the UpperFilters registry entry in the details pane of Registry Editor, go to step 6.
- If you do not see the UpperFilters registry entry, you still might have to remove the LowerFilters registry entry. To do this, go to “Step 3: Delete the LowerFilters registry entry.”
- On the Edit menu, click Delete.
- Click Yes when you receive the following message:
The UpperFilters registry entry is removed.
Step 3: Delete the LowerFilters registry entry
- In the details pane of Registry Editor, on the right side, click LowerFilters.Note You might see a LowerFilters.bak registry entry. You do not have to remove that entry. Click LowerFilters only.
If you do not see the LowerFilters registry entry, unfortunately this content is unable to help you any more. Go to the “Next Steps” section for information about how you can find more solutions or more help on the Microsoft Web site.
- On the Edit menu, click Delete.
- Click Yes when you receive the following message:
The LowerFilters registry entry is removed.
- Exit Registry Editor.
The article recomends restarting the computer after deleting the two registry entries, but I have found that it works fine without restarting.
Rebuilding the COM+ Catalog
After my post on rebuilding the WMI Repository, I thought it might be a good thing to write a post on rebuilding the COM+ Catalog. It is unlikely that you’ll ever have to rebuild a corrupt COM+ Catalog, but it certainly is possible, for example when you get errors such as “Catalog Error 8008005 – Server Execution failed”.
This article by Microsoft describes the process to follow when rebuilding the COM+ Catalog. I’ve duplicated the steps here for ease of reference:
- Rename the %WinDir%\System32\Clbcatq.dll file to %WinDir%\System32\~Clbcatq.dll. Make sure that you include the tilde (~) at the start of the file name.
- Restart the computer.
- Start Registry Editor (Regedt32.exe).
- Locate and delete the following key in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\COM3
- At a command prompt, type cd %windir%, and then press ENTER.
- At a command prompt, type rmdir /s Registration, and then press ENTER. This is the location folder of the registration database. Note: If you have MS04-012 installed, you must now re-install MS04-012. For more information about security update MS04-012, click the following article number to view the article in the Microsoft Knowledge Base: 828741
- Click the Start button, point to Settings, and then click Control Panel.
- Double-click Add/Remove Programs, and then click Add/Remove Windows Components.
- Click Next to go through the reinstallation process, to reinstall COM+.
- If IIS is installed on the computer, IIS creates several COM+ applications. These applications will now be missing. To re-create these applications, run the following command at a command prompt: rundll32 %windir%\system32\inetsrv\wamreg.dll, CreateIISPackage
Rebuilding WMI Repository
After having a bit of a struggle with Service Pack 1 for Team Foundation Server 2008, I had to restore a previous installation of Team Foundation Server 2005. After restoring the server, which runs on Virtual Server 2005 R2 everything seemed fine. It was only when trying to upgrade Team Foundation Server 2005 to 2008 that I received an error complaining about the WMI provider for SQL Server 2005.
Trying to look into this issue, I opened the SQL Server Configuration Manager and then received the following error:
“Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager.
Initialization failure [0x80041014]“
This is not pretty. I went to Google the issue and discovered this post. It seems like the WMI repository corrupted when I did the restore. Nice. So, I followed the instructions detailed in the post, but no luck. It still returned with the same error that I received in the beginning.
The WMI Repository was corrupt in its entirety. How do you rebuild the WMI Repository? Not so easy it seems. Lukcily there is post describing the whole process with a neat little batch file that will rebuild the WMI Repository for you, came in very handy.
Note: Execute the following commands from this directory: C:\Program Files\Microsoft SQL Server\90\Shared
Here is the batch file duplicated for convenience:
net stop winmgmt c: cd %systemroot%\system32\wbem rd /S /Q repository
regsvr32 /s %systemroot%\system32\scecli.dll regsvr32 /s %systemroot%\system32\userenv.dll
mofcomp cimwin32.mof mofcomp cimwin32.mfl mofcomp rsop.mof mofcomp rsop.mfl
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b *.mof') do mofcomp %%s
for /f %%s in ('dir /b *.mfl') do mofcomp %%s
echo DONE pause
mofcomp sqlmgmproviderxpsp2up.mof
After performing the above steps, I rebooted the server and Team Foundation Server upgraded successfully.

leave a comment