]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sbin/recoverdisk/recoverdisk.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sbin / recoverdisk / recoverdisk.1
1 .\" Copyright (c) 2006 Ulrich Spoerlein <uspoerlein@gmail.com>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd May 1, 2011
28 .Dt RECOVERDISK 1
29 .Os
30 .Sh NAME
31 .Nm recoverdisk
32 .Nd recover data from hard disk or optical media
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl b Ar bigsize
36 .Op Fl r Ar readlist
37 .Op Fl s Ar interval
38 .Op Fl w Ar writelist
39 .Ar source
40 .Op Ar destination
41 .Sh DESCRIPTION
42 The
43 .Nm
44 utility reads data from the
45 .Ar source
46 file until all blocks could be successfully read.
47 If
48 .Ar destination
49 was specified all data is being written to that file.
50 It starts reading in multiples of the sector size.
51 Whenever a block fails, it is put to the end of the working queue and will be
52 read again, possibly with a smaller read size.
53 .Pp
54 By default it uses block sizes of roughly 1 MB, 32kB, and the native
55 sector size (usually 512 bytes).
56 These figures are adjusted slightly, for devices whose sectorsize is not a
57 power of 2, e.g., audio CDs with a sector size of 2352 bytes.
58 .Pp
59 The options are as follows:
60 .Bl -tag -width indent
61 .It Fl b Ar bigsize
62 The size of reads attempted first.
63 The middle pass is roughly the logarithmic average of the bigsize and
64 the sectorsize.
65 .It Fl r Ar readlist
66 Read the list of blocks and block sizes to read from the specified file.
67 .It Fl s Ar interval
68 How often we should update the writelist file while things go OK.
69 The default is 60 and the unit is "progress messages" so if things
70 go well, this is the same as once per minute.
71 .It Fl w Ar writelist
72 Write the list of remaining blocks to read to the specified file if
73 .Nm
74 is aborted via
75 .Dv SIGINT .
76 .El
77 .Pp
78 The
79 .Fl r
80 and
81 .Fl w
82 options can be specified together.
83 Especially, they can point to the same file, which will be updated on abort.
84 .Sh OUTPUT
85 The
86 .Nm
87 utility
88 prints several columns, detailing the progress
89 .Bl -tag -width remaining
90 .It Va start
91 Starting offset of the current block.
92 .It Va size
93 Read size of the current block.
94 .It Va len
95 Length of the current block.
96 .It Va state
97 Is increased for every failed read.
98 .It Va done
99 Number of bytes already read.
100 .It Va remaining
101 Number of bytes remaining.
102 .It Va "% done"
103 Percent complete.
104 .El
105 .Sh EXAMPLES
106 .Bd -literal
107 # recover data from failing hard drive ad3
108 recoverdisk /dev/ad3 /data/disk.img
109
110 # clone a hard disk
111 recoverdisk /dev/ad3 /dev/ad4
112
113 # read an ISO image from a CD-ROM
114 recoverdisk /dev/cd0 /data/cd.iso
115
116 # continue reading from a broken CD and update the existing worklist
117 recoverdisk -r worklist -w worklist /dev/cd0 /data/cd.iso
118
119 # recover a single file from the unreadable media
120 recoverdisk /cdrom/file.avi file.avi
121
122 # If the disk hangs the system on read-errors try:
123 recoverdisk -b 0 /dev/ad3 /somewhere
124
125 .Ed
126 .Sh SEE ALSO
127 .Xr dd 1
128 .Sh HISTORY
129 The
130 .Nm
131 utility first appeared in
132 .Fx 7.0 .
133 .Sh AUTHORS
134 .An -nosplit
135 The original implementation was done by
136 .An Poul-Henning Kamp Aq phk@FreeBSD.org
137 with minor improvements from
138 .An Ulrich Sp\(:orlein Aq uqs@FreeBSD.org .
139 .Pp
140 This manual page was written by
141 .An Ulrich Sp\(:orlein .
142 .Sh BUGS
143 Reading from media where the sectorsize is not a power of 2 will make all
144 1 MB reads fail.
145 This is due to the DMA reads being split up into blocks of at most 128kB.
146 These reads then fail if the sectorsize is not a divisor of 128kB.
147 When reading a full raw audio CD, this leads to roughly 700 error messages
148 flying by.
149 This is harmless and can be avoided by setting
150 .Fl b
151 to no more than 128kB.
152 .\".Pp
153 .\"When reading from optical media, a bug in the GEOM framework will
154 .\"prevent it from seeing that the media has been removed.
155 .\"The device can still be opened, but all reads will fail.
156 .\"This is usually harmless, but will send
157 .\".Nm
158 .\"into an infinite loop.