[CentOS] Need a Centos 6 USB hard drive recovery procedure

Sat May 11 20:28:53 UTC 2013
Louis Lagendijk <louis at fazant.net>

On Sat, 2013-05-11 at 19:18 +0000, Rock wrote:
> On Sat, 11 May 2013 15:35:31 +0000, Rock wrote:
> > Currently I'm at day 3, and almost done recovering the 
> > files; but the results (sadly, due to my error in the 
> > Recuva settings) are flatter than the plains of Kansas!
> Just for the record, Recuva finished at 66 hours:
>  http://www5.picturepush.com/photo/a/12907423/img/12907423.jpeg
> It's odd that I'm having trouble finding a good tutorial
> for Linux recovery of the master table of contents, since 
> it must be happening to others day in and day out.
> Fundamentally, the procedure is to "dd" the disk and then 
> work off the backup but I don't want to make a mistake so 
> that's why an exact procedure is so critical to find.
> It's expensive being a pioneer; yet I shouldn't have to be
> a pioneer for this task, since it happens every day.
> Will read everything written and try to find a tutorial.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

ok, here is a quick list of what to do:

1) connect your spare disk (USB) (not the bad disk!!!!!) and as root
check what device id it got (tail /var/log/messages) look for detected
partitions there or do 
fdisk -l /dev/sdx where the sdx is what you found from /var/log/messages

2) As root Mount the disk:
mount /devsdxy /mnt 
(where y is the partion number you want to mount)
if mounted goto 3
This may fail if it is ntfs

2B) If it fails format the disk as ext4:
mkfs /dev/sdxy
and then mount it as under 2

3) I assume here that your bad disk is already connected (as sdz check
first what the real name is)

dd if=/dev/sdz of=/mnt/image.dd bs=1M

This will copy the contents of your bad disk to image.dd

4) just to be sure, make the image read-only
chmod uog=r /mnt/image.dd

5) install testdisk from the epel repo
yum install testdisk

6) now run photorec from a directory where you have sufficient space,
ifg your usb disk is big enough do it there (hint create a sub-directory
mdkdir /mnt/recover
cd /mnet/recover

but any dorectory would do
photorec /mnt/image.dd

The copy to an image is not really required, but better safe then sorry
I have written this from