Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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”
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.
(..) 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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.