Background Story.

Dealing with networks, computers and datacenters, no matter what, the "inevitable" happens.
Even if mini-pcs weren't originally designed for takeoff, someday one of them popped dangerously from the shelves and finally hopped down for 2+ meters (not my fault BTW).

The unattended launch and consequent hard landing brought its (un)expected inconveniences, like a crackling hard disk drive and an unbootable machine (well, this is bad: unbootable even without hdd!).

Who knows if a carpet on the datacenter could've helped lessen the situation? Food for thought!

The flying mini-pc was linux-based, so the recovery process simply implied the "successful" cloning of the data into another hdd AND a brand new mini-pc (fortunately I had a spare one).

Anyway, I was lucky to end up with a semi working hdd; if yours is not recognized by the BIOS, then use the backups and rebuild the hard way (sorry!), or, if you don't have any backups, you are screwed! you have to decide, based on the information value contained on the hdd, if it is worth to perform a professional data recovery from a service firm like ontrack.

I extracted the broken disk from the broken mini pc and inserted it into an usb carry case, I then took another usb box and filled it with a brand-new hdd, both connected to a working, LVM-enabled, linux box.

The FIX Process.

After recognizing the LVM VG ("vgscan | vgchange -a y") and fsck-ing the broken partitions (you know how to fsck, don't you?), I tried to dd data from one disk to the other:

dd if=/dev/sd-broken of=/dev/sd-new

Unfortunately dd stopped working at first error sight, spitting I/O errors and quitting its job immediately.

I discovered that adding the "conv=noerror,sync" options to the previous command allowed dd to override disk errors and put zeros on their place.

If you desire additional automation (and less details), Mr. Antonio Diaz coded an automated tool capable of restoring what's restorable.

This tool is called ddrescue and will, essentially, perform what the previous dd command would, with the additional benefits of a more verbose screen output, a browseable log file and some powerful internal defaults that needn't be tuned.




The only inconvenience to this is that you should be prepared for the extra time (in fact, plenty of extra time, depending from your hard disk drive size and/or the number of bad blocks/broken sectors encountered).

Sources and bibliography:

How to perform a data restore from a broken hdd with linux.
Rate this post
Senior Professional Network and Computer Systems Engineer during work hours and father when home. Andrea strives to deliver outstanding customer service and heaps of love towards his family. In this Ad-sponsored space, Andrea shares his quest for "ultimate" IT knowledge, meticulously brought to you in an easy to read format.