LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-02-2014, 06:58 PM   #1
zenmatrix83
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Rep: Reputation: Disabled
using ddrescue on failing drive


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

root@ubuntu:/home/stephen/movies# ddrescue -v -n -S /dev/sdc drive recovery.log


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

ddrescue -v -n -S

then go to

ddresucue -v -r3 -S

then finish with

ddrescue -v -R -s

and then accept thats all I'm going to get.

Thanks or any help
 
Old 01-02-2014, 09:31 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Quote:
Originally Posted by zenmatrix83 View Post
and then accept thats all I'm going to get.
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.
 
1 members found this post helpful.
Old 01-03-2014, 03:04 PM   #3
zenmatrix83
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-04-2014, 06:10 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Quote:
Originally Posted by zenmatrix83 View Post
(..) 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.
 
Old 01-04-2014, 05:47 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to recover data from a broken hard drive (ddrescue)? lshantz Linux - Newbie 15 02-11-2013 09:59 PM
Rescuing a failing partition with ddrescue TommyMcCole Linux - General 7 09-30-2011 03:24 PM
Urgent: Failing NTFS HD - Will ddrescue Read & Write To Windows NTFS Drives? zipgunner Linux - Newbie 15 03-08-2011 07:29 AM
Dead hard drive, and failing ddrescue tromboneman Linux - Hardware 2 01-01-2010 08:12 PM
Using ddrescue with Mac OS X and external drive TonyLima Linux - Newbie 2 03-18-2008 07:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration