]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sbin/recoverdisk/recoverdisk.1
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.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 6, 2006
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 rlist
37 .Op Fl s Ar snapshot
38 .Op Fl w Ar wlist
39 .Ar special
40 .Op Ar file
41 .Sh DESCRIPTION
42 The
43 .Nm
44 utility reads data from the
45 .Ar special
46 file until all blocks could be successfully read.
47 It starts reading in multiples of the sector size.
48 Whenever a block fails, it is put to the end of the working queue and will be
49 read again, possibly with a smaller read size.
50 .Pp
51 By default it uses block sizes of roughly 1 MB, 32kB, and the native
52 sector size (usually 512 bytes).
53 These figures are adjusted slightly, for devices whose sectorsize is not a
54 power of 2, e.g., audio CDs with a sector size of 2352 bytes.
55 .Pp
56 The options are as follows:
57 .Bl -tag -width indent
58 .It Fl b Ar bigsize
59 The size of reads attempted first.
60 The middle pass is roughly the logarithmic average of the bigsize and
61 the sectorsize.
62 .It Fl r Ar rlist
63 Read the list of blocks and block sizes to read from the specified file.
64 .It Fl s Ar snapshot
65 How often we should update the worklist file while things go OK.
66 The default is 60 and the units is "progress messages" so if things
67 go well, this is the same as once per minute.
68 .It Fl w Ar wlist
69 Write the list of remaining blocks to read to the specified file if
70 .Nm
71 is aborted via
72 .Dv SIGINT .
73 .El
74 .Pp
75 The
76 .Fl r
77 and
78 .Fl w
79 options can be specified together.
80 Especially, they can point to the same file, which will be updated on abort.
81 .Sh OUTPUT
82 The
83 .Nm
84 utility
85 prints several columns, detailing the progress
86 .Bl -tag -width remaining
87 .It Va start
88 Starting offset of the current block.
89 .It Va size
90 Read size of the current block.
91 .It Va len
92 Length of the current block.
93 .It Va state
94 Is increased for every failed read.
95 .It Va done
96 Number of bytes already read.
97 .It Va remaining
98 Number of bytes remaining.
99 .It Va "% done"
100 Percent complete.
101 .El
102 .Sh EXAMPLES
103 .Bd -literal
104 # recover data from failing hard drive ad3
105 touch /data/lots_of_space
106 recoverdisk /dev/ad3 /data/lots_of_space
107
108 # clone a hard disk
109 recoverdisk /dev/ad3 /dev/ad4
110
111 # read an ISO image from a CD-ROM
112 touch /data/cd.iso; recoverdisk /dev/acd0 /data/cd.iso
113
114 # continue reading from a broken CD and update the existing worklist
115 recoverdisk -r worklist -w worklist /dev/acd0 /data/cd.iso
116
117 # recover a single file from the unreadable media
118 touch file.avi; recoverdisk /cdrom/file.avi file.avi
119
120 # If the disk hangs the system on read-errors try:
121 recoverdisk -b 0 /dev/ad3 /somewhere
122
123 .Ed
124 .Sh SEE ALSO
125 .Xr dd 1
126 .Sh HISTORY
127 The
128 .Nm
129 utility first appeared in
130 .Fx 7.0 .
131 .Sh AUTHORS
132 .An -nosplit
133 The original implementation was done by
134 .An Poul-Henning Kamp Aq phk@FreeBSD.org
135 with minor improvements from
136 .An Ulrich Sp\(:orlein Aq uspoerlein@gmail.com .
137 .Pp
138 This manual page was written by
139 .An Ulrich Sp\(:orlein .
140 .Sh BUGS
141 Reading from media where the sectorsize is not a power of 2 will make all
142 1 MB reads fail.
143 This is due to the DMA reads being split up into blocks of at most 128kB.
144 These reads then fail if the sectorsize is not a divisor of 128kB.
145 When reading a full raw audio CD, this leads to roughly 700 error messages
146 flying by.
147 This is harmless.