Cloning a damaged SSD Hard-disk to a new HD
We had in a company server an incident with an ssd hd. FSCK did not manage to fix the errors, and from the output we concluded that this disk was indeed damaged.
Our “safe the day” decision was simple: Clone the disk as it is to a new one (afterwords we would have only logical errors to fix and with some luck not much data loss)
We tried clonezilla first, but even with -rescue option ( supposedly to ignore bad blocks ) it did not work. Entered an “endless” loop of ” ignoring” bad data.
So, we started plan B: ddrescue.
To do so, we started a live gparted ( from hirens ) and with gparted it self we wiped out the destination disk ( new one ).
Then we just opened a terminal window and typed:
ddrescue -B -v -n -f /dev/sda /dev/sdb
(please type ddrescue —help to understand our command switch options)
The source SSD HD was a 64GB one, so the copy took only about 2 hours.
After all this, there was no need to install grub at all, everything was (and is ) cloned.
The machine just booted, and of course asked for a fileSystem check on boot, witch it did. Only it left you in single user mode for you to fix the file system. Simple entered root password and typed:
fsck -y
and all our FS problems wen away. Everything is good now
Just for the record, I’m talking about a box with elastix 2 (centos) in witch we installed other things that would be very time-consuming to re-install and reconfigure from regular backups until late January….
