xref: /freebsd/usr.sbin/camdd/camdd.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1*a9934668SKenneth D. Merry.\"
2*a9934668SKenneth D. Merry.\" Copyright (c) 2015 Spectra Logic Corporation
3*a9934668SKenneth D. Merry.\" All rights reserved.
4*a9934668SKenneth D. Merry.\"
5*a9934668SKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without
6*a9934668SKenneth D. Merry.\" modification, are permitted provided that the following conditions
7*a9934668SKenneth D. Merry.\" are met:
8*a9934668SKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright
9*a9934668SKenneth D. Merry.\"    notice, this list of conditions, and the following disclaimer,
10*a9934668SKenneth D. Merry.\"    without modification.
11*a9934668SKenneth D. Merry.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
12*a9934668SKenneth D. Merry.\"    substantially similar to the "NO WARRANTY" disclaimer below
13*a9934668SKenneth D. Merry.\"    ("Disclaimer") and any redistribution must be conditioned upon
14*a9934668SKenneth D. Merry.\"    including a substantially similar Disclaimer requirement for further
15*a9934668SKenneth D. Merry.\"    binary redistribution.
16*a9934668SKenneth D. Merry.\"
17*a9934668SKenneth D. Merry.\" NO WARRANTY
18*a9934668SKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19*a9934668SKenneth D. Merry.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20*a9934668SKenneth D. Merry.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21*a9934668SKenneth D. Merry.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22*a9934668SKenneth D. Merry.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*a9934668SKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*a9934668SKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*a9934668SKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26*a9934668SKenneth D. Merry.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27*a9934668SKenneth D. Merry.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*a9934668SKenneth D. Merry.\" POSSIBILITY OF SUCH DAMAGES.
29*a9934668SKenneth D. Merry.\"
30*a9934668SKenneth D. Merry.\" Authors: Ken Merry           (Spectra Logic Corporation)
31*a9934668SKenneth D. Merry.\"
32*a9934668SKenneth D. Merry.Dd November 11, 2015
33*a9934668SKenneth D. Merry.Dt CAMDD 8
34*a9934668SKenneth D. Merry.Os
35*a9934668SKenneth D. Merry.Sh NAME
36*a9934668SKenneth D. Merry.Nm camdd
37*a9934668SKenneth D. Merry.Nd CAM data transfer utility
38*a9934668SKenneth D. Merry.Sh SYNOPSIS
39*a9934668SKenneth D. Merry.Nm
40*a9934668SKenneth D. Merry.Aq Fl i|o Ar pass=pass_dev|file=filename,bs=blocksize,[...]
41*a9934668SKenneth D. Merry.Op Fl C Ar retry_count
42*a9934668SKenneth D. Merry.Op Fl E
43*a9934668SKenneth D. Merry.Op Fl m Ar max_io
44*a9934668SKenneth D. Merry.Op Fl t Ar timeout
45*a9934668SKenneth D. Merry.Op Fl v
46*a9934668SKenneth D. Merry.Op Fl h
47*a9934668SKenneth D. Merry.Sh DESCRIPTION
48*a9934668SKenneth D. MerryThe
49*a9934668SKenneth D. Merry.Nm
50*a9934668SKenneth D. Merryutility is a sequential data transfer utility that offers standard
51*a9934668SKenneth D. Merry.Xr read 2
52*a9934668SKenneth D. Merryand
53*a9934668SKenneth D. Merry.Xr write 2
54*a9934668SKenneth D. Merryoperation in addition to a mode that uses the asynchronous
55*a9934668SKenneth D. Merry.Xr pass 4
56*a9934668SKenneth D. MerryAPI.
57*a9934668SKenneth D. MerryThe asynchronous
58*a9934668SKenneth D. Merry.Xr pass 4
59*a9934668SKenneth D. MerryAPI allows multiple requests to be queued to a device simultaneously.
60*a9934668SKenneth D. Merry.Pp
61*a9934668SKenneth D. Merry.Nm
62*a9934668SKenneth D. Merrycollects performance information and will display it when the transfer
63*a9934668SKenneth D. Merrycompletes, when
64*a9934668SKenneth D. Merry.Nm
65*a9934668SKenneth D. Merryis terminated or when it receives a SIGINFO signal.
66*a9934668SKenneth D. Merry.Pp
67*a9934668SKenneth D. MerryThe following options are available:
68*a9934668SKenneth D. Merry.Bl -tag -width 12n
69*a9934668SKenneth D. Merry.It Fl i | o Ar args
70*a9934668SKenneth D. MerrySpecify the input and output device or file.
71*a9934668SKenneth D. MerryBoth
72*a9934668SKenneth D. Merry.Fl i
73*a9934668SKenneth D. Merryand
74*a9934668SKenneth D. Merry.Fl o
75*a9934668SKenneth D. Merrymust be specified.
76*a9934668SKenneth D. MerryThere are a number of parameters that can be specified.
77*a9934668SKenneth D. MerryOne of the first two (file or pass) MUST be specified to indicate which I/O
78*a9934668SKenneth D. Merrymethod to use on the device in question.
79*a9934668SKenneth D. Merry.Bl -tag -width 9n
80*a9934668SKenneth D. Merry.It pass=dev
81*a9934668SKenneth D. MerrySpecify a
82*a9934668SKenneth D. Merry.Xr pass 4
83*a9934668SKenneth D. Merrydevice to operate on.
84*a9934668SKenneth D. MerryThis requests that
85*a9934668SKenneth D. Merry.Nm
86*a9934668SKenneth D. Merryaccess the device in question be accessed via the asynchronous
87*a9934668SKenneth D. Merry.Xr pass 4
88*a9934668SKenneth D. Merryinterface.
89*a9934668SKenneth D. Merry.Pp
90*a9934668SKenneth D. MerryThe device name can be a
91*a9934668SKenneth D. Merry.Xr pass 4
92*a9934668SKenneth D. Merryname and unit number, for instance
93*a9934668SKenneth D. Merry.Dq pass0 ,
94*a9934668SKenneth D. Merryor a regular peripheral driver name and unit number, for instance
95*a9934668SKenneth D. Merry.Dq da5 .
96*a9934668SKenneth D. MerryIt can also be the path of a
97*a9934668SKenneth D. Merry.Xr pass 4
98*a9934668SKenneth D. Merryor other disk device, like
99*a9934668SKenneth D. Merry.Dq /dev/da5 .
100*a9934668SKenneth D. MerryIt may also be a bus:target:lun, for example:
101*a9934668SKenneth D. Merry.Dq 0:5:0 .
102*a9934668SKenneth D. Merry.Pp
103*a9934668SKenneth D. MerryOnly
104*a9934668SKenneth D. Merry.Xr pass 4
105*a9934668SKenneth D. Merrydevices for
106*a9934668SKenneth D. Merry.Tn SCSI
107*a9934668SKenneth D. Merrydisk-like devices are supported.
108*a9934668SKenneth D. Merry.Tn ATA
109*a9934668SKenneth D. Merrydevices are not currently supported, but support could be added later.
110*a9934668SKenneth D. MerrySpecifically,
111*a9934668SKenneth D. Merry.Tn SCSI
112*a9934668SKenneth D. MerryDirect Access (type 0), WORM (type 4), CDROM (type 5), and RBC (Reduced
113*a9934668SKenneth D. MerryBlock Command, type 14) devices are supported.
114*a9934668SKenneth D. MerryTape drives, medium changers, enclosures etc. are not supported.
115*a9934668SKenneth D. Merry.It file=path
116*a9934668SKenneth D. MerrySpecify a file or device to operate on.
117*a9934668SKenneth D. MerryThis requests that the file or device in question be accessed using the
118*a9934668SKenneth D. Merrystandard
119*a9934668SKenneth D. Merry.Xr read 2
120*a9934668SKenneth D. Merryand
121*a9934668SKenneth D. Merry.Xr write 2
122*a9934668SKenneth D. Merrysystem calls.
123*a9934668SKenneth D. MerryThe file interface does not support queueing multiple commands at a time.
124*a9934668SKenneth D. MerryIt does support probing disk sector size and capacity information, and tape
125*a9934668SKenneth D. Merryblocksize and maximum transfer size information.
126*a9934668SKenneth D. MerryThe file interface supports standard files, disks, tape drives, special
127*a9934668SKenneth D. Merrydevices, pipes and standard input and output.
128*a9934668SKenneth D. MerryIf the file is specified as a
129*a9934668SKenneth D. Merry.Dq - ,
130*a9934668SKenneth D. Merrystandard input or standard output are used.
131*a9934668SKenneth D. MerryFor tape devices, the specified blocksize will be the size that
132*a9934668SKenneth D. Merry.Nm
133*a9934668SKenneth D. Merryattempts to use to write to or read from the tape.
134*a9934668SKenneth D. MerryWhen writing to a tape device, the blocksize is treated like a disk sector
135*a9934668SKenneth D. Merrysize.
136*a9934668SKenneth D. MerrySo, that means
137*a9934668SKenneth D. Merry.Nm
138*a9934668SKenneth D. Merrywill not write anything smaller than the sector size.
139*a9934668SKenneth D. MerryAt the end of a transfer, if there isn't sufficient data from the reader
140*a9934668SKenneth D. Merryto yield a full block,
141*a9934668SKenneth D. Merry.Nm
142*a9934668SKenneth D. Merrywill add zeros on the end of the data from the reader to make up a full
143*a9934668SKenneth D. Merryblock.
144*a9934668SKenneth D. Merry.It bs=N
145*a9934668SKenneth D. MerrySpecify the blocksize to use for transfers.
146*a9934668SKenneth D. Merry.Nm
147*a9934668SKenneth D. Merrywill attempt to read or write using the requested blocksize.
148*a9934668SKenneth D. Merry.Pp
149*a9934668SKenneth D. MerryNote that the blocksize given only applies to either the input or the
150*a9934668SKenneth D. Merryoutput path.
151*a9934668SKenneth D. MerryTo use the same blocksize for the input and output transfers, you must
152*a9934668SKenneth D. Merryspecify that blocksize with both the
153*a9934668SKenneth D. Merry.Fl i
154*a9934668SKenneth D. Merryand
155*a9934668SKenneth D. Merry.Fl o
156*a9934668SKenneth D. Merryarguments.
157*a9934668SKenneth D. Merry.Pp
158*a9934668SKenneth D. MerryThe blocksize may be specified in bytes, or using any suffix (e.g. k, M, G)
159*a9934668SKenneth D. Merrysupported by
160*a9934668SKenneth D. Merry.Xr expand_number 3 .
161*a9934668SKenneth D. Merry.It offset=N
162*a9934668SKenneth D. MerrySpecify the starting offset for the input or output device or file.
163*a9934668SKenneth D. MerryThe offset may be specified in bytes, or by using any suffix (e.g. k, M, G)
164*a9934668SKenneth D. Merrysupported by
165*a9934668SKenneth D. Merry.Xr expand_number 3 .
166*a9934668SKenneth D. Merry.It depth=N
167*a9934668SKenneth D. MerrySpecify a desired queue depth for the input or output path.
168*a9934668SKenneth D. Merry.Nm
169*a9934668SKenneth D. Merrywill attempt to keep the requested number of requests of the specified
170*a9934668SKenneth D. Merryblocksize queued to the input or output device.
171*a9934668SKenneth D. MerryQueue depths greater than 1 are only supported for the asynchronous
172*a9934668SKenneth D. Merry.Xr pass 4
173*a9934668SKenneth D. Merryoutput method.
174*a9934668SKenneth D. MerryThe queue depth is maintained on a best effort basis, and may not be
175*a9934668SKenneth D. Merrypossible to maintain for especially fast devices.
176*a9934668SKenneth D. MerryFor writes, maintaining the queue depth also depends on a sufficiently
177*a9934668SKenneth D. Merryfast reading device.
178*a9934668SKenneth D. Merry.It mcs=N
179*a9934668SKenneth D. MerrySpecify the minimum command size to use for
180*a9934668SKenneth D. Merry.Xr pass 4
181*a9934668SKenneth D. Merrydevices.
182*a9934668SKenneth D. MerrySome devices do not support 6 byte
183*a9934668SKenneth D. Merry.Tn SCSI
184*a9934668SKenneth D. Merrycommands.
185*a9934668SKenneth D. MerryThe
186*a9934668SKenneth D. Merry.Xr da 4
187*a9934668SKenneth D. Merrydevice handles this restriction automatically, but the
188*a9934668SKenneth D. Merry.Xr pass 4
189*a9934668SKenneth D. Merrydevice allows the user to specify the
190*a9934668SKenneth D. Merry.Tn SCSI
191*a9934668SKenneth D. Merrycommand used.
192*a9934668SKenneth D. MerryIf a device does not accept 6 byte
193*a9934668SKenneth D. Merry.Tn SCSI
194*a9934668SKenneth D. MerryREAD/WRITE commands (which is the default at lower LBAs), it will generally
195*a9934668SKenneth D. Merryaccept 10 byte
196*a9934668SKenneth D. Merry.Tn SCSI
197*a9934668SKenneth D. Merrycommands instead.
198*a9934668SKenneth D. Merry.It debug=N
199*a9934668SKenneth D. MerrySpecify the debug level for this device.
200*a9934668SKenneth D. MerryThere is currently only one debug level setting, so setting this to any
201*a9934668SKenneth D. Merrynon-zero value will turn on debugging.
202*a9934668SKenneth D. MerryThe debug facility may be expanded in the future.
203*a9934668SKenneth D. Merry.El
204*a9934668SKenneth D. Merry.It Fl C Ar count
205*a9934668SKenneth D. MerrySpecify the retry count for commands sent via the asynchronous
206*a9934668SKenneth D. Merry.Xr pass 4
207*a9934668SKenneth D. Merryinterface.
208*a9934668SKenneth D. MerryThis does not apply to commands sent via the file interface.
209*a9934668SKenneth D. Merry.It Fl E
210*a9934668SKenneth D. MerryEnable kernel error recovery for the
211*a9934668SKenneth D. Merry.Xr pass 4
212*a9934668SKenneth D. Merrydriver.
213*a9934668SKenneth D. MerryIf error recovery is not enabled, unit attention conditions and other
214*a9934668SKenneth D. Merrytransient failures may cause the transfer to fail.
215*a9934668SKenneth D. Merry.It Fl m Ar size
216*a9934668SKenneth D. MerrySpecify the maximum amount of data to be transferred.
217*a9934668SKenneth D. MerryThis may be specified in bytes, or by using any suffix (e.g. K, M, G)
218*a9934668SKenneth D. Merrysupported by
219*a9934668SKenneth D. Merry.Xr expand_number 3 .
220*a9934668SKenneth D. Merry.It Fl t Ar timeout
221*a9934668SKenneth D. MerrySpecify the command timeout in seconds to use for commands sent via the
222*a9934668SKenneth D. Merry.Xr pass 4
223*a9934668SKenneth D. Merrydriver.
224*a9934668SKenneth D. Merry.It Fl v
225*a9934668SKenneth D. MerryEnable verbose reporting of errors.
226*a9934668SKenneth D. MerryThis is recommended to aid in debugging any
227*a9934668SKenneth D. Merry.Tn SCSI
228*a9934668SKenneth D. Merryissues that come up.
229*a9934668SKenneth D. Merry.It Fl h
230*a9934668SKenneth D. MerryDisplay the
231*a9934668SKenneth D. Merry.Nm
232*a9934668SKenneth D. Merryusage message.
233*a9934668SKenneth D. Merry.El
234*a9934668SKenneth D. Merry.Pp
235*a9934668SKenneth D. MerryIf
236*a9934668SKenneth D. Merry.Nm
237*a9934668SKenneth D. Merryreceives a SIGINFO signal, it will print the current input and output byte
238*a9934668SKenneth D. Merrycounts, elapsed runtime and average throughput.
239*a9934668SKenneth D. MerryIf
240*a9934668SKenneth D. Merry.Nm
241*a9934668SKenneth D. Merryreceives a SIGINT signal, it will print the current input and output byte
242*a9934668SKenneth D. Merrycounts, elapsed runtime and average throughput and then exit.
243*a9934668SKenneth D. Merry.Sh EXAMPLES
244*a9934668SKenneth D. Merry.Dl camdd -i pass=da8,bs=512k,depth=4 -o pass=da3,bs=512k,depth=4
245*a9934668SKenneth D. Merry.Pp
246*a9934668SKenneth D. MerryCopy all data from da8 to da3 using a blocksize of 512k for both drives,
247*a9934668SKenneth D. Merryand attempt to maintain a queue depth of 4 on both the input and output
248*a9934668SKenneth D. Merrydevices.
249*a9934668SKenneth D. MerryThe transfer will stop when the end of either device is reached.
250*a9934668SKenneth D. Merry.Pp
251*a9934668SKenneth D. Merry.Dl camdd -i file=/dev/zero,bs=1M -o pass=da5,bs=1M,depth=4 -m 100M
252*a9934668SKenneth D. Merry.Pp
253*a9934668SKenneth D. MerryRead 1MB blocks of zeros from /dev/zero, and write them to da5 with a
254*a9934668SKenneth D. Merrydesired queue depth of 4.
255*a9934668SKenneth D. MerryStop the transfer after 100MB has been written.
256*a9934668SKenneth D. Merry.Pp
257*a9934668SKenneth D. Merry.Dl camdd -i pass=da8,bs=1M,depth=3 -o file=disk.img
258*a9934668SKenneth D. Merry.Pp
259*a9934668SKenneth D. MerryCopy disk da8 using a 1MB blocksize and desired queue depth of 3 to the
260*a9934668SKenneth D. Merryfile disk.img.
261*a9934668SKenneth D. Merry.Pp
262*a9934668SKenneth D. Merry.Dl camdd -i file=/etc/rc -o file=-
263*a9934668SKenneth D. Merry.Pp
264*a9934668SKenneth D. MerryRead the file /etc/rc and write it to standard output.
265*a9934668SKenneth D. Merry.Pp
266*a9934668SKenneth D. Merry.Dl camdd -i pass=da10,bs=64k,depth=16 -o file=/dev/nsa0,bs=128k
267*a9934668SKenneth D. Merry.Pp
268*a9934668SKenneth D. MerryCopy 64K blocks from the disk da10 with a queue depth of 16, and write
269*a9934668SKenneth D. Merryto the tape drive sa0 with a 128k blocksize.
270*a9934668SKenneth D. MerryThe copy will stop when either the end of the disk or tape is reached.
271*a9934668SKenneth D. Merry.Sh SEE ALSO
272*a9934668SKenneth D. Merry.Xr cam 3 ,
273*a9934668SKenneth D. Merry.Xr cam 4 ,
274*a9934668SKenneth D. Merry.Xr pass 4 ,
275*a9934668SKenneth D. Merry.Xr camcontrol 8
276*a9934668SKenneth D. Merry.Sh HISTORY
277*a9934668SKenneth D. Merry.Nm
278*a9934668SKenneth D. Merryfirst appeared in
279*a9934668SKenneth D. Merry.Fx 10.2
280*a9934668SKenneth D. Merry.Sh AUTHORS
281*a9934668SKenneth D. Merry.An Kenneth Merry Aq Mt ken@FreeBSD.org
282