%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/309157/task/309157/root/usr/share/doc/gddrescue/html/
Upload File :
Create Path :
Current File : //proc/309157/task/309157/root/usr/share/doc/gddrescue/html/Examples.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<title>Examples (GNU ddrescue Manual)</title>

<meta name="description" content="Examples (GNU ddrescue Manual)">
<meta name="keywords" content="Examples (GNU ddrescue Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-index.html" rel="index" title="Concept index">
<link href="index.html" rel="up" title="Top">
<link href="Direct-disc-access.html" rel="next" title="Direct disc access">
<link href="Optical-media.html" rel="prev" title="Optical media">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Examples"></span><div class="header">
<p>
Next: <a href="Direct-disc-access.html" accesskey="n" rel="next">Direct disc access</a>, Previous: <a href="Optical-media.html" accesskey="p" rel="prev">Optical media</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Concept-index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="A-small-tutorial-with-examples"></span><h2 class="chapter">10 A small tutorial with examples</h2>
<span id="index-examples"></span>

<p>This tutorial is for those already able to use the dd command. If you
don&rsquo;t know what dd is, better search the net for some introductory
material about dd and GNU ddrescue first.
</p>
<p>A failing drive tends to develop more and more errors as time passes.
Because of this, you should rescue the data from a drive as soon as you
notice the first error. Be diligent because every time a physically
damaged drive powers up and is able to output some data, it may be the
very last time that it ever will.
</p>
<p>You should make a copy of the failing drive with ddrescue, and then try
to repair the copy. If your data is really important, use the first copy
as a master for a second copy, and try to repair the second copy. If
something goes wrong, you have the master intact to try again.
</p>
<p>If you are trying to rescue a whole partition, first repair the copy
with e2fsck or some other tool appropriate for the type of partition you
are trying to rescue, then mount the repaired copy somewhere and try to
recover the files in it.
</p>
<p>If the drive is so damaged that the file system in the rescued partition
can&rsquo;t be repaired or mounted, you will have to browse the rescued data
with an hex editor and extract the desired parts by hand or use a file
recovery tool like photorec.
</p>
<p>If the partition table is damaged, you may try to rescue the whole disc,
then try to repair the partition table and the partitions on the copy.
</p>
<p>If the damaged drive is not listed in /dev, then you cannot rescue it.
At least not with ddrescue.
</p>
<p>See <a href="Optical-media.html">Optical media</a>, for rescue examples of CD-ROMs and DVDs.
</p>
<br>
<p>Example 1: Fully automatic rescue of a whole disc with two ext2
partitions in /dev/sda to /dev/sdb.<br>
Note: you don&rsquo;t need to partition /dev/sdb beforehand, but if the
partition table on /dev/sda is damaged, you&rsquo;ll need to recreate it
somehow on /dev/sdb.
</p>
<div class="example">
<pre class="example">ddrescue -f -r3 /dev/sda /dev/sdb mapfile
fdisk /dev/sdb
e2fsck -v -f /dev/sdb1
e2fsck -v -f /dev/sdb2
</pre></div>

<br>
<p>Example 2: Rescue an ext2 partition in /dev/sda2 to /dev/sdb2.<br>
Note: you need to create the sdb2 partition with fdisk first. sdb2
should be of appropriate type and size.
</p>
<div class="example">
<pre class="example">ddrescue -f -n /dev/sda2 /dev/sdb2 mapfile
ddrescue -d -f -r3 /dev/sda2 /dev/sdb2 mapfile
e2fsck -v -f /dev/sdb2
mount -t ext2 -o ro /dev/sdb2 /mnt
  (read rescued files from /mnt)
</pre></div>

<br>
<p>Example 3: While rescuing the whole drive /dev/sda to /dev/sdb, /dev/sda
freezes up at position 12345678.
</p>
<div class="example">
<pre class="example">ddrescue -f /dev/sda /dev/sdb mapfile       &lt;-- /dev/sda freezes here
  (restart /dev/sda or reboot computer)
  (restart copy at a safe distance from the troubled sector)
