We are continuing to create contents that help to explain the new features of Windows 7 to the developers' community. This time we record set of short screen casts that include a presentation and one or two demos. To create those screen casts we have distributed the work between different people at Sela. Each person creates the presentation and the demos. This goes to Redmond for feedbacks. When they approve the content Sasha does the actual recording. So, last Wednesday I had to build the material for the Federated-Search screen cast. I wanted to have a new demo, not to have the same SharePoint demo that we always use when talking about this subject (The SharePoint demo is cool and great, but I wanted to have something cool and new), so I have decided to have a Federated Search sample or the IMDB. Searching for a web-service interface for IMDB, I have found that they don’t expose one; however there are some good wrappers in the web. I spent few hours implementing a movie federated search that gives the titles, cast, directors, writers, etc. with the pictures and links. A good one!
During the day my Home Server started to complain about file-conflicts. File conflict in Windows Home Server is something that might be nothing, or might be everything. One reason to have a file conflict is the case that one or more of the computers at home has an open handle to a file for long time. Having this handle prevents some of the home server house-keeping capabilities. This is the good case. The worst case is that you have a hard-disk failure. And of course this was my case. I have found out that one of the new hard disks that I added to the server a week before is starting to fail. Since all my files are duplicated, I wasn’t afraid. To find the failed disk I had to look for those files that are in conflict. Remember that they are duplicated, which means that they exist on two different hard disks. Having more than one file in conflict makes it easy to find the specific disk (There is also this add-in that can help). To be sure I triggered Check Disk on that disk (You can assign drive letter and use the regular system tools or command line with that disk). Check Disk has found some errors that cannot be fixed! When you can’t fix a drive, removing it became a tedious task. You ask WHS to remove the drive, it calculates the free space that you have on your other drives and if it is enough it starts to move files. The problem is that the disk that you want to remove has some bad-blocks that cause the process to be very long and to fail in the middle. So you try it again and again.
I continue to work on the Federated Search screen cast while trying to remove a 1TB disk from my home server. The time was around 02:00 am when my computer, the one that I was developing the screen cast, got hang. I didn’t know what has happened, but I have told to myself that the since I have compiled the demo, Visual Studio has saved the last version and also the slides were saved (An old habit of pressing Ctrl-S from time to time, and of course PowerPoint auto save…). What I haven't taken into account was that the last backup of my computer was from the day before, and that since the WHS was busy trying to remove a hard disk it had not done any backup this night. I tried to bring my home computer back to life and what I see is that my raid controller tells me that it cannot build the raid array since it finds only one hard-disk. On my home computer I had a raid 0 configuration of two 512GB hard drives. I did it from performance reason. Having raid-0 means that the MTBF is half, but I didn’t care since my computer has a backup every night.
Now I started to sweat, I tried to bring the dead disk to live, using some magic words, cooling it with condense air spray, reconnecting the power and SATA cables, talked with the disk, talked to god, nothing… no disk.
I went back to my home server and looked at the files that were corrupted. One of them was a .dat file. This was bad. .dat file is a data file that belongs to the computer backup database. If this one belongs to the backup information of my home computer… It was around 3 am, I decided to run ChkDsk again to see if I can fix the .dat corruption since there is no duplication for the computer backup database. (There is an undocumented registry entry that enables duplication of computer backups and I have knew about this flag, but I have decided that this will make a third backup and that it will also consume another TB of disk and make the home server very slow). ChkDsk for a 1TB disk takes hours. I knew that event if I could restore my home computer, the Federated Search screen cast materials have gone. So I took my laptop and started to develop the Demo and slides again, as long as my memory is fresh…
Since the IMDB service that I was used were a RESTful service, I had to deal with XML extracting. I could use XSLT, but I went with LINQ to XML and heavy work with XPath. The problem with XML is that it takes time to figure the right pattern and location. This is usually a trial and error task, and I knew that even that this is the second time that I am going to implement it, it will take a long time. So I tried to connect to the IMDB service that I’ve used before, but the service was not there. Instead I have found a blog post telling that the service is down due to too many requests. (Might be my fault). I have decided to develop a different demo. This time I searched for a weather information. Luckily I have found the WeatherBug has a great service interface, both RESTFul and Soap. I have registered to the service and started to read about the API. When you register to WeatherBug, you have to wait about half an hour before you get the access to use the API. I have used this time to check my ChkDsk status. I have found that ChkDsk has found a problem with the .dat file and recovered some bad clusters in it, this gave me some hope, but ChkDsk still had a long time to go, so I’ve got back to my laptop. I have found out that you can search in the WeatherBug database using a city name for any city in the world and using US zip code for any city in the US. So I decided that this will be the search criteria in my Federated Search provider. I have also decided that the result will be all the cities that their name is sound like the search criteria with their current weather condition. If the user will pick one result entry, I will present the forecast of that location. Building this solution was much easier than my lost IMDB Federated Search provider. I have used the SOAP API.
Source code will be given when the screen cats will be published!
Back to my Home Server. The time was 05:00 AM, ChkDsk had not finished yet, I decided to have some sleep.
Thursday, 09:00 am, I woke up, logged into the Home Server console and ask it to remove the disk again. Than I went to the computer store and bought three new 640GB hard disks, this time I will have Raid-5, I have learned my lesson. I came home to find out that the WHS console failed again to remove the disk, but this time the console itself had an unhandled System.IO exception. I had to restart the server to be able to run the WHS console again. Looking at the files that were left in the failing drive, I have discovered that there were no .dat files there! I connected the three new disks to my home computer and configure them to be part of a raid-5 array. Now I had to wait for the home server to complete its disk removal, so I will be able to restore my home computer. But the WHS console has an unhandled exception again and again. I decided to first recover my home computer and later to continue and remove the hard disk from the server. I have started the WHS recovery disk; I have used the advance file management tool to create the needed partitions (I had three) and started the recovery process. WHS has told me that it is going to take 4 hours; thank god I have a Gigabit Ethernet. Instead of waiting in front of the restore wizard, I took my wife and kids to eat lunch and see a movie. After all it was a vacation day.
When we were back at home, the wizard told me that the restore was done. I reboot my machine, and I’ve got it back! yes, one day is missing and I had to re-built outlook pst file from Sela exchange server (about 5 GB pst file) since Outlook can not use an old pst file for some reason. Maybe the WHS team and Office team need to think about a solution for this problem.
The performance of the new Raid-5 is not bad at all:
After I had my computer back, I connected to the WHS using its WHS console. This time the console had not got the annoying unhandled exception, but it refuses to remove the disk since it had files that cannot be removed, because of the corruption. I have decided to physically remove the disk from the WHS. But how do I find the specific disk. I had three disks from the same model. What I did is started a new boot-time check disk, and while check disk was working I pooled out the SATA cables one by one of each disk until ChkDsk started to show thousands of errors.
I took the disk and connected it to my home computer using an External SATA. HD Tune Error Scan has found many damaged blocks! This is a new Disk! Only a week in use!
One thing nice about Windows 7 is that when HD Tune found the first damaged block, Windows 7 showed this message:
I have replaced the disk with a new 1TB disk, and now my WHS is happy again:
So, who says that life is easy, but I won the war. Of course I have lost one IMDB Federate Search provider in the battle.