Monthly Archive for July, 2008

Recovering from Windows registry hive corruption, the clever way.

I like this trick. Every time I do it, I think about all those people doing repair installs (in-place upgrades).

It works pretty much every time unless the filesystem is really truly screwed, in which case you need a backup, say from the system restore directory (System Volume Information), as per this knowledgebase article (don’t bother with the recovery console though, use your USB to IDE or USB to SATA cable and fix it from your laptop.)

Here are the symptoms. You try to start up your Windows 2000/XP (Vista too?) computer and you get a message, white text on black background:

Windows could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM

or

Windows could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SOFTWARE

Sometimes, the message is cut short, so you might see “\WINDOWS\SYSTEM32\CONFIG\SYS” or similar. Hint: If it’s really cut short, and you can’t see if it’s SOFTWARE or SYSTEM, do the following procedure on both files. Whichever one is identified as having been repaired, well that’s the one that was broken ;)

Anyway, how to fix it in 2 minutes:

Use your USB to IDE/SATA adapter cable, and connect the broken machine’s hard drive to your laptop, or your spare PC or whatever. You don’t have to use a USB to IDE/SATA adapter cable - if you’re a person at home with another PC you can stick the drive on a spare IDE or SATA channel. You just need to get that hard drive into a working Windows XP computer for a few minutes.

Windows will mount the broken computer’s hard drive as, say E: or F:. Make sure you have your computer set to show hidden files and also system files. To check this, go into My Computer -> Tools -> Folder Options, -> View Tab, and select “Show hidden files”, and make sure “Hide protected operating system files” is not ticked.

First things first, run chkdsk on that drive, after all it is most likely filesystem corruption that has caused the registry to become corrupt in the first place. In My Computer, right-click the broken computer’s drive and choose properties. Go to tools, “Check Now”, put a tick in only the first box (Automatically fix filesystem errors), and click start. Let that finish before continuing.

Here’s where the magic happens. Go to start -> run, and type regedit [enter]. This will launch the registry editor on your computer. In the registry editor, highlight HKEY_LOCAL_MACHINE, and then go to File -> Load Hive. Find the file that is “missing or corrupt” (from your error message earlier), and choose to load that. It will be in E:\(or F:\)Windows\System32\Config, and will be called just SOFTWARE or SYSTEM. Regedit will ask you to name the hive, just type “badpc” (any old garbage will do - it’s only temporary).

Regedit will say “One or more files containing the registry were corrupt and had to be recovered by use of log files. The recovery was successful.” You have just repaired the registry! Now you need to Un-load that hive, so highlight that “badpc” hive that you can now see under HKEY_LOCAL_MACHINE, and go to File -> Unload Hive.

You now just need to put that hard drive back in the broken computer, which hopefully won’t be broken any more! If you used a USB to SATA or USB to IDE cable from your laptop, make sure you use the “Safely remove hardware” icon in the system tray next to the clock to safely remove the hard drive, else you may cause filesystem corruption again. Alternatively just shut your laptop/working computer down properly and remove the hard drive once it’s shut down.

All done.

Some background:

The registry is a database. It has transaction log files which can be used to recover from corruption. It would appear that the early Windows boot process is not able to work with those log files, but regedit (and Windows itself further on in the boot process) is.

Dell’s new(ish) PowerEdge T300 server

I thought I’d take some photos and do a brief overview of the Dell PowerEdge T300 server.

I have supplied and installed a few of these to my customers, and I think it is my favourite small business machine for now.

This is a single-socket (i.e. single CPU) machine, although that single processor is a Quad Core Xeon, so it’s not such a negative point really. I have found in the past that I have gone for dual-socket servers, because they are naturally reasonably high-end rather than being more like a basic desktop, but these servers have always been left with the second CPU socket empty, and by the time you might think about adding a second CPU, those CPUs are long gone off the shelves and the price/performance of a replacement machine makes replacing the whole machine much more viable. So I am happy that this a single-socket machine - that’s perfect for the small businesses that I deal with.

For less than £600 +vat, this machine comes with a 2.5GHz Quad-Core Xeon CPU, 4gb RAM, a SAS 6iR RAID-0/1 controller card, and 2×160gb SATA hard disks configured as a RAID1.

What I do then is head off to http://www.scan.co.uk or http://www.microdirect.co.uk and buy a couple of large capacity hard drives. The machine comes cabled up ready to take up to four drives on the SAS 6i/R card. The SAS 6iR can create multiple RAID1 (or RAID0 if you’re that way inclined) volumes. So all we do is drop in a couple of 1,000gb Seagate HDDs, and create a large, cheap, mirrored storage volume.

The machine only has a single half-height 5.25″ drive bay free. There are two bays in total but the first is taken up by the DVD-ROM drive. This limits your choice of tape backup drive. The backup choices from Dell are even more limited - last time I checked they were only offering those cartridged 2.5″ SATA hard drive things. What I do is head over to Scan again, and pick up a Freecom DLT-V4 half-height 160/320gb SATA DLT drive. This completes my current favourite small business server. The Freecom drive uses SATA power and SATA data, and slots perfectly into the PowerEdge T300 like it was designed to be there in the first place. The drivers that Windows Update offers for the SATA DLT do not work properly, but Quantum’s website has working ones.

I recently did a setup like this (running SBS 2003) for a chap who works from home. In his case I used an internal Freecom 36/72gb USB DAT drive for reasons of cost and lower noise (the server was next to his bedroom). Unfortunately the PowerEdge T300 has no molex power connectors at all, only SATA power. Therefore a SATA Power -> Molex adapter is required, which is precisely the opposite of what you will have lying around. These adaptors are available for a few pounds online though. The Freecom USB DAT drive comes with a USB B to motherboard header (7/8 pin) cable. Here comes the second gotcha of the PowerEdge T300 - no internal USB headers, however, there is a USB A port on the motherboard, so you use a regular USB A->B cable but inside the server, as strange as that seems (see photo of internal USB A port on the motherboard).

The PowerEdge T300 comes with dual gigabit ethernet ports as standard, provided by a Broadcom chipset.

There are three PCI-E x8 slots, one PCI-E x4 slot, and one full length PCI-X slot which I assume would also accommodate a regular 32-bit/33MHz PCI card such as a modem, ISDN adapter or WiFi card for example. You can’t see the PCI-X slot in the pictures because it’s right below the SAS RAID card.

There are six SATA 3Gbps connectors built onto the motherboard, in case you do not opt for the SAS 6iR RAID 0/1 card or a full-on PERC 6 RAID-everything card. One of the onboard SATA ports is taken by the DVD-ROM drive.

After fitting the extra hard drives as in the pictures (four non hot-plug SATA drives total), there is one spare SATA power connector which can be used for the tape drive or whatever you fancy.

There are six DDR2 DIMM slots.

The front LCD display panel can display text of your choice, for example the company name and telephone number in case the item is stolen and ends up in a responsible person’s hands.

The server is available with the option of Hot-Plug/pullout hard disks. I have not encountered this configuration though. It also looks like the machine has the option of dual/redundant power supplies, since the rear is labelled “1″ and “2″.

As usual with Dell’s servers, everything is extremely well put together and designed. There are no little hairdrier chipset or CPU fans, just large slow-turning fans and lots of properly designed ducting panels to allow good proper airflow. This is what I like most about Dell’s servers, for this kind of money everything is spot on.

Some pictures. This is my first attempt at a blog so I apologise for rambling on and not laying things out in a clear and conscise manner. I may come back to do some editing later :)