Sunday, May 24, 2009

Practical Matters - Recovering Data from a Failing Hard Drive

I tend to leave my Linux workstation running constantly at home. Tuesday morning after returning from work, I found it locked up. Hard reboot and oops, it didn't complete the boot up. Grabbed a live CD, ran fsck /dev/sda2. The program found numerous errors and I spent a few minutes hitting the "Y" key numerous times approving the program's repair queries. After the repair, the system could boot. I then went to bed after shutting the system down. Later that evening before going to work, I booted the system and left it running. I returned the next morning to a failing system again. So I shut it down and used my Windows system to surf the web. I didn't touch the box until Friday. Friday, I found the PowerMax diagnostic executable on my Windows system. Installed it to a floppy and tested the bad drive in the Linux box. Bad news, the diagnostic gave an R03 error code whatever that means. Reset the machine's BIOS, then reran the PowerMax software - same error. Nothing was going to bring this drive back from the brink. The PowerMax software urged me to backup the drive before it failed. DUH!

So off I go to Best Buy. Grab a 500 GB Western Digital hard drive for $89.00, at least half of what the Maxtor likely cost when I bought it two years(?) ago. No wonder these things don't last any more. Set the new drive to slave with the jumper, plug it into the EIDE cable (yes, I'm using PATA), reseat the cable in the primary drive after a bad BIOS check. I decided to try a Bart PE live CD. Both Norton Ghost 8.3 and 11.0 failed. Version 11 at least failed immediately. Version 8.3 attempted to build the partitions on the new drive and then failed late into the second one. Norton always did disappoint when it came to drive recovery. Next, I tried a Linux live CD. I used the old workhorse dd.

dd if=/dev/sda of=/dev/sdb bs=4096k conv=notrunc,noerror,sync.
old drive new drive 4MB chunks don't truncate or stop for errors

I told dd to copy the data from the old drive to the new drive in 4MB chunks without stopping for errors, etc.. It failed after copying 81GB of data. That was new. Usually dd doesn't stop for anything unless the drive is already dead. Time to use ddrescue. I'd known about ddrescue for about 4-5 years, but had never needed to use it. It turned out that there is an improved version, GNU ddrescue, or gddrescue. There's even a version for Macs now.

First, I have to install the program on the live CD:

apt-get install ddrescue gddrescue

then

ddrescue /dev/sda /dev/sdb

and the recovery was done in about 30 minutes. Normally, one writes ddrescue infile outfile logfile (everything in UNIX/Linux is a file, even devices), but I decided I didn't want to fill up the ramdisk of the live CD in case ddrescue found a lot of errors. It turned out it didn't find any errors.

Last, but not least, set the new drive to master (remove the jumper basically for WD). Take the old drive out and replace it with the new drive, and I have my old system back. I had updated the kernel to 2.6.29 earlier in the morning and VMware Workstation fails to compile new modules, but that's another story. I hope this helps anyone trying to recover a failing hard drive from any system. If you are using an Ubuntu live CD, remember to put sudo in front of your apt-get install command. You may have to run sudo apt-get update prior to the sudo apt-get install. Supposedly, ddrescue will recover data from CDs, but since many audio CDs are copy-protected, a bit-by-bit recovery tool will tend to fail. This is unfair, but what can one do when copyright fair use has been crippled by theft by users and greed by producers. If you can send the drive back for a refund if it's under warranty, use GNU shred on it before you do.

Labels:


Sunday, May 17, 2009

Fauna Watch

Blogger is slow today for some reason. Just some news and observations. My friend left the hospital after 3.5 months this past Thursday.I suspect that he'll catch up on his sleep once he's home. Hospital rest is an oxymoron. His sleep was always interrupted mostly by techs taking vital signs or the intercom going off. While running this morning, I saw a breeding pair Scissor-tailed flycatchers perched on a utility line at an intersection. When I came home Thursday morning, I found a large marsupial on my stair landing making the rounds. It was a 7-8 pound opossum. Sorry that the image is so dark.

Opossum















Next time I'll use a camera with a flash. The Flip had trouble in the bad lighting.

Labels:


Financial Fraud is Commonplace

NakedCapitalism blog has a link to William Black's Icelandic lecture he gave last week. It's about all the ways financial fraud can be perpetrated. There is little persecution, so there's little risk in committing it. The figures are astounding, something like 300,000 cases in 2008 while the best the FBI can do is investigate 600 cases a year.

Labels:


Sunday, May 10, 2009

World Within the Mind

I also finished World Within the Mind by H.P.Shastri. It is a very beautiful spiritual work. Very illuminating.

Labels:


Roman Legions

I have been reading the books detailing the histories of various Roman Legions by Stephen Dando-Collins. The first book is a history of the Legio X, the famous Tenth Legion. I just finished Nero's Killing Machine, which is a history of the 14th Gemina Martia Victrix Legion, Legio XIIII. I am now reading his history of the Third Gallica Legion, Legio III. This is his most political book yet. I did not know that Marcus Antonius (Marc Antony) appointed Herod the Great as ruler of Judea, or that the Romans also appointed the Jewish High Priest to his position. This explains why Jesus Christ was turned over to the Romans since they were the true civil authorities of Judea. His books are lively reading and include a cast of very real and interesting people. They also illustrate why military forces should be apolitical. Some of those Legions survived 500-600 years, but they fought against one another more than once in Roman Civil Wars. Indeed, before Gaius Julius Caesar came to power, Quintus Sertorius nearly succeeded in creating an independent Roman state in Spain. He was undefeated in battle against even Roman armies, but treachery at a banquet ended his life and success.

Labels:


This page is powered by Blogger. Isn't yours?