ddrescue -f -i 12350000 /dev/sda /dev/sdb mapfile
  (then copy backwards down to the troubled sector)
ddrescue -f -R /dev/sda /dev/sdb mapfile
</pre></div>

<br>
<p>Example 4: While rescuing the whole drive /dev/sda to /dev/sdb, /dev/sdb
fails and you have to rescue data to a third drive, /dev/sdc.
</p>
<div class="example">
<pre class="example">ddrescue -f -n /dev/sda /dev/sdb mapfile1     &lt;-- /dev/sdb fails here
ddrescue -f -m mapfile1 /dev/sdb /dev/sdc mapfile2
ddrescue -f -n /dev/sda /dev/sdc mapfile2
ddrescue -d -f -r3 /dev/sda /dev/sdc mapfile2
</pre></div>

<br>
<p>Example 5: While rescuing a partition in /dev/sda1 to the file hdimage,
/dev/sda1 stops responding and begins returning read errors, causing
ddrescue to mark the rest of the partition as non-scraped.
</p>
<div class="example">
<pre class="example">ddrescue -n /dev/sda1 hdimage mapfile        &lt;-- /dev/sda1 fails here
  (restart /dev/sda or reboot computer)
ddrescue -n -A -i&lt;pos&gt; -O /dev/sda1 hdimage mapfile
  (if /dev/sda1 fails again, restart /dev/sda or reboot computer and
   then repeat the above command as many times as needed until it
   succeeds. &lt;pos&gt; is the position where the drive stopped responding)
ddrescue -d -r3 /dev/sda1 hdimage mapfile
</pre></div>

<br>
<p>Example 6: While rescuing a partition in /dev/sda1 to the file hdimage,
sda1 disappears from /dev.
</p>
<div class="example">
<pre class="example">ddrescue -n /dev/sda1 hdimage mapfile        &lt;-- /dev/sda1 fails here
  (restart /dev/sda or reboot computer and then repeat the above
   command as many times as needed until it succeeds)
ddrescue -d -r3 /dev/sda1 hdimage mapfile
</pre></div>

<br>
<p>Example 7: While rescuing a partition in /dev/sda1 to the file hdimage,
the partition table of /dev/sda becomes unreadable and the OS no longer
shows sda1 in /dev. The solution is to shift the mapfile and read the
rest of the partition sda1 from /dev/sda.
Note: you need to know the offset of the partition sda1 in the drive sda
and the size of sda1.
</p>
<div class="example">
<pre class="example">ddrescue /dev/sda1 hdimage mapfile     &lt;-- partition table fails here
ddrescuelog --shift -o&lt;offset&gt; mapfile &gt; shifted_mapfile
ddrescue -i&lt;offset&gt; -o0 -s&lt;size&gt; /dev/sda hdimage shifted_mapfile
</pre></div>

<br>
<p>Example 8: After rescuing a partition in /dev/sda1 to the file hdimage,
expand hdimage to copy the whole drive in /dev/sda without recopying the
already copied partition /dev/sda1. The solution is to shift the
mapfile, move the data of sda1 to its final position in hdimage, and
then read the rest of the data from /dev/sda.
Note: you need to know the offset of the partition sda1 in the drive sda
and the size of sda1.
</p>
<div class="example">
<pre class="example">ddrescue /dev/sda1 hdimage mapfile           &lt;-- rescue partition
ddrescuelog --shift -o&lt;offset&gt; mapfile &gt; shifted_mapfile
ddrescue --same-file -o&lt;offset&gt; -s&lt;size&gt; --reverse hdimage hdimage
ddrescue /dev/sda hdimage shifted_mapfile    &lt;-- rescue rest of drive
</pre></div>


<hr>
<div class="header">
<p>
Next: <a href="Direct-disc-access.html" accesskey="n" rel="next">Direct disc access</a>, Previous: <a href="Optical-media.html" accesskey="p" rel="prev">Optical media</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Concept-index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>

Zerion Mini Shell 1.0