LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help recovering lost files[SOLVED] (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-recovering-lost-files%5Bsolved%5D-4175463362/)

jozmak 05-24-2013 05:05 PM

Need help recovering lost files[SOLVED]
 
Hello,

I need help desperately to recover lost files. This is what happened in a nutshell. I have an external hard drive that I used solely as a storage hard drive. The other day I tested a Linux a live distro by using USB creation program. I put a USB stick in the machine but due to my carelessness I didn't check everything and the program written the live CD on my external hard drive rather than on my USB stick. Now, I lost hundreds of my photographs some of which are irreplaceable. I'm experimenting with some program for days trying to recover the lost files without success.

I tried “testdisk” following several step by step tutorials but my output doesn't match to what the tutorial says.

I tried using “debugfs” program without success. I get messages like: “/dev/sdc: Bad magic number in super-block while opening file system”

I've tried ext4magic, but I get messages like:

[root@myhost mak]# ext4magic /dev/sdc -M -d /home/recover
/dev/sdc Error 2133571347 while opening filesystem
"/home/recover" accept for recoverdir
ext4magic : EXIT_SUCCESS
[root@myhost mak]#

The file system on the hard drive was not formatted before the live cd was written on it. I don't know this makes any difference. Before the disaster the harddrive had ext3 filesystem.

I have absolutely no experience with recovering files. Could anyone who understands about recovering files help me lead through the process or suggest some other programs to use to recover them. I lost about 100-150 gig saved files mostly photographs. I don't mind if I can't recover the other files but I desperately need to recover my pictures because I cannot replace them.

Thanks a lot everyone for the help.

jmak

unSpawn 05-24-2013 05:40 PM

Quote:

Originally Posted by jozmak (Post 4958406)
(..) due to my carelessness I didn't check everything and the program written the live CD on my external hard drive rather than on my USB stick.

If such an USB creation application overwrites the file system in a dd-like fashion (copying CD contents bit by bit) then you've not only lost the file system structure (allowing recovery with file names intact) but also anything the size of that CD (usually written from the start of the disk). Photorec, testdisk's companion app, may be able to retrieve files but there's no guarantee recovered files will be complete or usable.

PTrenholme 05-24-2013 05:50 PM

Try photorec. It might find some files for you.

jozmak 05-24-2013 06:30 PM

Quote:

Originally Posted by PTrenholme (Post 4958426)
Try photorec. It might find some files for you.

Thanks a lot for suggesting photorec

It already started recovering files. Over one thousand jpeg and several hundred raw image files have already recovered. It takes 10 hours to finish scanning the 500 gig harddrive. I report back when it will be done.

Thanks a lot.

TobiSGD 05-24-2013 06:52 PM

While the recovery takes place you should take the time and think about implementing at least a basic backup strategy to prevent data-loss in the future. Imagine the drive just died instead of the accident that happened, all your photos would either be unrecoverable or you would have to spend a large amount of money to let a professional data recovery institute do the work.
The amount of money spend on a second drive for backup purposes is at least a magnitude smaller than hiring a professional for recovering your valuable photos.

jozmak 05-24-2013 10:43 PM

Hello,

I ran into a major problem. The files that I'm attempting to recover are approximately 100 gig in size. However, my distro is installed on a 27 gig partition. I overlooked this problem and now, my entire partition is full and the program stopped recovering the files giving me the message to free up more room for the files.

Photorec saves files in the home directory by default. I'm searching all afternoon how to direct the program to save files on a different partition with plenty of room. I was not able to figure it out, I looked at the program's home page, but found no indication how to do it.

I already posted a message on photorec forum but the post first has to be approved by a moderator. I posted a it 6 hours ago and it still hasn't appeared.

So I am posting it here too maybe someone knows how to direct photorec to save files on a different partition.

TobiSGD,
I'm already thinking about a new strategy of backing up files on several devices. The problem is that the new external hard drives don't have turn off button like before. They run all the time. This slows down reboot, the installation of new distros and the risk to mix it up with something else especially when you have several partitions like in my case with 13 partitions on two internal hard drives.


Thanks a lot,
jmak

TobiSGD 05-25-2013 04:54 AM

Quote:

Originally Posted by jozmak (Post 4958496)
Photorec saves files in the home directory by default. I'm searching all afternoon how to direct the program to save files on a different partition with plenty of room. I was not able to figure it out, I looked at the program's home page, but found no indication how to do it.

You change the directory where the files are saved directly after you have specified the filesystem that Photorec should suspect on the partition/disk you want to recover.

Quote:

The problem is that the new external hard drives don't have turn off button like before. They run all the time. This slows down reboot, the installation of new distros and the risk to mix it up with something else especially when you have several partitions like in my case with 13 partitions on two internal hard drives.

If you have your backup devices always attached and running you are doing it wrong. Just attach the device once a day (or whichever timeframe is appropriate for you), make the backup, detach it again and put it away. Alternatively, since you seem to have large amounts of data think about solutions like a NAS.

jozmak 05-25-2013 07:32 AM

Quote:

Originally Posted by TobiSGD (Post 4958614)
You change the directory where the files are saved directly after you have specified the filesystem that Photorec should suspect on the partition/disk you want to recover.

If you have your backup devices always attached and running you are doing it wrong. Just attach the device once a day (or whichever timeframe is appropriate for you), make the backup, detach it again and put it away. Alternatively, since you seem to have large amounts of data think about solutions like a NAS.

Thanks TobiSGD,

It was a bit tricky to find the other harddrive but it is done. Now it is recovering the files.

jozmak 05-25-2013 09:06 PM

Thanks everyone for all the suggestions and help.
I succesfully recovered all of my lost files.
Now, I have to sort them.
13 thousand jpegs and about 4 thousand raw files, it will take some time.
Photorec is a truly outstanding recovery program.


All times are GMT -5. The time now is 06:15 PM.