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