1 .\" Copyright (c) 2006 Ulrich Spoerlein <uspoerlein@gmail.com>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd recover data from hard disk or optical media
46 utility reads data from the
48 file until all blocks could be successfully read.
51 was specified all data is being written to that file.
52 It starts reading in multiples of the sector size.
53 Whenever a block fails, it is put to the end of the working queue and will be
54 read again, possibly with a smaller read size.
56 By default it uses block sizes of roughly 1 MB, 32kB, and the native
57 sector size (usually 512 bytes).
58 These figures are adjusted slightly, for devices whose sectorsize is not a
59 power of 2, e.g., audio CDs with a sector size of 2352 bytes.
61 The options are as follows:
62 .Bl -tag -width indent
64 The size of reads attempted first.
65 The middle pass is roughly the logarithmic average of the bigsize and
68 Read the list of blocks and block sizes to read from the specified file.
70 How often we should update the writelist file while things go OK.
71 The default is 60 and the unit is "progress messages" so if things
72 go well, this is the same as once per minute.
74 By default blocks which encounter read errors will be filled with
79 used to specify another pattern.
80 Nothing gets written if the string is empty.
82 Enables nicer status report using ANSI escapes and UTF-8.
84 Write the list of remaining blocks to read to the specified file if
94 options can be specified together.
95 Especially, they can point to the same file, which will be updated on abort.
100 prints several columns, detailing the progress
101 .Bl -tag -width remaining
103 Starting offset of the current block.
105 Read size of the current block.
107 Length of the current block.
109 Is increased for every failed read.
111 Number of bytes already read.
113 Number of bytes remaining.
119 # recover data from failing hard drive ada3
120 recoverdisk /dev/ada3 /data/disk.img
123 recoverdisk /dev/ada3 /dev/ada4
125 # read an ISO image from a CD-ROM
126 recoverdisk /dev/cd0 /data/cd.iso
128 # continue reading from a broken CD and update the existing worklist
129 recoverdisk -r worklist -w worklist /dev/cd0 /data/cd.iso
131 # recover a single file from the unreadable media
132 recoverdisk /cdrom/file.avi file.avi
134 # If the disk hangs the system on read-errors try:
135 recoverdisk -b 0 /dev/ada3 /somewhere
147 utility first appeared in
151 The original implementation was done by
152 .An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
153 with minor improvements from
154 .An Ulrich Sp\(:orlein Aq Mt uqs@FreeBSD.org .
156 This manual page was written by
157 .An Ulrich Sp\(:orlein .
159 Reading from media where the sectorsize is not a power of 2 will make all
161 This is due to the DMA reads being split up into blocks of at most 128kB.
162 These reads then fail if the sectorsize is not a divisor of 128kB.
163 When reading a full raw audio CD, this leads to roughly 700 error messages
165 This is harmless and can be avoided by setting
167 to no more than 128kB.
170 needs to know about read errors as fast as possible, i.e., retries by lower
171 layers will usually slow down the operation.
174 attached drives, you may want to set kern.cam.XX.retry_count to zero, e.g.:
176 # sysctl kern.cam.ada.retry_count=0
177 # sysctl kern.cam.cd.retry_count=0
178 # sysctl kern.cam.da.retry_count=0
181 .\"When reading from optical media, a bug in the GEOM framework will
182 .\"prevent it from seeing that the media has been removed.
183 .\"The device can still be opened, but all reads will fail.
184 .\"This is usually harmless, but will send
186 .\"into an infinite loop.