%PDF- %PDF-
Direktori : /proc/309157/task/309157/root/usr/share/doc/gddrescue/html/ |
Current File : //proc/309157/task/309157/root/usr/share/doc/gddrescue/html/Invoking-ddrescue.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>Invoking ddrescue (GNU ddrescue Manual)</title> <meta name="description" content="Invoking ddrescue (GNU ddrescue Manual)"> <meta name="keywords" content="Invoking ddrescue (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="Mapfile-structure.html" rel="next" title="Mapfile structure"> <link href="Output.html" rel="prev" title="Output"> <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="Invoking-ddrescue"></span><div class="header"> <p> Next: <a href="Mapfile-structure.html" accesskey="n" rel="next">Mapfile structure</a>, Previous: <a href="Output.html" accesskey="p" rel="prev">Output</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Concept-index.html" title="Index" rel="index">Index</a>]</p> </div> <hr> <span id="Invoking-ddrescue-1"></span><h2 class="chapter">6 Invoking ddrescue</h2> <span id="index-invoking-ddrescue"></span> <span id="index-options"></span> <span id="index-usage"></span> <span id="index-version"></span> <p>The format for running ddrescue is: </p> <div class="example"> <pre class="example">ddrescue [<var>options</var>] <var>infile</var> <var>outfile</var> [<var>mapfile</var>] </pre></div> <p><var>infile</var> and <var>outfile</var> may be files, devices or partitions. <var>mapfile</var> is a regular file and must be placed in an existing directory. If <var>mapfile</var> does not exist, ddrescue will create it. </p> <p>Always use a mapfile unless you know you won’t need it. Without a mapfile, ddrescue can’t resume a rescue, only reinitiate it. </p> <p>ddrescue supports the following options: </p> <dl compact="compact"> <dt><code>-h</code></dt> <dt><code>--help</code></dt> <dd><p>Print an informative help message describing the options and exit. </p> </dd> <dt><code>-V</code></dt> <dt><code>--version</code></dt> <dd><p>Print the version number of ddrescue on the standard output and exit. </p> <span id="g_t_002d_002dmin_002dread_002drate"></span></dd> <dt><code>-a <var>bytes</var></code></dt> <dt><code>--min-read-rate=<var>bytes</var></code></dt> <dd><p>Minimum read rate of good non-tried areas, in bytes per second. If the read rate falls below this value during the first two passes of the copying phase, ddrescue will skip ahead a variable amount depending on rate and error histories. The skipped blocks are tried in additional passes (before trimming). </p> <p>If <var>bytes</var> is 0 (auto), the minimum read rate is recalculated every second as <span class="nolinebreak">(average_rate</span> / 10)<!-- /@w -->. </p> </dd> <dt><code>-A</code></dt> <dt><code>--try-again</code></dt> <dd><p>Mark all non-trimmed and non-scraped blocks inside the rescue domain as non-tried before beginning the rescue. Try this if the drive stops responding and ddrescue immediately starts scraping failed blocks when restarted. If ‘<samp>--retrim</samp>’ is also specified, mark all failed blocks inside the rescue domain as non-tried. </p> </dd> <dt><code>-b <var>bytes</var></code></dt> <dt><code>--sector-size=<var>bytes</var></code></dt> <dd><p>Sector (hardware block) size of input device in bytes (usually 512 for hard discs and 3.5" floppies, 1024 for 5.25" floppies, and 2048 for cdroms). Defaults to 512. </p> </dd> <dt><code>-B</code></dt> <dt><code>--binary-prefixes</code></dt> <dd><p>Show units with binary prefixes (powers of 1024).<br> SI prefixes (powers of 1000) are used by default. (See table below). </p> </dd> <dt><code>-c <var>sectors</var></code></dt> <dt><code>--cluster-size=<var>sectors</var></code></dt> <dd><p>Number of sectors to copy at a time. Defaults to 64 KiB / <span class="nolinebreak">sector_size</span><!-- /@w -->. Try smaller values for slow drives. The number of sectors per track (18 or 9) is a good value for floppies. </p> </dd> <dt><code>-C</code></dt> <dt><code>--complete-only</code></dt> <dd><p>Limit rescue domain to the blocks listed in the <var>mapfile</var>. Don’t read new data beyond <var>mapfile</var> limits. This is useful when reading from devices of undefined size (like raw devices), when the drive returns an incorrect size, or when reading from a partial copy. It can only be used after a first rescue attempt, possibly limited with the ‘<samp>--size</samp>’ option, has produced a complete <var>mapfile</var>. </p> </dd> <dt><code>-d</code></dt> <dt><code>--idirect</code></dt> <dd><p>Use direct disc access (see <a href="Direct-disc-access.html">Direct disc access</a>) to read from <var>infile</var>, bypassing the kernel cache. (Opens the file with the O_DIRECT flag). Sector size must be correctly set for this to work. Not all systems support this. </p> <p>If your system does not support direct disc access, ddrescue will warn you. If the sector size is not correctly set, an unaligned read error will result and ddrescue will exit with status 1. </p> </dd> <dt><code>-D</code></dt> <dt><code>--odirect</code></dt> <dd><p>Use direct disc access to write to <var>outfile</var>, bypassing the kernel cache. (Opens the file with the O_DIRECT flag). Sector size must be correctly set for this to work. Not all systems support this. </p> <p>If your system does not support direct disc access, ddrescue will warn you. If the sector size is not correctly set, a write error will result and no data will be rescued. Some OSs have a bug that prevents them from detecting write errors properly (or at all) on some devices if direct disc access is not used for <var>outfile</var>. </p> <span id="g_t_002d_002dmax_002dbad_002dareas"></span></dd> <dt><code>-e [+]<var>n</var></code></dt> <dt><code>--max-bad-areas=[+]<var>n</var></code></dt> <dd><p>Maximum number of bad areas allowed before giving up. Defaults to infinity. If <var>n</var> is preceded by ‘<samp>+</samp>’ the number refers to new bad areas found in this run, not counting those already present in the <var>mapfile</var>. </p> <span id="g_t_002d_002dmax_002derror_002drate"></span></dd> <dt><code>-E <var>bytes</var></code></dt> <dt><code>--max-error-rate=<var>bytes</var></code></dt> <dd><p>Maximum rate of read errors allowed before giving up, in bytes per second. Defaults to infinity. The rate being measured is that of actually failed reads, so ddrescue may exit because of this rate being exceeded even if the total error size (size of bad-sector areas) does not change because the areas being tried are being marked as non-trimmed or non-scraped, or are already marked as bad-sector. </p> </dd> <dt><code>-f</code></dt> <dt><code>--force</code></dt> <dd><p>Force overwrite of <var>outfile</var>. Needed when <var>outfile</var> is not a regular file, but a device or partition. This option is just a safeguard to prevent the inadvertent destruction of partitions, and is ignored for regular files. </p> </dd> <dt><code>-F <var>types</var></code></dt> <dt><code>--fill-mode=<var>types</var></code></dt> <dd><p>Fill the blocks in <var>outfile</var> specified as any of <var>types</var> in <var>mapfile</var>, with data read from <var>infile</var>. <var>types</var> contains one or more of the status characters defined in the chapter Mapfile structure (see <a href="Mapfile-structure.html">Mapfile structure</a>) and an optional ‘<samp>l</samp>’ for sector location data. See the chapter Fill mode (see <a href="Fill-mode.html">Fill mode</a>) for a complete description of the fill mode. </p> </dd> <dt><code>-G</code></dt> <dt><code>--generate-mode</code></dt> <dd><p>Generate an approximate <var>mapfile</var> from the <var>infile</var> and <var>outfile</var> of the original rescue run. Note that you must keep the original offset between ‘<samp>--input-position</samp>’ and ‘<samp>--output-position</samp>’ of the original rescue run. See the chapter Generate mode (see <a href="Generate-mode.html">Generate mode</a>) for a complete description of the generate mode. </p> </dd> <dt><code>-H <var>file</var></code></dt> <dt><code>--test-mode=<var>file</var></code></dt> <dd><p>Builds a map of good/bad blocks using the mapfile <var>file</var> and uses it to simulate read errors in <var>infile</var>. The blocks marked as finished in <var>file</var> will be read normally. All other block types will be considered read errors without even trying to read them from <var>infile</var>. The apparent size of <var>infile</var> is truncated to the extent of <var>file</var>. This mode is an aid in improving the algorithm of ddrescue and is also useful to verify that ddrescue produces accurate results in presence of read errors. Use ‘<samp>-</samp>’ as <var>file</var> to read from standard input. </p> </dd> <dt><code>-i <var>bytes</var></code></dt> <dt><code>--input-position=<var>bytes</var></code></dt> <dd><p>Starting position of the rescue domain in <var>infile</var>, in bytes. Defaults to 0. This is not the point from which ddrescue starts copying. (For example, if you pass the ‘<samp>--reverse</samp>’ option to ddrescue, it starts copying from the end of the rescue domain). In fill mode it refers to a position in the <var>infile</var> of the original rescue run. See the chapter Fill mode (see <a href="Fill-mode.html">Fill mode</a>) for details. </p> </dd> <dt><code>-I</code></dt> <dt><code>--verify-input-size</code></dt> <dd><p>Compare the size of <var>infile</var> with the size calculated from the list of blocks contained in the <var>mapfile</var>, and exit with status 1 if they differ. This is not enabled by default because the size of some devices can’t be known in advance and because the size derived from the <var>mapfile</var> may be incomplete, for example after doing a partial rescue. </p> </dd> <dt><code>-J</code></dt> <dt><code>--verify-on-error</code></dt> <dd><p>After every read error, read again the last good sector found and verify that it returns the same data. Exit with status 2 if the read fails or returns inconsistent data. Exit with status 1 if a read error happens before a good sector is found. </p> <p>This option performs one extra read after each error, wearing the drive faster. Use it only on drives that stop responding or return garbage data after finding errors. You may need to power cycle the drive before restarting ddrescue. </p> </dd> <dt><code>-K [<var>initial</var>][,<var>max</var>]</code></dt> <dt><code>--skip-size=[<var>initial</var>][,<var>max</var>]</code></dt> <dd><p>Set limits to skip size during the copying phase. At least one of <var>initial</var> or <var>max</var> must be specified. <var>initial</var> is the size to skip on the first read error or slow read, in bytes. <var>max</var> is the maximum size to skip. The values given will be rounded to the next multiple of sector size. The skip size will be doubled for each read error or slow read until it reaches <var>max</var> or, if <var>max</var> is omitted, 1% of the size of <var>infile</var>, and will be reset to <var>initial</var> when good data is found. Valid values range from 64 KiB<!-- /@w --> to 1 EiB<!-- /@w -->. <var>initial</var> defaults to <var><span class="nolinebreak">infile_size</span></var> / <span class="nolinebreak">100_000</span><!-- /@w --> with a minimum value of 64 KiB<!-- /@w -->. An <var>initial</var> value of 0 disables skipping entirely. </p> <p>If ddrescue is having difficulties skipping away from a large area with scattered errors, or if the device has large bad areas at regular intervals, you may increase the initial skip size with this option. Inversely, if ddrescue is skipping too much, leaving large non-tried areas behind each error (which will be read later in the usually slower backwards direction), you may reduce the maximum skip size, or disable skipping. </p> <p>‘<samp>--skip-size</samp>’ is independent from ‘<samp>--cluster-size</samp>’. The size to skip is calculated from the end of the block that just failed. </p> </dd> <dt><code>-L</code></dt> <dt><code>--loose-domain</code></dt> <dd><p>Accept an incomplete synthetic (user fabricated) domain mapfile or test-mode mapfile and fill the gaps in the list of data blocks with non-tried blocks. The blocks in the mapfile must be strictly ascending and non-overlapping, but they don’t need to be contiguous. This option allows making quick edits to a mapfile without all the size calculations involved in making all data blocks contiguous again. </p> <span id="g_t_002d_002ddomain_002dmapfile"></span></dd> <dt><code>-m <var>file</var></code></dt> <dt><code>--domain-mapfile=<var>file</var></code></dt> <dd><p>Restrict the rescue domain to the blocks marked as finished in the mapfile <var>file</var>. This is useful for merging partially recovered images of backups, or if the destination drive fails during the rescue. Use ‘<samp>-</samp>’ as <var>file</var> to read the domain mapfile from standard input. Specialized tools like ddrutility or partclone can produce a domain mapfile listing all the used blocks in a partition, making the rescue more efficient. </p> </dd> <dt><code>-M</code></dt> <dt><code>--retrim</code></dt> <dd><p>Mark all failed blocks inside the rescue domain as non-trimmed before beginning the rescue. The effect is similar to ‘<samp>--retry-passes=1</samp>’, but the bad sectors are tried in a different order, making perhaps possible to rescue some of them. </p> </dd> <dt><code>-n</code></dt> <dt><code>--no-scrape</code></dt> <dd><p>Skip the scraping phase. Avoids spending a lot of time trying to rescue the most difficult parts of the file. </p> </dd> <dt><code>-N</code></dt> <dt><code>--no-trim</code></dt> <dd><p>Skip the trimming phase. Especially useful in the first parts of a multi-part rescue. </p> </dd> <dt><code>-o <var>bytes</var></code></dt> <dt><code>--output-position=<var>bytes</var></code></dt> <dd><p>Starting position of the image of the rescue domain in <var>outfile</var>, in bytes. Defaults to ‘<samp>--input-position</samp>’. The bytes below <var>bytes</var> aren’t touched if they exist and truncation is not requested. Else they are set to 0. </p> </dd> <dt><code>-O</code></dt> <dt><code>--reopen-on-error</code></dt> <dd><p>Close <var>infile</var> and then reopen it after every read error encountered during the copying phase. If ‘<samp>--min-read-rate</samp>’ is set, also close and reopen <var>infile</var> after every slow read encountered during the first two passes of the copying phase. Use this option if you notice a permanent drop in transfer rate after finding read errors or slow areas. But be warned that most probably the slowing-down is intentionally caused by the kernel in an attempt to increase the probability of reading data from the device. </p> </dd> <dt><code>-p</code></dt> <dt><code>--preallocate</code></dt> <dd><p>Preallocate space on disc for <var>outfile</var>. Only space for regular files can be preallocated. If preallocation succeeds, rescue will not fail due to lack of free space on disc. If ddrescue can’t determine the size to preallocate, you may need to specify it with some combination of the ‘<samp>--input-position</samp>’, ‘<samp>--output-position</samp>’, ‘<samp>--size</samp>’, and ‘<samp>--domain-mapfile</samp>’ options. </p> </dd> <dt><code>-P[<var>lines</var>]</code></dt> <dt><code>--data-preview[=<var>lines</var>]</code></dt> <dd><p>Show <var>lines</var> lines of the latest data read in ‘<samp><span class="nolinebreak">16-byte</span> hex + ASCII</samp>’<!-- /@w --> format. Valid values for <var>lines</var> range from 1 to 32. If <var>lines</var> is omitted, a default value of 3 is used. </p> </dd> <dt><code>-q</code></dt> <dt><code>--quiet</code></dt> <dd><p>Quiet operation. Suppress all messages. </p> </dd> <dt><code>-r <var>n</var></code></dt> <dt><code>--retry-passes=<var>n</var></code></dt> <dd><p>Exit after the given number of retry passes. Defaults to 0. -1 means infinity. Every bad sector is tried only once in each pass. To retry bad sectors detected on a previous run, you must specify a non-zero number of retry passes. </p> </dd> <dt><code>-R</code></dt> <dt><code>--reverse</code></dt> <dd><p>Reverse the direction of all passes (copying, trimming, scraping and retrying). Every pass that is normally run forwards will now be run backwards, and vice versa. ‘<samp>--reverse</samp>’ does not modify the size of the blocks copied during each phase, just the order in which they are tried. </p> </dd> <dt><code>-s <var>bytes</var></code></dt> <dt><code>--size=<var>bytes</var></code></dt> <dd><p>Maximum size of the rescue domain in bytes. It limits the amount of input data to be copied. If ddrescue can’t determine the size of the input file, you may need to specify it with this option. Note that this option does not specify the size of the resulting <var>outfile</var>. For example, the following command creates an <var>outfile</var> 300 bytes long, but only writes data on the last 200 bytes: </p> <div class="example"> <pre class="example">ddrescue -i 100 -s 200 infile outfile mapfile </pre></div> </dd> <dt><code>-S</code></dt> <dt><code>--sparse</code></dt> <dd><p>Use sparse writes for <var>outfile</var>. (The blocks of zeros are not actually allocated on disc). May save a lot of disc space in some cases. Not all systems support this. Only regular files can be sparse. </p> </dd> <dt><code>-t</code></dt> <dt><code>--truncate</code></dt> <dd><p>Truncate <var>outfile</var> to zero size before writing to it. Only works for regular files, not for drives or partitions. </p> </dd> <dt><code>-T <var>interval</var></code></dt> <dt><code>--timeout=<var>interval</var></code></dt> <dd><p>Maximum time since last successful read allowed before giving up. Defaults to infinity. <var>interval</var> is an integer or rational number (like 1.5 or 1/2) optionally followed by one of ‘<samp>s</samp>’, ‘<samp>m</samp>’, ‘<samp>h</samp>’ or ‘<samp>d</samp>’, meaning seconds, minutes, hours and days respectively. If no unit is specified, it defaults to seconds. <var>interval</var> has a resolution of one second; fractions of a second are not allowed. </p> </dd> <dt><code>-u</code></dt> <dt><code>--unidirectional</code></dt> <dd><p>Run all passes in the same direction. Forwards by default, or backwards if the option ‘<samp>--reverse</samp>’ is also given. </p> </dd> <dt><code>-v</code></dt> <dt><code>--verbose</code></dt> <dd><p>Verbose mode. Further -v’s (up to 4) increase the verbosity level. </p> </dd> <dt><code>-w</code></dt> <dt><code>--ignore-write-errors</code></dt> <dd><p>Make fill mode ignore write errors. This is useful to avoid ddrescue exiting because of new bad sectors developing while wiping the good sectors of a failing drive. Fill mode normally writes to <var>outfile</var> one cluster at a time. With this option, after the first write error is found in an area, the rest of that area is filled sector by sector. </p> <p>Note that in rescue mode a write error is fatal, which means that the rescue needs to be repeated or else <var>outfile</var> needs to be copied to a third drive using <var>mapfile</var> as domain (see <a href="#g_t_002d_002ddomain_002dmapfile">--domain-mapfile</a>). </p> </dd> <dt><code>-x <var>bytes</var></code></dt> <dt><code>--extend-outfile=<var>bytes</var></code></dt> <dd><p>Extend the size of <var>outfile</var> to make it at least <var>bytes</var> long. If the size of <var>outfile</var> is already equal or longer than <var>bytes</var> then this option does nothing. Use this option to guarantee a minimum size for <var>outfile</var>. Only regular files can be extended. </p> </dd> <dt><code>-X <var>n</var></code></dt> <dt><code>--max-read-errors=<var>n</var></code></dt> <dd><p>Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than <var>n</var> read errors are encountered. ‘<samp>--max-read-errors=0</samp>’ is similar but different to ‘<samp>--timeout=0</samp>’, which waits until the screen status is refreshed (at least 1 second). If there is at least one successful read per second, ‘<samp>--timeout=0</samp>’ does not make ddrescue to exit. </p> <p>‘<samp>--max-read-errors=0</samp>’ is also similar but different to ‘<samp>--max-bad-areas=+0</samp>’, which exits when a new bad area is found. If the read errors are adjacent to existing bad areas, no new bad areas are produced (just enlarged), and ‘<samp>--max-bad-areas=+0</samp>’ does not make ddrescue to exit. </p> </dd> <dt><code>-y</code></dt> <dt><code>--synchronous</code></dt> <dd><p>Use synchronous writes for <var>outfile</var>. (Issue a fsync call after every write). May be useful when forcing the drive to remap its bad sectors. </p> </dd> <dt><code>-Z <var>bytes</var></code></dt> <dt><code>--max-read-rate=<var>bytes</var></code></dt> <dd><p>Maximum read rate, in bytes per second. If <var>bytes</var> is too small, the actual read rate is rounded up to the equivalent of a whole number of cluster reads per second. Use this option to limit the bandwidth used by ddrescue, for example when recovering over a network. </p> </dd> <dt><code>--ask</code></dt> <dd><p>Ask for user confirmation before starting the copy. If the first letter of the answer is ‘<samp>y</samp>’, ddrescue starts copying. Else it exits with status 1.<br> If they can be obtained, ddrescue shows the model and serial number of the input and output devices. Ddrescue also shows the size in bytes of the corresponding file or device if it exists. The format used is [<var>model</var>::<var><span class="nolinebreak">serial_number</span></var>] (<var>size</var>)<!-- /@w --> </p> </dd> <dt><code>--cpass=<var>range</var></code></dt> <dd><p>Select what pass(es) to run during the copying phase. Valid pass values range from 1 to 5. To run only the given pass(es), specify also ‘<samp>--no-trim</samp>’ and ‘<samp>--no-scrape</samp>’. ‘<samp>--cpass=0</samp>’ skips the copying phase entirely. </p> <table> <tr><td>Examples of <var>range</var></td><td>Passes run</td></tr> <tr><td>1</td><td>1</td></tr> <tr><td>1,2,3</td><td>1, 2 and 3</td></tr> <tr><td>2-4</td><td>2, 3 and 4</td></tr> <tr><td>1,3-5</td><td>1, 3, 4 and 5</td></tr> <tr><td>1-3,5</td><td>1, 2, 3 and 5</td></tr> </table> </dd> <dt><code>--delay-slow=<var>interval</var></code></dt> <dd><p>Initial delay before ddrescue starts checking for slow reads. Defaults to 30 seconds. <var>interval</var> is formatted as in the option ‘<samp>--timeout</samp>’ above. </p> </dd> <dt><code>--log-events=<var>file</var></code></dt> <dd><p>Log all significant events (start of each pass and end of run) in <var>file</var>. If <var>file</var> already exists, the new events are appended at the end of <var>file</var>. For each event a line is printed containing a time stamp, the percentage rescued and a message describing the event. The ‘<samp>end of run</samp>’ line also contains the current position and status. If ddrescue exits because of an error or interruption, the cause is also logged in <var>file</var>. </p> </dd> <dt><code>--log-rates=<var>file</var></code></dt> <dd><p>Log rates and error sizes every second in <var>file</var>. If <var>file</var> already exists, it will be overwritten. Every time the screen is updated with new details, some of those details (time, input position, current and average rates, number of bad areas and total error size) are written to <var>file</var> in a format usable by plotting utilities like gnuplot. This allows a posterior analysis of the drive to see if it has any weak zones (areas where the transfer rate drops well below the sustained average). </p> </dd> <dt><code>--log-reads=<var>file</var></code></dt> <dd><p>Log all read operations in <var>file</var>. If <var>file</var> already exists, it will be overwritten. Every read attempt and its result (position, size, copied size and error size) is written to <var>file</var>. (The position written is always the beginning of the block tried, even if reading backwards). A line is also written at the beginning of each phase (copying, trimming, scraping and retrying). Finally, a line with a time mark is written every second (unless the read takes more time). Use this option with caution because <var>file</var> may become very large very quickly. Use lzip to compress <var>file</var> if you need to store or transmit it. </p> </dd> <dt><code>--mapfile-interval=[<var>save_interval</var>][,<var>sync_interval</var>]</code></dt> <dd><p>Change the interval at which ddrescue saves and fsyncs the mapfile. At least one of <var>save_interval</var> or <var>sync_interval</var> must be specified. A <var>save_interval</var> of -1 chooses the default automatic interval (from 30 seconds to 5 minutes depending on mapfile size). A <var>save_interval</var> of 0 saves the mapfile after every read (use with caution). <var>sync_interval</var> is the interval between fsync calls. Default <var>sync_interval</var> is 5 minutes. Minimum <var>sync_interval</var> is 5 seconds. Intervals are formatted as in the option ‘<samp>--timeout</samp>’ above. </p> </dd> <dt><code>--max-slow-reads=<var>n</var></code></dt> <dd><p>Maximum number of slow reads allowed before giving up. Defaults to infinity. Exit with status 1 if more than <var>n</var> slow reads are encountered during the first two passes of the copying phase. Only works if a minimum read rate has been set with ‘<samp>--min-read-rate</samp>’. </p> </dd> <dt><code>--pause-on-error=<var>interval</var></code></dt> <dd><p>Time to wait after each read error or slow read. Defaults to 0. <var>interval</var> is formatted as in the option ‘<samp>--timeout</samp>’ above. If <var>interval</var> begins with ‘<samp>s</samp>’, the pause is simulated and <var>interval</var> can be smaller than one second; the time displayed is increased by <var>interval</var> but without performing any pause. Pause simulation can be useful in combination with ‘<samp>--test-mode</samp>’ for testing purposes. </p> </dd> <dt><code>--pause-on-pass=<var>interval</var></code></dt> <dd><p>Time to wait between passes. Defaults to 0. <var>interval</var> is formatted as in the option ‘<samp>--timeout</samp>’ above. </p> </dd> <dt><code>--reset-slow</code></dt> <dd><p>Reset the slow reads counter every time the read rate reaches or surpasses ‘<samp>--min-read-rate</samp>’. With this option, ddrescue only exits after the read rate has remained below ‘<samp>--min-read-rate</samp>’ for at least as many seconds as the argument given to ‘<samp>--max-slow-reads</samp>’. </p> </dd> <dt><code>--same-file</code></dt> <dd><p>Allow <var>infile</var> and <var>outfile</var> to be the same file or device. This may be used to test the writing ability of a drive. It may also be used to copy part of a file to another location inside or beyond the end of the same file by setting different values for ‘<samp>--input-position</samp>’ and ‘<samp>--output-position</samp>’. If the data to be copied overlap with the destination, the right copying direction must be chosen to avoid overwriting the overlapping part before it is copied. </p> </dd> </dl> <p>Numbers given as arguments to options (positions, sizes, rates, etc) may be expressed as decimal, hexadecimal or octal values (using the same syntax as integer constants in C++), and may be followed by a multiplier and an optional ‘<samp>B</samp>’ for "byte". The ‘<samp>s</samp>’ multiplier may be appended to any of the other multipliers. For example, ‘<samp>ks</samp>’ means kilosectors (1000 * <span class="nolinebreak">sector_size)</span><!-- /@w -->, and ‘<samp>Kis</samp>’ means kibisectors (1024 * <span class="nolinebreak">sector_size)</span><!-- /@w -->. </p> <p>Table of SI and binary prefixes (unit multipliers): </p> <table> <tr><td>Prefix</td><td>Value</td><td>|</td><td>Prefix</td><td>Value</td></tr> <tr><td>s</td><td>sectors</td><td>|</td><td></td><td></td></tr> <tr><td>k</td><td>kilobyte (10^3 = 1000)</td><td>|</td><td>Ki</td><td>kibibyte (2^10 = 1024)</td></tr> <tr><td>M</td><td>megabyte (10^6)</td><td>|</td><td>Mi</td><td>mebibyte (2^20)</td></tr> <tr><td>G</td><td>gigabyte (10^9)</td><td>|</td><td>Gi</td><td>gibibyte (2^30)</td></tr> <tr><td>T</td><td>terabyte (10^12)</td><td>|</td><td>Ti</td><td>tebibyte (2^40)</td></tr> <tr><td>P</td><td>petabyte (10^15)</td><td>|</td><td>Pi</td><td>pebibyte (2^50)</td></tr> <tr><td>E</td><td>exabyte (10^18)</td><td>|</td><td>Ei</td><td>exbibyte (2^60)</td></tr> <tr><td>Z</td><td>zettabyte (10^21)</td><td>|</td><td>Zi</td><td>zebibyte (2^70)</td></tr> <tr><td>Y</td><td>yottabyte (10^24)</td><td>|</td><td>Yi</td><td>yobibyte (2^80)</td></tr> </table> <br> <p>Exit status: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file, 3 for an internal consistency error (eg, bug) which caused ddrescue to panic. </p> <p>If ddrescue is interrupted by a signal, it updates <var>mapfile</var> and then terminates by raising the signal received. </p> <hr> <div class="header"> <p> Next: <a href="Mapfile-structure.html" accesskey="n" rel="next">Mapfile structure</a>, Previous: <a href="Output.html" accesskey="p" rel="prev">Output</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Concept-index.html" title="Index" rel="index">Index</a>]</p> </div> </body> </html>