How to prevent Windows registry corruption

I want to point out that this text is not “how to fix” error itself, but the idea of how to prevent or protect yourself from that kind of errors.bsod

Few days ago while Windows startup I stumble upon BSOD (Blue Screen of Death). Main problem was registry corruption that could occur because of HDD hardware malfunction (i.e. bad block) or many other reasons.  Message that i saw was similar to:

STOP: c0000XXX {Registry File Failure}
The registry cannot load the five (file):
\SystemRoot\System32\Config\[file name]
or its log or alternate.
It is corrupt, absent, or not writable.

The “file name” and error number vary depending on what file was “damaged”.

How to deal with this situation is widely described on many web pages including MS site. What I want to share is “solution” how to prevent or protect yourself from this kind of situations.

This text apply to all Windows variations, due to simplicity sake I use my Windows XP 32bit installation, so path can vary depending on Your Windows version.

I know that when You have enabled “System Restore” the hives files are stored on HDD in regular intervals so it is not a big problem to restore them, but what if you don’t have that enabled? (i.e. to save some HDD space)

Idea here is to manually COPY entire folder with registry hives (“%SystemRoot%\system32\config“). Someone says that doing this:

1. Is security risk
2. You actually can’t do that ^_- (files are copy protected while system is running)

That’s of course true, but this article is aimed to home users so security is not main concern, but if someone want to maintain appropriate security level then file can be burn on CD-RW or some other “off line” file system / media.

To deal with second “obstacle” you need to use Linux Live CD (or use another OS, if you use dual boot). I recommend using some of [U/K/X]buntu distros simply because they come with nice GUI tool to manage NTFS partitions. Burn Live CD and run operating system from it.

Next step is to mount Windows “%SystemRoot%” drive/partition and copy all files that are in “%SystemRoot%\system32\config“.

Depending on what you want to do with the files you can create i.e. “backup” folder or burn files on CD-RW.

When the error occurs again simply launch Live CD and copy “damaged” file from you “backup location” to “%SystemRoot%\system32\config” and everything should work again just fine (1).

Why to use this solution? In my opinion it is better then “System Restore” due to relatively smaller space requirement (around 75MB with my all application installed) and MUCH FASTER “recovery” procedure, smaller and faster solution then “ghosting partition”.

(1) WARNING:  I want to point out that “best” time to create backup is when you all “favorite” applications are installed. Why is that? Because doing “backup” you actually “freeze” every settings on you current Windows installation. When you install NEW application some settings are stored in registry (depending on application) so when you restore old registry “new” information aren’t there. In that case simply installing the application in the same path, that will “fix” it.

I use this method around a year now and I survived around 5 hive file “corruption”, error with registry size exceeding 250MB and probably some more in near future :).

Best regards


Comments are closed.