Wednesday, September 27, 2006

When a system becomes corrupt....

Have you ever had a system running stable for years and suddenly everything goes wrong?

It started last Saturday, when one of my usb-backup drives died. No big deal. I have two external backup drives with at most one attached to my system. I do weekly full backups and daily incremental backups on important data. I swap drives from time to time (I should swap them every day) and keep some old backups.

On Monday my DSL connection died. No problem, I have a ISDN USB modem I can use in those cases. The modem was cheap but the driver sucks: it uses 100% CPU even if nothing is going on. Well, no problem, I downloaded a new driver, created an XP system restore point and installed the driver. Well, I tried different versions of the driver. No one really helped, the last one crashed my system. OK, I did a "system restore", but during shutdown the driver crashed my computer. Restart, login ... baang! Windows forgot my user settings! It created a new profile. All settings lost!

No problem, I first create a backup (it's always a good idea to backup the entire system, even if is corrupt, before you mess around!) and then I wanted to back the last full backup...

Big problem! The last backup is corrupt, and the most recent backups are on my dead drive...

...for the last 12 hours I have been playing back different versions of backup trying to restore my user data. In between I have between googling for the potential problem of my setup, with little success. Whenever I restored my latest user data in C:\Documents and Settings\<username>, windows decided to create a new profile for me. I got very very frustrated and finally accepted the fact that I have to live with a new profile and I have to set up my environment from scratch. I copied all my user data into the new profile....

...Firefox, Thunderbird, cygwin, eclipse are applications that did not loose data and were running as before. But my desktop, internet explorer and many other applications that depend on the registry lost their settings. The worst case was Outlook, it wants to be reinstalled and looses all setting that are not on the exchange server...

So, I asked myself, is there a way to get my personal registry settings into my new profile? Finally I stumbled over the important files: the C:\Documents and Settings\<username>\ntuser.* files. From my "after the problem" backup I figured out that the file ntuser.dat file was missing.

Was that the key to my problem? Did loosing the ntuser.dat cause all the troubles? Ok, I had to try it. I copied an old version from a backup into my corrupt profile. Hmm, but how to tell XP to use my old profile directory again? A quick search in the registry revealed that the profile directory is stored under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList/*. I changed it, renamed my new profile to something else and restarted....

WOW! It works. My system is back. Outlook works, my desktop looks like always, all applications work as expected. I'm happy again....

What has my windows problem to do with eclipse?

Eclipse does not use the registry, but it has the magic .metadata directory. Over the last 5 years my .metadata directory got corrupt several times. If something goes wrong with the ..metadata (like running out of disk-space), it's very hard, if not impossible, to recover from that. You can, similar to windows, create a new workspace and import the projects. But then you have lost a lot of settings and you "start from scratch". My backups saved me several times here.

Conclusions
  • Backup the corrupted system before you do anything.
  • Make bakups. Regularly!


Michael

6 comments:

  1. Hi Michael,
    It is an interesting read. However I would disagree with your final conclusion about taking regular backups and backing up the corrupt system as well. I hear so many times so many people and even organizations insisting on making regular backups. In most of the companies like when I used work in the bank there were whole lot of backup policies etc.etc.
    So does backup helps everytime you need it? In many cases answer is NO. I went through the same ordeal with a real enterprise system when I lost the whole Oracle database and found that the last backup was corrupt. And good backups were not available. Only to find out later what I should have backed up and how should I restore. You went through taking so many backups , trying to restor so many of them and in the end finding no clue why your backups are not properly restored.
    So am I saying that taking backup is unnecessary? NO backup is a good thing in any case. But the most important thing is what backup one should take. In my opinion of all those backup utilities or whatever provided by big companies and operating systems, Only good backup is the one that you understand what is being backed up and how it will be restored. After struggling whole day you found that the missing file is ntuser.dat and the relevant registries etc. etc. same with eclipse. That is where the point lies. I usually prefer only taking backup of my data (only data). And for any environment restore I usually prefer to find a way how to recreate my whole environment in case it is lost. On Mac OS it is pretty easy to have a script to restore your whole profile if needed.
    So my conclusion is take a backup only if you know what you are backing up.
    Thanks
    Ali

    ReplyDelete
  2. Thank you Ali for the long reply.

    Interestingly I bought the backup program myself (the "institution" is not insisting on the backup).

    I work from my home office, and I started doing backups after one disk of one of my computer crashed. It crashed just after I finished my tax declaration. I lost the data :-(. I try to imagine if my crashed disk would have been my main disk without backup...

    I know exactly what I backup, why I backup weekly the entire system and daily the interesting data. It saved me several times...

    Even in this case, after playing back different versions of backup, I finally restored the corrupt system and the ntuser.dat from a previous backup.

    Without my backup strategy I would have been lost...

    Michael

    ReplyDelete
  3. Hi Michael,
    Ah.. I realized after posting the comment that it somehow sounds as if I am saying you didn't know what you were doing. I apologize for that. As a matter of fact my argument was that the out-of-the-box backup utilities are not as reliable as one would like to.
    And there is no question about taking regular backup of the data. It is only the OS backup or environment backup which I was talking about.

    thanks
    Ali

    ReplyDelete
  4. Ali,

    I totally agree that the you have to customize your backup!

    Michael

    ReplyDelete
  5. Robert currently is vacationing throughout Southeast Parts of asia inside Laos, Thailand, Myanmar, as well as Cambodia. It had been on the new kayak adventure inside Laos in which the mobile computer had been dunked to the Backup for Michael, once Mekong Pond by mistake. With no back up, all of Mike's records might have already been shed. Because of on the net back up, nonetheless, all of the records have been simply retrieved [read more]

    ReplyDelete