LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 02-13-2016, 02:29 PM   #1
justin-goldberg
LQ Newbie
 
Registered: Jan 2008
Posts: 20

Rep: Reputation: 0
Does ddrescue Retry For Data Verification?


I am using GNU ddrescue to recover data from a hard drive with bad sectors to a good drive. It is the same sized drive. I pointlessly used badblocks at first, but it did tell me that I have 204 MB in bad sectors. I should have told it to stop at first error.

The source drive that I am cloning/recovering has windows 10 on it. Some of the bad sectors are in the 2 gigabyte "system reserved" partition. I started the recovery on the whole device (/dev/sda) but I want to skip copying the first system reserved partition (sda1) since I expect to be able to copy this partition from another system with the same build and cpu type. I've done this before on a Server 2008 system.

Question 1: can I clone only sda2 (the "real" 465GB windows OS and data partition) and restart the recovery using the same logfile? Skipping the "SYSTEM RESERVED" partition? Eg ddrescue /dev/sda2 /dev/sdb2 /mnt/windows/ddrescue-log.log

Question 2: How do I know the data is good from sectors that have had read errors on the first pass? If the drive gives ddrescue data, how does it know the data is correct without reading the data more than once and comparing it? Or have I been fooled by Spinrite's documentation (it says it rereads sectors 20 times, but that program hasn't been useful for 20 years, since the days of MFM/RLL drives).

Question 3: Can I run ddrescue again to verify the data is good? Does the log show which blocks are good?

Ultimately, I want to know at which point is my data good?


My recovery is currently on the second pass. My parameters are ddrescue -d -f -r3 /dev/sda /dev/sdb /mnt/windows/ddrescue-log.log and I am using ddrescue version 1.18.1, which is not the latest version 1.20, but is the only version that I can use via the SystemRescueCD live-cd.
 
Old 02-13-2016, 05:31 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
I strongly suggest that you study 'info ddrescue'.
Q1. Yes and yes.
Quote:
5 Invoking ddrescue
*******************

The format for running ddrescue is:

ddrescue [OPTIONS] INFILE OUTFILE [MAPFILE]

INFILE and OUTFILE may be files, devices or partitions. MAPFILE is
a regular file and must be placed in an existing directory. If MAPFILE
does not exist, ddrescue will create it.

Always use a mapfile unless you know you won't need it. Without a
mapfile, ddrescue can't resume a rescue, only reinitiate it.
Q2.
Quote:
4 Algorithm
...
The algorithm of ddrescue is as follows (the user may interrupt the
process at any point, but be aware that a bad drive can block ddrescue
for a long time until the kernel gives up):

1) Optionally read a mapfile describing the status of a multi-part or
previously interrupted rescue. If no mapfile is specified or is empty or
does not exist, mark all the rescue domain as non-tried.

2) (First phase; Copying) Read the non-tried parts of the input file,
marking the failed blocks as non-trimmed and skipping beyond them. Skip
also beyond slow areas. The skipped areas are tried later in two
additional passes (before trimming), reversing the direction after each
pass until all the rescue domain is tried. The third pass is a sweeping
pass, with skipping disabled. (The purpose is to delimit large errors
fast, keep the mapfile small, and produce good starting points for
trimming). Only non-tried areas are read in large blocks. Trimming,
scraping and retrying are done sector by sector. Each sector is tried at
most two times; the first in this step as part of a large block read,
the second in one of the steps below as a single sector read.

3) (Second phase; Trimming) Trimming is done in one pass. For each
non-trimmed block, read forwards one sector at a time from the leading
edge of the block until a bad sector is found. Then read backwards one
sector at a time from the trailing edge of the block until a bad sector
is found. Then mark the bad sectors found (if any) as bad-sector, and
mark the rest of the block as non-scraped without trying to read it.

4) (Third phase; Scraping) Scrape together the data not recovered by
the copying or trimming phases. Scraping is done in one pass. Each
non-scraped block is read forwards, one sector at a time. Any bad
sectors found are marked as bad-sector.

5) (Fourth phase; Retrying) Optionally try to read again the bad
sectors until the specified number of retry passes is reached. The
direction is reversed after each pass. Every bad sector is tried only
once in each pass. Ddrescue can't know if a bad sector is unrecoverable
or if it will be eventually read after some retries.

6) Optionally write a mapfile for later use.
Q3. Yes and yes.
Quote:
4 Algorithm
...
The mapfile is periodically saved to disc, as well as when ddrescue
finishes or is interrupted. So in case of a crash you can resume the
rescue with little recopying. The interval between saves varies from 30
seconds to 5 minutes depending on mapfile size (larger mapfiles are
saved at longer intervals).

Also, the same mapfile can be used for multiple commands that copy
different areas of the input file, and for multiple recovery attempts
over different subsets.
 
  


Reply

Tags
data recovery, ddrescue, systemrescuecd, windows 10



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
extracting data from a ddrescue image ARC-FOX Ubuntu 2 07-26-2013 05:46 AM
extracting data from a ddrescue image ARC-FOX Ubuntu 2 07-26-2013 05:43 AM
How to recover data from a broken hard drive (ddrescue)? lshantz Linux - Newbie 15 02-11-2013 08:59 PM
Data recovery - photorec vs. testdisk vs. ddrescue? JStevenson Linux - Newbie 7 09-01-2009 03:27 PM
Data recovery with ddrescue Matistimo Linux - Newbie 7 11-30-2007 07:15 AM

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

All times are GMT -5. The time now is 05:38 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