{"id":16,"date":"2011-06-20T10:35:00","date_gmt":"2011-06-20T10:35:00","guid":{"rendered":"http:\/\/cazenave.co.uk\/wp\/?p=16"},"modified":"2014-04-24T22:06:14","modified_gmt":"2014-04-24T22:06:14","slug":"data-recovery","status":"publish","type":"post","link":"https:\/\/cazenave.co.uk\/data-recovery\/","title":{"rendered":"Data recovery"},"content":{"rendered":"
A Windows laptop bluescreen<\/a>ed midway through a transfer of data from the internal disk to a 500GB (Michael Jackson<\/a>) external disk. Windows refused to acknowledge the existence of the FAT32 partition, saying the disk needed to be formatted; my Mac fared no better, claiming I needed to initialise the disk.<\/p>\n This was a backup disk (and in fact, the computer was backing up when it bluescreened), but nothing on there was irreplaceable, so I decided to have a bit of a play with some data recovery tools.<\/p>\n The first thing I needed to go was get a disk image<\/a> so that I could fiddle around to my heart’s content without worrying about damaging the disk. The disk cloning utility dd<\/span><\/span> took care of that for me:<\/p>\n dd if=\/dev\/sdc of=.\/michael.img<\/span> <\/p><\/blockquote>\n I cloned the entire device (\/dev\/sdc<\/span> vs. \/dev\/sdc1<\/span>, for example) since the partition table appeared to be corrupted. I didn’t set any special options and since I was in no particular hurry, I let it do its thing overnight. Once I had a disk image, I tried testdisk<\/a> to see if it could rebuilt the partition table, or at least let me copy the contents of the partition to somewhere else.<\/p>\n testdisk .\/michael.img<\/span><\/p><\/blockquote>\n For a more comprehensive look at testdisk’s functionality, check their wiki<\/a>. In essence, I used the Advanced section (Filesystem Utils) to do a boot sector recovery, from which I could access the filesystem contents and select files I wanted to copy to a directory, ready for copying back over on to the external disk.<\/p>\n