Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 have an external drive I stored movies on that started to fail and the partition is damaged to the point I can't access it normally. Some of these haven't been backed up yet and are quite important. I was able to restore some using photorec but started getting a lot more errors reading sectors. It starts out at about 3-4/mbps and then ultimately slows to about 141/kbps. I understand that it slows down on worse spots but I've never seen it speed up. If I interupt it though and start it again some times I can get it back to the 3-4mbs.
I'm trying to find the best way to get through most of the information that I can then try to recover the bad block. Right now I'm running it with this command and output
GNU ddrescue 1.16
About to copy 2000 GBytes from /dev/sdc to drive
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 128 sectors Initial skip size: 128 sectors
Sector size: 512 Bytes
Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued: 17575 MB, errsize: 5353 MB, errors: 139
Current status
rescued: 19714 MB, errsize: 5376 MB, current rate: 170 B/s
ipos: 25091 MB, errors: 147, average rate: 2350 kB/s
opos: 25091 MB, time since last successful read: 0 s
Copying non-tried blocks...
This is the first time I've used this tools since I'm usually really good at backing stuff up so I'm trying to not let the learning curve hurt too much. My plan on is to start with this command
Note there's also dd_rescue. The one thing that makes it stand out is its ability to read back to front. Helpful if you encounter a situation in which ddrescue slows down or halts.
Thanks for the reply, I looked at that but ddrescue(the GNU version) seemed to be the better algorithm. From there documentation they grab as much data as possible going in the normal direction skipping slow parts then later go to the slow parts and then read backwards in those areas, at least that's I how I understand it. I found a way to make it a lot faster, at least it spurts, but I'm not sure how much damage this could do with starting and stopping the process so much. I create two scripts that run, since I want to see the output. The first one is a infinite loop which relaunches the ddrescue every time its interrupted
Code:
#!/bin/bash
while :
do
dt=$(date)
echo $dt
ddrescue -n -v -S /dev/sdc drive.img recovery.log
done
the second one sends SIGINT to interupt it, which is the same as pressing ctrl C
Code:
#!/bin/bash
while :
do
kill -SIGINT $(ps aux | grep 'ddrescue' | awk '{print $2}')
sleep 11m
done
I found that about 11 mins seems to get me the best speed, I'm getting an average speed of around 3-11mb vs the sustained 141kb that I got over a comparable time frame. I'm not saying this is the best or even a correct but this turned an estimated time from years to a few days for the first pass.
(..) I'm not sure how much damage this could do with starting and stopping the process so much.
You can use 'md5deep' in piecewise mode to generate a list of hashes from the file and compare that against the disk to see what's missing. If you suspect the state of the disk being subject to deterioration then only do that after you've completed your ddrescue processes.
Remember, you use ddrescue to COPY the failing disk, then you use photorec to retrieve data from the COPY. It sounds like you might have used photorec directly on the bad disk (not sure about that, but it seems like you maybe did that). This may cause the bad disk to fail sooner, so you should really only use photorec on your copy, if at all possible. Make your bad disk last as long as possible by copying it only once, thus minimizing the reads to it, then doing all your recovery work from the copy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.