xref: /freebsd/sbin/camcontrol/camcontrol.8 (revision d68fae58493be0fd1b4fc8aa0d18308209bdb29a)
1525689f1SJustin T. Gibbs.\"
2f553b7b3SKenneth D. Merry.\" Copyright (c) 1998, 1999, 2000, 2002, 2005, 2006, 2007 Kenneth D. Merry.
3525689f1SJustin T. Gibbs.\" All rights reserved.
4525689f1SJustin T. Gibbs.\"
5525689f1SJustin T. Gibbs.\" Redistribution and use in source and binary forms, with or without
6525689f1SJustin T. Gibbs.\" modification, are permitted provided that the following conditions
7525689f1SJustin T. Gibbs.\" are met:
8525689f1SJustin T. Gibbs.\" 1. Redistributions of source code must retain the above copyright
9525689f1SJustin T. Gibbs.\"    notice, this list of conditions and the following disclaimer.
10525689f1SJustin T. Gibbs.\" 2. Redistributions in binary form must reproduce the above copyright
11525689f1SJustin T. Gibbs.\"    notice, this list of conditions and the following disclaimer in the
12525689f1SJustin T. Gibbs.\"    documentation and/or other materials provided with the distribution.
13525689f1SJustin T. Gibbs.\" 3. The name of the author may not be used to endorse or promote products
14525689f1SJustin T. Gibbs.\"    derived from this software without specific prior written permission.
15525689f1SJustin T. Gibbs.\"
16525689f1SJustin T. Gibbs.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17525689f1SJustin T. Gibbs.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18525689f1SJustin T. Gibbs.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19525689f1SJustin T. Gibbs.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20525689f1SJustin T. Gibbs.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21525689f1SJustin T. Gibbs.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22525689f1SJustin T. Gibbs.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23525689f1SJustin T. Gibbs.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24525689f1SJustin T. Gibbs.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25525689f1SJustin T. Gibbs.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26525689f1SJustin T. Gibbs.\" SUCH DAMAGE.
27525689f1SJustin T. Gibbs.\"
287f3dea24SPeter Wemm.\" $FreeBSD$
29525689f1SJustin T. Gibbs.\"
30*d68fae58SEdward Tomasz Napierala.Dd April 26, 2016
31525689f1SJustin T. Gibbs.Dt CAMCONTROL 8
3233fab22eSKenneth D. Merry.Os
33525689f1SJustin T. Gibbs.Sh NAME
34525689f1SJustin T. Gibbs.Nm camcontrol
35525689f1SJustin T. Gibbs.Nd CAM control program
36525689f1SJustin T. Gibbs.Sh SYNOPSIS
377c7fb079SRuslan Ermilov.Nm
3833fab22eSKenneth D. Merry.Aq Ar command
39c60e19a8SKenneth D. Merry.Op device id
40525689f1SJustin T. Gibbs.Op generic args
41525689f1SJustin T. Gibbs.Op command args
427c7fb079SRuslan Ermilov.Nm
4333fab22eSKenneth D. Merry.Ic devlist
4456dc4e72SScott Long.Op Fl b
45525689f1SJustin T. Gibbs.Op Fl v
467c7fb079SRuslan Ermilov.Nm
4733fab22eSKenneth D. Merry.Ic periphlist
48c60e19a8SKenneth D. Merry.Op device id
49525689f1SJustin T. Gibbs.Op Fl n Ar dev_name
50525689f1SJustin T. Gibbs.Op Fl u Ar unit_number
517c7fb079SRuslan Ermilov.Nm
5233fab22eSKenneth D. Merry.Ic tur
53c60e19a8SKenneth D. Merry.Op device id
54525689f1SJustin T. Gibbs.Op generic args
557c7fb079SRuslan Ermilov.Nm
5633fab22eSKenneth D. Merry.Ic inquiry
57c60e19a8SKenneth D. Merry.Op device id
58525689f1SJustin T. Gibbs.Op generic args
59525689f1SJustin T. Gibbs.Op Fl D
60525689f1SJustin T. Gibbs.Op Fl S
61525689f1SJustin T. Gibbs.Op Fl R
627c7fb079SRuslan Ermilov.Nm
6352c9ce25SScott Long.Ic identify
6452c9ce25SScott Long.Op device id
6552c9ce25SScott Long.Op generic args
66757e402dSAlexander Motin.Op Fl v
6752c9ce25SScott Long.Nm
6842cb6a80SKenneth D. Merry.Ic reportluns
6942cb6a80SKenneth D. Merry.Op device id
7042cb6a80SKenneth D. Merry.Op generic args
7142cb6a80SKenneth D. Merry.Op Fl c
7242cb6a80SKenneth D. Merry.Op Fl l
7342cb6a80SKenneth D. Merry.Op Fl r Ar reporttype
7442cb6a80SKenneth D. Merry.Nm
75f553b7b3SKenneth D. Merry.Ic readcap
76f553b7b3SKenneth D. Merry.Op device id
77f553b7b3SKenneth D. Merry.Op generic args
78f553b7b3SKenneth D. Merry.Op Fl b
79f553b7b3SKenneth D. Merry.Op Fl h
80f553b7b3SKenneth D. Merry.Op Fl H
81f553b7b3SKenneth D. Merry.Op Fl N
82f553b7b3SKenneth D. Merry.Op Fl q
83f553b7b3SKenneth D. Merry.Op Fl s
84f553b7b3SKenneth D. Merry.Nm
8533fab22eSKenneth D. Merry.Ic start
86c60e19a8SKenneth D. Merry.Op device id
87525689f1SJustin T. Gibbs.Op generic args
887c7fb079SRuslan Ermilov.Nm
8933fab22eSKenneth D. Merry.Ic stop
90c60e19a8SKenneth D. Merry.Op device id
91525689f1SJustin T. Gibbs.Op generic args
927c7fb079SRuslan Ermilov.Nm
93f9cecca2SMatthew N. Dodd.Ic load
94f9cecca2SMatthew N. Dodd.Op device id
95f9cecca2SMatthew N. Dodd.Op generic args
96f9cecca2SMatthew N. Dodd.Nm
9733fab22eSKenneth D. Merry.Ic eject
98c60e19a8SKenneth D. Merry.Op device id
99525689f1SJustin T. Gibbs.Op generic args
1007c7fb079SRuslan Ermilov.Nm
101*d68fae58SEdward Tomasz Napierala.Ic reprobe
102*d68fae58SEdward Tomasz Napierala.Op device id
103*d68fae58SEdward Tomasz Napierala.Nm
10433fab22eSKenneth D. Merry.Ic rescan
1055710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun
1067c7fb079SRuslan Ermilov.Nm
10733fab22eSKenneth D. Merry.Ic reset
1085710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun
1097c7fb079SRuslan Ermilov.Nm
11033fab22eSKenneth D. Merry.Ic defects
111c60e19a8SKenneth D. Merry.Op device id
112525689f1SJustin T. Gibbs.Op generic args
113525689f1SJustin T. Gibbs.Aq Fl f Ar format
114525689f1SJustin T. Gibbs.Op Fl P
115525689f1SJustin T. Gibbs.Op Fl G
116a1736be3SKenneth D. Merry.Op Fl q
117a1736be3SKenneth D. Merry.Op Fl s
118a1736be3SKenneth D. Merry.Op Fl S Ar offset
119a1736be3SKenneth D. Merry.Op Fl X
1207c7fb079SRuslan Ermilov.Nm
12133fab22eSKenneth D. Merry.Ic modepage
122c60e19a8SKenneth D. Merry.Op device id
123525689f1SJustin T. Gibbs.Op generic args
1249916c5d2SRuslan Ermilov.Aq Fl m Ar page | Fl l
1251ac2383cSBill Fumerola.Op Fl P Ar pgctl
1267e32b20dSKelly Yancey.Op Fl b | Fl e
127525689f1SJustin T. Gibbs.Op Fl d
1287c7fb079SRuslan Ermilov.Nm
12933fab22eSKenneth D. Merry.Ic cmd
130c60e19a8SKenneth D. Merry.Op device id
131525689f1SJustin T. Gibbs.Op generic args
13280976615SAlexander Motin.Aq Fl a Ar cmd Op args
133525689f1SJustin T. Gibbs.Aq Fl c Ar cmd Op args
134f930c0dbSAlexander Motin.Op Fl d
135f930c0dbSAlexander Motin.Op Fl f
136525689f1SJustin T. Gibbs.Op Fl i Ar len Ar fmt
137525689f1SJustin T. Gibbs.Bk -words
138525689f1SJustin T. Gibbs.Op Fl o Ar len Ar fmt Op args
13980976615SAlexander Motin.Op Fl r Ar fmt
140525689f1SJustin T. Gibbs.Ek
1417c7fb079SRuslan Ermilov.Nm
14206e79492SKenneth D. Merry.Ic smpcmd
14306e79492SKenneth D. Merry.Op device id
14406e79492SKenneth D. Merry.Op generic args
14506e79492SKenneth D. Merry.Aq Fl r Ar len Ar fmt Op args
14606e79492SKenneth D. Merry.Aq Fl R Ar len Ar fmt Op args
14706e79492SKenneth D. Merry.Nm
14806e79492SKenneth D. Merry.Ic smprg
14906e79492SKenneth D. Merry.Op device id
15006e79492SKenneth D. Merry.Op generic args
15106e79492SKenneth D. Merry.Op Fl l
15206e79492SKenneth D. Merry.Nm
15306e79492SKenneth D. Merry.Ic smppc
15406e79492SKenneth D. Merry.Op device id
15506e79492SKenneth D. Merry.Op generic args
15606e79492SKenneth D. Merry.Aq Fl p Ar phy
15706e79492SKenneth D. Merry.Op Fl l
15806e79492SKenneth D. Merry.Op Fl o Ar operation
15906e79492SKenneth D. Merry.Op Fl d Ar name
16006e79492SKenneth D. Merry.Op Fl m Ar rate
16106e79492SKenneth D. Merry.Op Fl M Ar rate
16206e79492SKenneth D. Merry.Op Fl T Ar pp_timeout
16306e79492SKenneth D. Merry.Op Fl a Ar enable|disable
16406e79492SKenneth D. Merry.Op Fl A Ar enable|disable
16506e79492SKenneth D. Merry.Op Fl s Ar enable|disable
16606e79492SKenneth D. Merry.Op Fl S Ar enable|disable
16706e79492SKenneth D. Merry.Nm
16806e79492SKenneth D. Merry.Ic smpphylist
16906e79492SKenneth D. Merry.Op device id
17006e79492SKenneth D. Merry.Op generic args
17106e79492SKenneth D. Merry.Op Fl l
17206e79492SKenneth D. Merry.Op Fl q
17306e79492SKenneth D. Merry.Nm
17406e79492SKenneth D. Merry.Ic smpmaninfo
17506e79492SKenneth D. Merry.Op device id
17606e79492SKenneth D. Merry.Op generic args
17706e79492SKenneth D. Merry.Op Fl l
17806e79492SKenneth D. Merry.Nm
17933fab22eSKenneth D. Merry.Ic debug
180525689f1SJustin T. Gibbs.Op Fl I
181a7e5261eSNate Lawson.Op Fl P
182525689f1SJustin T. Gibbs.Op Fl T
183525689f1SJustin T. Gibbs.Op Fl S
184a7e5261eSNate Lawson.Op Fl X
18594d09127SKenneth D. Merry.Op Fl c
186fbfb753fSAlexander Motin.Op Fl p
187525689f1SJustin T. Gibbs.Aq all|off|bus Ns Op :target Ns Op :lun
1887c7fb079SRuslan Ermilov.Nm
18933fab22eSKenneth D. Merry.Ic tags
190c60e19a8SKenneth D. Merry.Op device id
1919deea857SKenneth D. Merry.Op generic args
1929deea857SKenneth D. Merry.Op Fl N Ar tags
1939deea857SKenneth D. Merry.Op Fl q
1949deea857SKenneth D. Merry.Op Fl v
1957c7fb079SRuslan Ermilov.Nm
19633fab22eSKenneth D. Merry.Ic negotiate
197c60e19a8SKenneth D. Merry.Op device id
1989deea857SKenneth D. Merry.Op generic args
1999deea857SKenneth D. Merry.Op Fl c
2009deea857SKenneth D. Merry.Op Fl D Ar enable|disable
201b447e682SAlexander Motin.Op Fl M Ar mode
2029deea857SKenneth D. Merry.Op Fl O Ar offset
2039deea857SKenneth D. Merry.Op Fl q
2049deea857SKenneth D. Merry.Op Fl R Ar syncrate
2059deea857SKenneth D. Merry.Op Fl T Ar enable|disable
2069deea857SKenneth D. Merry.Op Fl U
2079deea857SKenneth D. Merry.Op Fl W Ar bus_width
2089deea857SKenneth D. Merry.Op Fl v
2097c7fb079SRuslan Ermilov.Nm
21033fab22eSKenneth D. Merry.Ic format
21196a93c63SKenneth D. Merry.Op device id
21296a93c63SKenneth D. Merry.Op generic args
21396a93c63SKenneth D. Merry.Op Fl q
214e9e4d3e4SKenneth D. Merry.Op Fl r
21596a93c63SKenneth D. Merry.Op Fl w
21696a93c63SKenneth D. Merry.Op Fl y
2177c7fb079SRuslan Ermilov.Nm
218ffead710SBryan Venteicher.Ic sanitize
219ffead710SBryan Venteicher.Op device id
220ffead710SBryan Venteicher.Op generic args
221ffead710SBryan Venteicher.Aq Fl a Ar overwrite | block | crypto | exitfailure
222ffead710SBryan Venteicher.Op Fl c Ar passes
223ffead710SBryan Venteicher.Op Fl I
224ffead710SBryan Venteicher.Op Fl P Ar pattern
225ffead710SBryan Venteicher.Op Fl q
226ffead710SBryan Venteicher.Op Fl U
227ffead710SBryan Venteicher.Op Fl r
228ffead710SBryan Venteicher.Op Fl w
229ffead710SBryan Venteicher.Op Fl y
230ffead710SBryan Venteicher.Nm
23150c9a276SAlexander Motin.Ic idle
23250c9a276SAlexander Motin.Op device id
23350c9a276SAlexander Motin.Op generic args
23450c9a276SAlexander Motin.Op Fl t Ar time
23550c9a276SAlexander Motin.Nm
23650c9a276SAlexander Motin.Ic standby
23750c9a276SAlexander Motin.Op device id
23850c9a276SAlexander Motin.Op generic args
23950c9a276SAlexander Motin.Op Fl t Ar time
24050c9a276SAlexander Motin.Nm
24150c9a276SAlexander Motin.Ic sleep
24250c9a276SAlexander Motin.Op device id
24350c9a276SAlexander Motin.Op generic args
24450c9a276SAlexander Motin.Nm
245e7affda5SAlexander Motin.Ic apm
246e7affda5SAlexander Motin.Op device id
247e7affda5SAlexander Motin.Op generic args
248e7affda5SAlexander Motin.Op Fl l Ar level
249e7affda5SAlexander Motin.Nm
250e7affda5SAlexander Motin.Ic aam
251e7affda5SAlexander Motin.Op device id
252e7affda5SAlexander Motin.Op generic args
253e7affda5SAlexander Motin.Op Fl l Ar level
254e7affda5SAlexander Motin.Nm
2551f4782a4SEd Maste.Ic fwdownload
2561f4782a4SEd Maste.Op device id
2571f4782a4SEd Maste.Op generic args
2581f4782a4SEd Maste.Aq Fl f Ar fw_image
2590e358df0SKenneth D. Merry.Op Fl q
2601f4782a4SEd Maste.Op Fl s
2610e358df0SKenneth D. Merry.Op Fl y
2621f4782a4SEd Maste.Nm
2631146874aSSteven Hartland.Ic security
2641146874aSSteven Hartland.Op device id
2651146874aSSteven Hartland.Op generic args
2661146874aSSteven Hartland.Op Fl d Ar pwd
2671146874aSSteven Hartland.Op Fl e Ar pwd
2681146874aSSteven Hartland.Op Fl f
2691146874aSSteven Hartland.Op Fl h Ar pwd
2701146874aSSteven Hartland.Op Fl k Ar pwd
2711146874aSSteven Hartland.Op Fl l Ar high|maximum
2721146874aSSteven Hartland.Op Fl q
2731146874aSSteven Hartland.Op Fl s Ar pwd
2741146874aSSteven Hartland.Op Fl T Ar timeout
2751146874aSSteven Hartland.Op Fl U Ar user|master
2761146874aSSteven Hartland.Op Fl y
2771146874aSSteven Hartland.Nm
2789e68761cSSteven Hartland.Ic hpa
2799e68761cSSteven Hartland.Op device id
2809e68761cSSteven Hartland.Op generic args
2819e68761cSSteven Hartland.Op Fl f
2829e68761cSSteven Hartland.Op Fl l
2839e68761cSSteven Hartland.Op Fl P
2849e68761cSSteven Hartland.Op Fl p Ar pwd
2859e68761cSSteven Hartland.Op Fl q
2869e68761cSSteven Hartland.Op Fl s Ar max_sectors
2879e68761cSSteven Hartland.Op Fl U Ar pwd
2889e68761cSSteven Hartland.Op Fl y
2899e68761cSSteven Hartland.Nm
29008df2e3eSKenneth D. Merry.Ic persist
29108df2e3eSKenneth D. Merry.Op device id
29208df2e3eSKenneth D. Merry.Op generic args
29308df2e3eSKenneth D. Merry.Aq Fl i Ar action | Fl o Ar action
29408df2e3eSKenneth D. Merry.Op Fl a
29508df2e3eSKenneth D. Merry.Op Fl I Ar trans_id
29608df2e3eSKenneth D. Merry.Op Fl k Ar key
29708df2e3eSKenneth D. Merry.Op Fl K Ar sa_key
29808df2e3eSKenneth D. Merry.Op Fl p
29908df2e3eSKenneth D. Merry.Op Fl R Ar rel_tgt_port
30008df2e3eSKenneth D. Merry.Op Fl s Ar scope
30108df2e3eSKenneth D. Merry.Op Fl S
30208df2e3eSKenneth D. Merry.Op Fl T Ar res_type
30308df2e3eSKenneth D. Merry.Op Fl U
30408df2e3eSKenneth D. Merry.Nm
3055672fac9SKenneth D. Merry.Ic attrib
3065672fac9SKenneth D. Merry.Op device id
3075672fac9SKenneth D. Merry.Op generic args
3085672fac9SKenneth D. Merry.Aq Fl r Ar action | Fl w Ar attrib
3095672fac9SKenneth D. Merry.Op Fl a Ar attr_num
3105672fac9SKenneth D. Merry.Op Fl c
3115672fac9SKenneth D. Merry.Op Fl e Ar elem_addr
3125672fac9SKenneth D. Merry.Op Fl F Ar form1,form2
3135672fac9SKenneth D. Merry.Op Fl p Ar part
3145672fac9SKenneth D. Merry.Op Fl s Ar start_addr
3155672fac9SKenneth D. Merry.Op Fl T Ar elem_type
3165672fac9SKenneth D. Merry.Op Fl V Ar lv_num
3175672fac9SKenneth D. Merry.Nm
3180e358df0SKenneth D. Merry.Ic opcodes
3190e358df0SKenneth D. Merry.Op device id
3200e358df0SKenneth D. Merry.Op generic args
3210e358df0SKenneth D. Merry.Op Fl o Ar opcode
3220e358df0SKenneth D. Merry.Op Fl s Ar service_action
3230e358df0SKenneth D. Merry.Op Fl N
3240e358df0SKenneth D. Merry.Op Fl T
3250e358df0SKenneth D. Merry.Nm
32633fab22eSKenneth D. Merry.Ic help
327525689f1SJustin T. Gibbs.Sh DESCRIPTION
328e1205e80SPhilippe CharnierThe
3297c7fb079SRuslan Ermilov.Nm
330e1205e80SPhilippe Charnierutility is designed to provide a way for users to access and control the
33133fab22eSKenneth D. Merry.Fx
332525689f1SJustin T. GibbsCAM subsystem.
333525689f1SJustin T. Gibbs.Pp
334e1205e80SPhilippe CharnierThe
3357c7fb079SRuslan Ermilov.Nm
336e1205e80SPhilippe Charnierutility
3379806e231SRuslan Ermilovcan cause a loss of data and/or system crashes if used improperly.
3389806e231SRuslan ErmilovEven
3399deea857SKenneth D. Merryexpert users are encouraged to exercise caution when using this command.
340525689f1SJustin T. GibbsNovice users should stay away from this utility.
341525689f1SJustin T. Gibbs.Pp
342e1205e80SPhilippe CharnierThe
3437c7fb079SRuslan Ermilov.Nm
344e1205e80SPhilippe Charnierutility has a number of primary functions, many of which support an optional
3459806e231SRuslan Ermilovdevice identifier.
3469806e231SRuslan ErmilovA device identifier can take one of three forms:
3471252c1bbSRuslan Ermilov.Bl -tag -width 14n
348c60e19a8SKenneth D. Merry.It deviceUNIT
349c60e19a8SKenneth D. MerrySpecify a device name and unit number combination, like "da5" or "cd3".
350c60e19a8SKenneth D. Merry.It bus:target
3519806e231SRuslan ErmilovSpecify a bus number and target id.
3529806e231SRuslan ErmilovThe bus number can be determined from
353c60e19a8SKenneth D. Merrythe output of
354c60e19a8SKenneth D. Merry.Dq camcontrol devlist .
355c60e19a8SKenneth D. MerryThe lun defaults to 0.
356c60e19a8SKenneth D. Merry.It bus:target:lun
3579806e231SRuslan ErmilovSpecify the bus, target and lun for a device.
3589806e231SRuslan Ermilov(e.g.\& 1:2:0)
359c60e19a8SKenneth D. Merry.El
360c60e19a8SKenneth D. Merry.Pp
361c60e19a8SKenneth D. MerryThe device identifier, if it is specified,
362c60e19a8SKenneth D. Merry.Em must
363c60e19a8SKenneth D. Merrycome immediately after the function name, and before any generic or
3649806e231SRuslan Ermilovfunction-specific arguments.
3659806e231SRuslan ErmilovNote that the
366c60e19a8SKenneth D. Merry.Fl n
367c60e19a8SKenneth D. Merryand
368c60e19a8SKenneth D. Merry.Fl u
369c60e19a8SKenneth D. Merryarguments described below will override any device name or unit number
3709806e231SRuslan Ermilovspecified beforehand.
3719806e231SRuslan ErmilovThe
372c60e19a8SKenneth D. Merry.Fl n
373c60e19a8SKenneth D. Merryand
374c60e19a8SKenneth D. Merry.Fl u
375c60e19a8SKenneth D. Merryarguments will
376c60e19a8SKenneth D. Merry.Em not
37796a93c63SKenneth D. Merryoverride a specified bus:target or bus:target:lun, however.
378c60e19a8SKenneth D. Merry.Pp
379c60e19a8SKenneth D. MerryMost of the
3807c7fb079SRuslan Ermilov.Nm
381c60e19a8SKenneth D. Merryprimary functions support these generic arguments:
3821252c1bbSRuslan Ermilov.Bl -tag -width 14n
383525689f1SJustin T. Gibbs.It Fl C Ar count
3849806e231SRuslan ErmilovSCSI command retry count.
3859806e231SRuslan ErmilovIn order for this to work, error recovery
3861252c1bbSRuslan Ermilov.Pq Fl E
387525689f1SJustin T. Gibbsmust be turned on.
388525689f1SJustin T. Gibbs.It Fl E
389525689f1SJustin T. GibbsInstruct the kernel to perform generic SCSI error recovery for the given
3909806e231SRuslan Ermilovcommand.
3919806e231SRuslan ErmilovThis is needed in order for the retry count
3921252c1bbSRuslan Ermilov.Pq Fl C
3939806e231SRuslan Ermilovto be honored.
3949806e231SRuslan ErmilovOther than retrying commands, the generic error recovery in
395525689f1SJustin T. Gibbsthe code will generally attempt to spin up drives that are not spinning.
396525689f1SJustin T. GibbsIt may take some other actions, depending upon the sense code returned from
397525689f1SJustin T. Gibbsthe command.
398525689f1SJustin T. Gibbs.It Fl n Ar dev_name
3999806e231SRuslan ErmilovSpecify the device type to operate on, e.g.\& "da", "cd".
400525689f1SJustin T. Gibbs.It Fl t Ar timeout
4019806e231SRuslan ErmilovSCSI command timeout in seconds.
4029806e231SRuslan ErmilovThis overrides the default timeout for
403525689f1SJustin T. Gibbsany given command.
404525689f1SJustin T. Gibbs.It Fl u Ar unit_number
4059806e231SRuslan ErmilovSpecify the device unit number, e.g.\& "1", "5".
406525689f1SJustin T. Gibbs.It Fl v
407525689f1SJustin T. GibbsBe verbose, print out sense information for failed SCSI commands.
408525689f1SJustin T. Gibbs.El
409525689f1SJustin T. Gibbs.Pp
410d13d1cd2SKenneth D. MerryPrimary command functions:
411525689f1SJustin T. Gibbs.Bl -tag -width periphlist
41233fab22eSKenneth D. Merry.It Ic devlist
413525689f1SJustin T. GibbsList all physical devices (logical units) attached to the CAM subsystem.
414525689f1SJustin T. GibbsThis also includes a list of peripheral drivers attached to each device.
415525689f1SJustin T. GibbsWith the
416525689f1SJustin T. Gibbs.Fl v
417525689f1SJustin T. Gibbsargument, SCSI bus number, adapter name and unit numbers are printed as
418525689f1SJustin T. Gibbswell.
41956dc4e72SScott LongOn the other hand, with the
42056dc4e72SScott Long.Fl b
42156dc4e72SScott Longargument, only the bus adapter, and unit information will be printed, and
42256dc4e72SScott Longdevice information will be omitted.
42333fab22eSKenneth D. Merry.It Ic periphlist
424525689f1SJustin T. GibbsList all peripheral drivers attached to a given physical device (logical
425525689f1SJustin T. Gibbsunit).
42633fab22eSKenneth D. Merry.It Ic tur
427525689f1SJustin T. GibbsSend the SCSI test unit ready (0x00) command to the given device.
428e1205e80SPhilippe CharnierThe
4297c7fb079SRuslan Ermilov.Nm
430e1205e80SPhilippe Charnierutility will report whether the device is ready or not.
43133fab22eSKenneth D. Merry.It Ic inquiry
4329806e231SRuslan ErmilovSend a SCSI inquiry command (0x12) to a device.
4339806e231SRuslan ErmilovBy default,
4347c7fb079SRuslan Ermilov.Nm
435525689f1SJustin T. Gibbswill print out the standard inquiry data, device serial number, and
4369806e231SRuslan Ermilovtransfer rate information.
4379806e231SRuslan ErmilovThe user can specify that only certain types of
438525689f1SJustin T. Gibbsinquiry data be printed:
4391252c1bbSRuslan Ermilov.Bl -tag -width 4n
440525689f1SJustin T. Gibbs.It Fl D
441525689f1SJustin T. GibbsGet the standard inquiry data.
442525689f1SJustin T. Gibbs.It Fl S
4439806e231SRuslan ErmilovPrint out the serial number.
4449806e231SRuslan ErmilovIf this flag is the only one specified,
4457c7fb079SRuslan Ermilov.Nm
446525689f1SJustin T. Gibbswill not print out "Serial Number" before the value returned by the drive.
447525689f1SJustin T. GibbsThis is to aid in script writing.
448525689f1SJustin T. Gibbs.It Fl R
449525689f1SJustin T. GibbsPrint out transfer rate information.
450525689f1SJustin T. Gibbs.El
45152c9ce25SScott Long.It Ic identify
45252c9ce25SScott LongSend a ATA identify command (0xec) to a device.
45342cb6a80SKenneth D. Merry.It Ic reportluns
45442cb6a80SKenneth D. MerrySend the SCSI REPORT LUNS (0xA0) command to the given device.
45542cb6a80SKenneth D. MerryBy default,
45642cb6a80SKenneth D. Merry.Nm
45742cb6a80SKenneth D. Merrywill print out the list of logical units (LUNs) supported by the target device.
45842cb6a80SKenneth D. MerryThere are a couple of options to modify the output:
4598266d476SRuslan Ermilov.Bl -tag -width 14n
46042cb6a80SKenneth D. Merry.It Fl c
46142cb6a80SKenneth D. MerryJust print out a count of LUNs, not the actual LUN numbers.
46242cb6a80SKenneth D. Merry.It Fl l
463b1edef17SJoel DahlJust print out the LUNs, and do not print out the count.
46442cb6a80SKenneth D. Merry.It Fl r Ar reporttype
46542cb6a80SKenneth D. MerrySpecify the type of report to request from the target:
46642cb6a80SKenneth D. Merry.Bl -tag -width 012345678
46742cb6a80SKenneth D. Merry.It default
46842cb6a80SKenneth D. MerryReturn the default report.
46942cb6a80SKenneth D. MerryThis is the
47042cb6a80SKenneth D. Merry.Nm
47142cb6a80SKenneth D. Merrydefault.
47242cb6a80SKenneth D. MerryMost targets will support this report if they support the REPORT LUNS
47342cb6a80SKenneth D. Merrycommand.
47442cb6a80SKenneth D. Merry.It wellknown
47542cb6a80SKenneth D. MerryReturn only well known LUNs.
47642cb6a80SKenneth D. Merry.It all
47742cb6a80SKenneth D. MerryReturn all available LUNs.
47842cb6a80SKenneth D. Merry.El
47942cb6a80SKenneth D. Merry.El
48042cb6a80SKenneth D. Merry.Pp
48142cb6a80SKenneth D. Merry.Nm
48242cb6a80SKenneth D. Merrywill try to print out LUN numbers in a reasonable format.
48342cb6a80SKenneth D. MerryIt can understand the peripheral, flat, LUN and extended LUN formats.
484f553b7b3SKenneth D. Merry.It Ic readcap
485f553b7b3SKenneth D. MerrySend the SCSI READ CAPACITY command to the given device and display
486f553b7b3SKenneth D. Merrythe results.
487f553b7b3SKenneth D. MerryIf the device is larger than 2TB, the SCSI READ CAPACITY (16) service
488f553b7b3SKenneth D. Merryaction will be sent to obtain the full size of the device.
489f553b7b3SKenneth D. MerryBy default,
490f553b7b3SKenneth D. Merry.Nm
491f553b7b3SKenneth D. Merrywill print out the last logical block of the device, and the blocksize of
492f553b7b3SKenneth D. Merrythe device in bytes.
493f553b7b3SKenneth D. MerryTo modify the output format, use the following options:
494f553b7b3SKenneth D. Merry.Bl -tag -width 5n
495f553b7b3SKenneth D. Merry.It Fl b
496f553b7b3SKenneth D. MerryJust print out the blocksize, not the last block or device size.
497f553b7b3SKenneth D. MerryThis cannot be used with
498f553b7b3SKenneth D. Merry.Fl N
499f553b7b3SKenneth D. Merryor
500f553b7b3SKenneth D. Merry.Fl s .
501f553b7b3SKenneth D. Merry.It Fl h
502f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 2, 1K == 1024) format.
503f553b7b3SKenneth D. MerryThis implies
504f553b7b3SKenneth D. Merry.Fl N
505f553b7b3SKenneth D. Merryand cannot be used with
506f553b7b3SKenneth D. Merry.Fl q
507f553b7b3SKenneth D. Merryor
508f553b7b3SKenneth D. Merry.Fl b .
509f553b7b3SKenneth D. Merry.It Fl H
510f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 10, 1K == 1000) format.
511f553b7b3SKenneth D. Merry.It Fl N
512f553b7b3SKenneth D. MerryPrint out the number of blocks in the device instead of the last logical
513f553b7b3SKenneth D. Merryblock.
514f553b7b3SKenneth D. Merry.It Fl q
515f553b7b3SKenneth D. MerryQuiet, print out the numbers only (separated by a comma if
516f553b7b3SKenneth D. Merry.Fl b
517f553b7b3SKenneth D. Merryor
518f553b7b3SKenneth D. Merry.Fl s
519f553b7b3SKenneth D. Merryare not specified).
520f553b7b3SKenneth D. Merry.It Fl s
521f553b7b3SKenneth D. MerryPrint out the last logical block or the size of the device only, and omit
522f553b7b3SKenneth D. Merrythe blocksize.
523f553b7b3SKenneth D. Merry.El
524*d68fae58SEdward Tomasz Napierala.Pp
525*d68fae58SEdward Tomasz NapieralaNote that this command only displays the information, it does not update
526*d68fae58SEdward Tomasz Napieralathe kernel data structures.
527*d68fae58SEdward Tomasz NapieralaUse the
528*d68fae58SEdward Tomasz Napierala.Nm
529*d68fae58SEdward Tomasz Napieralareprobe subcommand to do that.
53033fab22eSKenneth D. Merry.It Ic start
531525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the
532525689f1SJustin T. Gibbsstart bit set.
53333fab22eSKenneth D. Merry.It Ic stop
534525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the
535525689f1SJustin T. Gibbsstart bit cleared.
536f9cecca2SMatthew N. Dodd.It Ic load
537f9cecca2SMatthew N. DoddSend the SCSI Start/Stop Unit (0x1B) command to the given device with the
538f9cecca2SMatthew N. Doddstart bit set and the load/eject bit set.
53933fab22eSKenneth D. Merry.It Ic eject
540525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the
541f9cecca2SMatthew N. Doddstart bit cleared and the load/eject bit set.
54233fab22eSKenneth D. Merry.It Ic rescan
5435710d224SKenneth D. MerryTell the kernel to scan all busses in the system (with the
5445710d224SKenneth D. Merry.Ar all
5455710d224SKenneth D. Merryargument), the given bus (XPT_SCAN_BUS), or bus:target:lun
5469806e231SRuslan Ermilov(XPT_SCAN_LUN) for new devices or devices that have gone away.
5479806e231SRuslan ErmilovThe user
5489806e231SRuslan Ermilovmay specify a scan of all busses, a single bus, or a lun.
5499806e231SRuslan ErmilovScanning all luns
5500227791bSRuslan Ermilovon a target is not supported.
551*d68fae58SEdward Tomasz Napierala.It Ic reprobe
552*d68fae58SEdward Tomasz NapieralaTell the kernel to refresh the information about the device and
553*d68fae58SEdward Tomasz Napieralanotify the upper layer,
554*d68fae58SEdward Tomasz Napierala.Xr GEOM 4 .
555*d68fae58SEdward Tomasz NapieralaThis includes sending the SCSI READ CAPACITY command and updating
556*d68fae58SEdward Tomasz Napieralathe disk size visible to the rest of the system.
55733fab22eSKenneth D. Merry.It Ic reset
5585710d224SKenneth D. MerryTell the kernel to reset all busses in the system (with the
5595710d224SKenneth D. Merry.Ar all
5605710d224SKenneth D. Merryargument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
561a2a44836SMatt Jacobreset for that bus, or to reset the given bus:target:lun
562a2a44836SMatt Jacob(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
563ef8f7ac9SSheldon Hearnconnecting to that device.
564ef8f7ac9SSheldon HearnNote that this can have a destructive impact
565a2a44836SMatt Jacobon the system.
56633fab22eSKenneth D. Merry.It Ic defects
567a1736be3SKenneth D. MerrySend the
568a1736be3SKenneth D. Merry.Tn SCSI
569a1736be3SKenneth D. MerryREAD DEFECT DATA (10) command (0x37) or the
570a1736be3SKenneth D. Merry.Tn SCSI
571a1736be3SKenneth D. MerryREAD DEFECT DATA (12) command (0xB7) to the given device, and
572525689f1SJustin T. Gibbsprint out any combination of: the total number of defects, the primary
573525689f1SJustin T. Gibbsdefect list (PLIST), and the grown defect list (GLIST).
5741252c1bbSRuslan Ermilov.Bl -tag -width 11n
575525689f1SJustin T. Gibbs.It Fl f Ar format
576a1736be3SKenneth D. MerrySpecify the requested format of the defect list.
5779806e231SRuslan ErmilovThe format argument is
5789806e231SRuslan Ermilovrequired.
5799806e231SRuslan ErmilovMost drives support the physical sector format.
5809806e231SRuslan ErmilovSome drives
5819806e231SRuslan Ermilovsupport the logical block format.
5820227791bSRuslan ErmilovMany drives, if they do not support the
583525689f1SJustin T. Gibbsrequested format, return the data in an alternate format, along with sense
5840227791bSRuslan Ermilovinformation indicating that the requested data format is not supported.
585e1205e80SPhilippe CharnierThe
5867c7fb079SRuslan Ermilov.Nm
587e1205e80SPhilippe Charnierutility
588525689f1SJustin T. Gibbsattempts to detect this, and print out whatever format the drive returns.
5890227791bSRuslan ErmilovIf the drive uses a non-standard sense code to report that it does not
590525689f1SJustin T. Gibbssupport the requested format,
5917c7fb079SRuslan Ermilov.Nm
592525689f1SJustin T. Gibbswill probably see the error as a failure to complete the request.
593a1736be3SKenneth D. Merry.Pp
594a1736be3SKenneth D. MerryThe format options are:
595a1736be3SKenneth D. Merry.Bl -tag -width 9n
596a1736be3SKenneth D. Merry.It block
597a1736be3SKenneth D. MerryPrint out the list as logical blocks.
598a1736be3SKenneth D. MerryThis is limited to 32-bit block sizes, and isn't supported by many modern
599a1736be3SKenneth D. Merrydrives.
600a1736be3SKenneth D. Merry.It longblock
601a1736be3SKenneth D. MerryPrint out the list as logical blocks.
602a1736be3SKenneth D. MerryThis option uses a 64-bit block size.
603a1736be3SKenneth D. Merry.It bfi
604a1736be3SKenneth D. MerryPrint out the list in bytes from index format.
605a1736be3SKenneth D. Merry.It extbfi
606a1736be3SKenneth D. MerryPrint out the list in extended bytes from index format.
607a1736be3SKenneth D. MerryThe extended format allows for ranges of blocks to be printed.
608a1736be3SKenneth D. Merry.It phys
609a1736be3SKenneth D. MerryPrint out the list in physical sector format.
610a1736be3SKenneth D. MerryMost drives support this format.
611a1736be3SKenneth D. Merry.It extphys
612a1736be3SKenneth D. MerryPrint out the list in extended physical sector format.
613a1736be3SKenneth D. MerryThe extended format allows for ranges of blocks to be printed.
614a1736be3SKenneth D. Merry.El
615525689f1SJustin T. Gibbs.It Fl G
6169806e231SRuslan ErmilovPrint out the grown defect list.
6179806e231SRuslan ErmilovThis is a list of bad blocks that have
618525689f1SJustin T. Gibbsbeen remapped since the disk left the factory.
619525689f1SJustin T. Gibbs.It Fl P
620525689f1SJustin T. GibbsPrint out the primary defect list.
621a1736be3SKenneth D. MerryThis is the list of defects that were present in the factory.
622a1736be3SKenneth D. Merry.It Fl q
623a1736be3SKenneth D. MerryWhen printing status information with
624a1736be3SKenneth D. Merry.Fl s ,
625a1736be3SKenneth D. Merryonly print the number of defects.
626a1736be3SKenneth D. Merry.It Fl s
627a1736be3SKenneth D. MerryJust print the number of defects, not the list of defects.
628a1736be3SKenneth D. Merry.It Fl S Ar offset
629a1736be3SKenneth D. MerrySpecify the starting offset into the defect list.
630a1736be3SKenneth D. MerryThis implies using the
631a1736be3SKenneth D. Merry.Tn SCSI
632a1736be3SKenneth D. MerryREAD DEFECT DATA (12) command, as the 10 byte version of the command
633a1736be3SKenneth D. Merrydoesn't support the address descriptor index field.
634a1736be3SKenneth D. MerryNot all drives support the 12 byte command, and some drives that support
635a1736be3SKenneth D. Merrythe 12 byte command don't support the address descriptor index field.
636a1736be3SKenneth D. Merry.It Fl X
637a1736be3SKenneth D. MerryPrint out defects in hexadecimal (base 16) form instead of base 10 form.
638525689f1SJustin T. Gibbs.El
639525689f1SJustin T. Gibbs.Pp
640525689f1SJustin T. GibbsIf neither
641525689f1SJustin T. Gibbs.Fl P
642525689f1SJustin T. Gibbsnor
643525689f1SJustin T. Gibbs.Fl G
644525689f1SJustin T. Gibbsis specified,
6457c7fb079SRuslan Ermilov.Nm
646525689f1SJustin T. Gibbswill print out the number of defects given in the READ DEFECT DATA header
647525689f1SJustin T. Gibbsreturned from the drive.
6487027b9cdSKenneth D. MerrySome drives will report 0 defects if neither the primary or grown defect
6497027b9cdSKenneth D. Merrylists are requested.
65033fab22eSKenneth D. Merry.It Ic modepage
6519806e231SRuslan ErmilovAllows the user to display and optionally edit a SCSI mode page.
6529806e231SRuslan ErmilovThe mode
653525689f1SJustin T. Gibbspage formats are located in
654525689f1SJustin T. Gibbs.Pa /usr/share/misc/scsi_modes .
655525689f1SJustin T. GibbsThis can be overridden by specifying a different file in the
656525689f1SJustin T. Gibbs.Ev SCSI_MODES
65733fab22eSKenneth D. Merryenvironment variable.
65833fab22eSKenneth D. MerryThe
65933fab22eSKenneth D. Merry.Ic modepage
66033fab22eSKenneth D. Merrycommand takes several arguments:
6611252c1bbSRuslan Ermilov.Bl -tag -width 12n
6629deea857SKenneth D. Merry.It Fl d
663525689f1SJustin T. GibbsDisable block descriptors for mode sense.
6647e32b20dSKelly Yancey.It Fl b
6657e32b20dSKelly YanceyDisplays mode page data in binary format.
666525689f1SJustin T. Gibbs.It Fl e
6679806e231SRuslan ErmilovThis flag allows the user to edit values in the mode page.
6689806e231SRuslan ErmilovThe user may
6697e32b20dSKelly Yanceyeither edit mode page values with the text editor pointed to by his
6707e32b20dSKelly Yancey.Ev EDITOR
6717e32b20dSKelly Yanceyenvironment variable, or supply mode page values via standard input, using
6727e32b20dSKelly Yanceythe same format that
6737c7fb079SRuslan Ermilov.Nm
6749806e231SRuslan Ermilovuses to display mode page values.
6759806e231SRuslan ErmilovThe editor will be invoked if
6767c7fb079SRuslan Ermilov.Nm
6777e32b20dSKelly Yanceydetects that standard input is terminal.
6787e32b20dSKelly Yancey.It Fl l
6797e32b20dSKelly YanceyLists all available mode pages.
680525689f1SJustin T. Gibbs.It Fl m Ar mode_page
681525689f1SJustin T. GibbsThis specifies the number of the mode page the user would like to view
6829806e231SRuslan Ermilovand/or edit.
6839806e231SRuslan ErmilovThis argument is mandatory unless
6849402dd99SKelly Yancey.Fl l
6859402dd99SKelly Yanceyis specified.
6861ac2383cSBill Fumerola.It Fl P Ar pgctl
6879806e231SRuslan ErmilovThis allows the user to specify the page control field.
6889806e231SRuslan ErmilovPossible values are:
689525689f1SJustin T. Gibbs.Bl -tag -width xxx -compact
69046a1f3b4SKenneth D. Merry.It 0
691525689f1SJustin T. GibbsCurrent values
69246a1f3b4SKenneth D. Merry.It 1
693525689f1SJustin T. GibbsChangeable values
69446a1f3b4SKenneth D. Merry.It 2
695525689f1SJustin T. GibbsDefault values
69646a1f3b4SKenneth D. Merry.It 3
697525689f1SJustin T. GibbsSaved values
698525689f1SJustin T. Gibbs.El
699525689f1SJustin T. Gibbs.El
70033fab22eSKenneth D. Merry.It Ic cmd
70180976615SAlexander MotinAllows the user to send an arbitrary ATA or SCSI CDB to any device.
70233fab22eSKenneth D. MerryThe
70333fab22eSKenneth D. Merry.Ic cmd
704525689f1SJustin T. Gibbsfunction requires the
705525689f1SJustin T. Gibbs.Fl c
70680976615SAlexander Motinargument to specify SCSI CDB or the
70780976615SAlexander Motin.Fl a
70880976615SAlexander Motinargument to specify ATA Command Block registers values.
7099806e231SRuslan ErmilovOther arguments are optional, depending on
7109806e231SRuslan Ermilovthe command type.
7119806e231SRuslan ErmilovThe command and data specification syntax is documented
712525689f1SJustin T. Gibbsin
71396a93c63SKenneth D. Merry.Xr cam_cdbparse 3 .
714a53bb70bSJoel DahlNOTE: If the CDB specified causes data to be transferred to or from the
715525689f1SJustin T. GibbsSCSI device in question, you MUST specify either
716525689f1SJustin T. Gibbs.Fl i
717525689f1SJustin T. Gibbsor
718525689f1SJustin T. Gibbs.Fl o .
7191252c1bbSRuslan Ermilov.Bl -tag -width 17n
72080976615SAlexander Motin.It Fl a Ar cmd Op args
72180976615SAlexander MotinThis specifies the content of 12 ATA Command Block registers (command,
72280976615SAlexander Motinfeatures, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
72380976615SAlexander Motinlba_high_exp, features_exp, sector_count, sector_count_exp).
724525689f1SJustin T. Gibbs.It Fl c Ar cmd Op args
7259806e231SRuslan ErmilovThis specifies the SCSI CDB.
72680976615SAlexander MotinSCSI CDBs may be 6, 10, 12 or 16 bytes.
727f930c0dbSAlexander Motin.It Fl d
728f930c0dbSAlexander MotinSpecifies DMA protocol to be used for ATA command.
729f930c0dbSAlexander Motin.It Fl f
730f930c0dbSAlexander MotinSpecifies FPDMA (NCQ) protocol to be used for ATA command.
731525689f1SJustin T. Gibbs.It Fl i Ar len Ar fmt
732525689f1SJustin T. GibbsThis specifies the amount of data to read, and how it should be displayed.
733525689f1SJustin T. GibbsIf the format is
734525689f1SJustin T. Gibbs.Sq - ,
735525689f1SJustin T. Gibbs.Ar len
736525689f1SJustin T. Gibbsbytes of data will be read from the device and written to standard output.
737525689f1SJustin T. Gibbs.It Fl o Ar len Ar fmt Op args
738525689f1SJustin T. GibbsThis specifies the amount of data to be written to a device, and the data
7399806e231SRuslan Ermilovthat is to be written.
7409806e231SRuslan ErmilovIf the format is
741525689f1SJustin T. Gibbs.Sq - ,
742525689f1SJustin T. Gibbs.Ar len
743525689f1SJustin T. Gibbsbytes of data will be read from standard input and written to the device.
74480976615SAlexander Motin.It Fl r Ar fmt
74580976615SAlexander MotinThis specifies that 11 result ATA Command Block registers should be displayed
74680976615SAlexander Motin(status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
74780976615SAlexander Motinlba_high_exp, sector_count, sector_count_exp), and how.
74880976615SAlexander MotinIf the format is
74980976615SAlexander Motin.Sq - ,
75080976615SAlexander Motin11 result registers will be written to standard output in hex.
751525689f1SJustin T. Gibbs.El
75206e79492SKenneth D. Merry.It Ic smpcmd
75306e79492SKenneth D. MerryAllows the user to send an arbitrary Serial
75406e79492SKenneth D. MerryManagement Protocol (SMP) command to a device.
75506e79492SKenneth D. MerryThe
75606e79492SKenneth D. Merry.Ic smpcmd
75706e79492SKenneth D. Merryfunction requires the
75806e79492SKenneth D. Merry.Fl r
75906e79492SKenneth D. Merryargument to specify the SMP request to be sent, and the
76006e79492SKenneth D. Merry.Fl R
76106e79492SKenneth D. Merryargument to specify the format of the SMP response.
76206e79492SKenneth D. MerryThe syntax for the SMP request and response arguments is documented in
76306e79492SKenneth D. Merry.Xr cam_cdbparse 3 .
76406e79492SKenneth D. Merry.Pp
76506e79492SKenneth D. MerryNote that SAS adapters that support SMP passthrough (at least the currently
76606e79492SKenneth D. Merryknown adapters) do not accept CRC bytes from the user in the request and do
76706e79492SKenneth D. Merrynot pass CRC bytes back to the user in the response.
76806e79492SKenneth D. MerryTherefore users should not include the CRC bytes in the length of the
76906e79492SKenneth D. Merryrequest and not expect CRC bytes to be returned in the response.
77006e79492SKenneth D. Merry.Bl -tag -width 17n
77106e79492SKenneth D. Merry.It Fl r Ar len Ar fmt Op args
77206e79492SKenneth D. MerryThis specifies the size of the SMP request, without the CRC bytes, and the
7735bb17266SJoel DahlSMP request format.
7745bb17266SJoel DahlIf the format is
77506e79492SKenneth D. Merry.Sq - ,
77606e79492SKenneth D. Merry.Ar len
77706e79492SKenneth D. Merrybytes of data will be read from standard input and written as the SMP
77806e79492SKenneth D. Merryrequest.
77906e79492SKenneth D. Merry.It Fl R Ar len Ar fmt Op args
78006e79492SKenneth D. MerryThis specifies the size of the buffer allocated for the SMP response, and
78106e79492SKenneth D. Merrythe SMP response format.
78206e79492SKenneth D. MerryIf the format is
78306e79492SKenneth D. Merry.Sq - ,
78406e79492SKenneth D. Merry.Ar len
78506e79492SKenneth D. Merrybytes of data will be allocated for the response and the response will be
78606e79492SKenneth D. Merrywritten to standard output.
78706e79492SKenneth D. Merry.El
78806e79492SKenneth D. Merry.It Ic smprg
78906e79492SKenneth D. MerryAllows the user to send the Serial Management Protocol (SMP) Report General
79006e79492SKenneth D. Merrycommand to a device.
79106e79492SKenneth D. Merry.Nm
79206e79492SKenneth D. Merrywill display the data returned by the Report General command.
79306e79492SKenneth D. MerryIf the SMP target supports the long response format, the additional data
79406e79492SKenneth D. Merrywill be requested and displayed automatically.
79506e79492SKenneth D. Merry.Bl -tag -width 8n
79606e79492SKenneth D. Merry.It Fl l
79706e79492SKenneth D. MerryRequest the long response format only.
79806e79492SKenneth D. MerryNot all SMP targets support the long response format.
79906e79492SKenneth D. MerryThis option causes
80006e79492SKenneth D. Merry.Nm
80106e79492SKenneth D. Merryto skip sending the initial report general request without the long bit set
80206e79492SKenneth D. Merryand only issue a report general request with the long bit set.
80306e79492SKenneth D. Merry.El
80406e79492SKenneth D. Merry.It Ic smppc
80506e79492SKenneth D. MerryAllows the user to issue the Serial Management Protocol (SMP) PHY Control
80606e79492SKenneth D. Merrycommand to a device.
80706e79492SKenneth D. MerryThis function should be used with some caution, as it can render devices
80806e79492SKenneth D. Merryinaccessible, and could potentially cause data corruption as well.
80906e79492SKenneth D. MerryThe
81006e79492SKenneth D. Merry.Fl p
81106e79492SKenneth D. Merryargument is required to specify the PHY to operate on.
81206e79492SKenneth D. Merry.Bl -tag -width 17n
81306e79492SKenneth D. Merry.It Fl p Ar phy
81406e79492SKenneth D. MerrySpecify the PHY to operate on.
81506e79492SKenneth D. MerryThis argument is required.
81606e79492SKenneth D. Merry.It Fl l
81706e79492SKenneth D. MerryRequest the long request/response format.
81806e79492SKenneth D. MerryNot all SMP targets support the long response format.
81906e79492SKenneth D. MerryFor the PHY Control command, this currently only affects whether the
82006e79492SKenneth D. Merryrequest length is set to a value other than 0.
82106e79492SKenneth D. Merry.It Fl o Ar operation
82206e79492SKenneth D. MerrySpecify a PHY control operation.
82306e79492SKenneth D. MerryOnly one
82406e79492SKenneth D. Merry.Fl o
82506e79492SKenneth D. Merryoperation may be specified.
82606e79492SKenneth D. MerryThe operation may be specified numerically (in decimal, hexadecimal, or octal)
82706e79492SKenneth D. Merryor one of the following operation names may be specified:
82806e79492SKenneth D. Merry.Bl -tag -width 16n
82906e79492SKenneth D. Merry.It nop
83006e79492SKenneth D. MerryNo operation.
83106e79492SKenneth D. MerryIt is not necessary to specify this argument.
83206e79492SKenneth D. Merry.It linkreset
83306e79492SKenneth D. MerrySend the LINK RESET command to the phy.
83406e79492SKenneth D. Merry.It hardreset
83506e79492SKenneth D. MerrySend the HARD RESET command to the phy.
83606e79492SKenneth D. Merry.It disable
83706e79492SKenneth D. MerrySend the DISABLE command to the phy.
83806e79492SKenneth D. MerryNote that the LINK RESET or HARD RESET commands should re-enable the phy.
839ee5320f4SKenneth D. Merry.It clearerrlog
84006e79492SKenneth D. MerrySend the CLEAR ERROR LOG command.
84106e79492SKenneth D. MerryThis clears the error log counters for the specified phy.
84206e79492SKenneth D. Merry.It clearaffiliation
84306e79492SKenneth D. MerrySend the CLEAR AFFILIATION command.
84406e79492SKenneth D. MerryThis clears the affiliation from the STP initiator port with the same SAS
84506e79492SKenneth D. Merryaddress as the SMP initiator that requests the clear operation.
84606e79492SKenneth D. Merry.It sataportsel
84706e79492SKenneth D. MerrySend the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
84806e79492SKenneth D. MerryThis will cause a SATA port selector to use the given phy as its active phy
84906e79492SKenneth D. Merryand make the other phy inactive.
85006e79492SKenneth D. Merry.It clearitnl
85106e79492SKenneth D. MerrySend the CLEAR STP I_T NEXUS LOSS command to the PHY.
85206e79492SKenneth D. Merry.It setdevname
85306e79492SKenneth D. MerrySend the SET ATTACHED DEVICE NAME command to the PHY.
85406e79492SKenneth D. MerryThis requires the
85506e79492SKenneth D. Merry.Fl d
85606e79492SKenneth D. Merryargument to specify the device name.
85706e79492SKenneth D. Merry.El
85806e79492SKenneth D. Merry.It Fl d Ar name
85906e79492SKenneth D. MerrySpecify the attached device name.
86006e79492SKenneth D. MerryThis option is needed with the
86106e79492SKenneth D. Merry.Fl o Ar setdevname
86206e79492SKenneth D. Merryphy operation.
86306e79492SKenneth D. MerryThe name is a 64-bit number, and can be specified in decimal, hexadecimal
86406e79492SKenneth D. Merryor octal format.
86506e79492SKenneth D. Merry.It Fl m Ar rate
86606e79492SKenneth D. MerrySet the minimum physical link rate for the phy.
86706e79492SKenneth D. MerryThis is a numeric argument.
86806e79492SKenneth D. MerryCurrently known link rates are:
86906e79492SKenneth D. Merry.Bl -tag -width 5n
87006e79492SKenneth D. Merry.It 0x0
87106e79492SKenneth D. MerryDo not change current value.
87206e79492SKenneth D. Merry.It 0x8
87306e79492SKenneth D. Merry1.5 Gbps
87406e79492SKenneth D. Merry.It 0x9
87506e79492SKenneth D. Merry3 Gbps
87606e79492SKenneth D. Merry.It 0xa
87706e79492SKenneth D. Merry6 Gbps
87806e79492SKenneth D. Merry.El
87906e79492SKenneth D. Merry.Pp
88006e79492SKenneth D. MerryOther values may be specified for newer physical link rates.
88106e79492SKenneth D. Merry.It Fl M Ar rate
88206e79492SKenneth D. MerrySet the maximum physical link rate for the phy.
88306e79492SKenneth D. MerryThis is a numeric argument.
88406e79492SKenneth D. MerrySee the
88506e79492SKenneth D. Merry.Fl m
88606e79492SKenneth D. Merryargument description for known link rate arguments.
88706e79492SKenneth D. Merry.It Fl T Ar pp_timeout
88806e79492SKenneth D. MerrySet the partial pathway timeout value, in microseconds.
88906e79492SKenneth D. MerrySee the
89006e79492SKenneth D. Merry.Tn ANSI
89106e79492SKenneth D. Merry.Tn SAS
89219769ec2SJoel DahlProtocol Layer (SPL)
89306e79492SKenneth D. Merryspecification for more information on this field.
89406e79492SKenneth D. Merry.It Fl a Ar enable|disable
89506e79492SKenneth D. MerryEnable or disable SATA slumber phy power conditions.
89606e79492SKenneth D. Merry.It Fl A Ar enable|disable
89706e79492SKenneth D. MerryEnable or disable SATA partial power conditions.
89806e79492SKenneth D. Merry.It Fl s Ar enable|disable
89906e79492SKenneth D. MerryEnable or disable SAS slumber phy power conditions.
90006e79492SKenneth D. Merry.It Fl S Ar enable|disable
90106e79492SKenneth D. MerryEnable or disable SAS partial phy power conditions.
90206e79492SKenneth D. Merry.El
90306e79492SKenneth D. Merry.It Ic smpphylist
90406e79492SKenneth D. MerryList phys attached to a SAS expander, the address of the end device
90506e79492SKenneth D. Merryattached to the phy, and the inquiry data for that device and peripheral
90606e79492SKenneth D. Merrydevices attached to that device.
90706e79492SKenneth D. MerryThe inquiry data and peripheral devices are displayed if available.
90806e79492SKenneth D. Merry.Bl -tag -width 5n
90906e79492SKenneth D. Merry.It Fl l
91006e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for
91106e79492SKenneth D. Merrythis command.
91206e79492SKenneth D. Merry.It Fl q
91306e79492SKenneth D. MerryOnly print out phys that are attached to a device in the CAM EDT (Existing
91406e79492SKenneth D. MerryDevice Table).
91506e79492SKenneth D. Merry.El
91606e79492SKenneth D. Merry.It Ic smpmaninfo
91706e79492SKenneth D. MerrySend the SMP Report Manufacturer Information command to the device and
91806e79492SKenneth D. Merrydisplay the response.
91906e79492SKenneth D. Merry.Bl -tag -width 5n
92006e79492SKenneth D. Merry.It Fl l
92106e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for
92206e79492SKenneth D. Merrythis command.
92306e79492SKenneth D. Merry.El
92433fab22eSKenneth D. Merry.It Ic debug
9259806e231SRuslan ErmilovTurn on CAM debugging printfs in the kernel.
9269806e231SRuslan ErmilovThis requires options CAMDEBUG
9279806e231SRuslan Ermilovin your kernel config file.
9289806e231SRuslan ErmilovWARNING: enabling debugging printfs currently
9299806e231SRuslan Ermilovcauses an EXTREME number of kernel printfs.
9309806e231SRuslan ErmilovYou may have difficulty
931525689f1SJustin T. Gibbsturning off the debugging printfs once they start, since the kernel will be
932525689f1SJustin T. Gibbsbusy printing messages and unable to service other requests quickly.
93333fab22eSKenneth D. MerryThe
93433fab22eSKenneth D. Merry.Ic debug
93533fab22eSKenneth D. Merryfunction takes a number of arguments:
9361252c1bbSRuslan Ermilov.Bl -tag -width 18n
937525689f1SJustin T. Gibbs.It Fl I
938525689f1SJustin T. GibbsEnable CAM_DEBUG_INFO printfs.
939a7e5261eSNate Lawson.It Fl P
940a7e5261eSNate LawsonEnable CAM_DEBUG_PERIPH printfs.
941525689f1SJustin T. Gibbs.It Fl T
942525689f1SJustin T. GibbsEnable CAM_DEBUG_TRACE printfs.
943525689f1SJustin T. Gibbs.It Fl S
944525689f1SJustin T. GibbsEnable CAM_DEBUG_SUBTRACE printfs.
945a7e5261eSNate Lawson.It Fl X
946a7e5261eSNate LawsonEnable CAM_DEBUG_XPT printfs.
947d05caa00SKenneth D. Merry.It Fl c
9489806e231SRuslan ErmilovEnable CAM_DEBUG_CDB printfs.
9499806e231SRuslan ErmilovThis will cause the kernel to print out the
950d05caa00SKenneth D. MerrySCSI CDBs sent to the specified device(s).
951fbfb753fSAlexander Motin.It Fl p
952fbfb753fSAlexander MotinEnable CAM_DEBUG_PROBE printfs.
953525689f1SJustin T. Gibbs.It all
954525689f1SJustin T. GibbsEnable debugging for all devices.
955525689f1SJustin T. Gibbs.It off
956525689f1SJustin T. GibbsTurn off debugging for all devices
957525689f1SJustin T. Gibbs.It bus Ns Op :target Ns Op :lun
9589806e231SRuslan ErmilovTurn on debugging for the given bus, target or lun.
9599806e231SRuslan ErmilovIf the lun or target
9609806e231SRuslan Ermilovand lun are not specified, they are wildcarded.
9619806e231SRuslan Ermilov(i.e., just specifying a
962525689f1SJustin T. Gibbsbus turns on debugging printfs for all devices on that bus.)
963525689f1SJustin T. Gibbs.El
96433fab22eSKenneth D. Merry.It Ic tags
9659deea857SKenneth D. MerryShow or set the number of "tagged openings" or simultaneous transactions
9669806e231SRuslan Ermilovwe attempt to queue to a particular device.
9679806e231SRuslan ErmilovBy default, the
96833fab22eSKenneth D. Merry.Ic tags
9699806e231SRuslan Ermilovcommand, with no command-specific arguments (i.e., only generic arguments)
9709deea857SKenneth D. Merryprints out the "soft" maximum number of transactions that can be queued to
9719806e231SRuslan Ermilovthe device in question.
9729806e231SRuslan ErmilovFor more detailed information, use the
9739deea857SKenneth D. Merry.Fl v
9749deea857SKenneth D. Merryargument described below.
9751252c1bbSRuslan Ermilov.Bl -tag -width 7n
9769deea857SKenneth D. Merry.It Fl N Ar tags
9779806e231SRuslan ErmilovSet the number of tags for the given device.
9789806e231SRuslan ErmilovThis must be between the
9799806e231SRuslan Ermilovminimum and maximum number set in the kernel quirk table.
9809806e231SRuslan ErmilovThe default for
9819deea857SKenneth D. Merrymost devices that support tagged queueing is a minimum of 2 and a maximum
9829806e231SRuslan Ermilovof 255.
9839806e231SRuslan ErmilovThe minimum and maximum values for a given device may be
9849deea857SKenneth D. Merrydetermined by using the
9859deea857SKenneth D. Merry.Fl v
9869806e231SRuslan Ermilovswitch.
9879806e231SRuslan ErmilovThe meaning of the
9889deea857SKenneth D. Merry.Fl v
9899deea857SKenneth D. Merryswitch for this
9907c7fb079SRuslan Ermilov.Nm
9919deea857SKenneth D. Merrysubcommand is described below.
9929deea857SKenneth D. Merry.It Fl q
9930227791bSRuslan ErmilovBe quiet, and do not report the number of tags.
9949806e231SRuslan ErmilovThis is generally used when
9959deea857SKenneth D. Merrysetting the number of tags.
9969deea857SKenneth D. Merry.It Fl v
9979deea857SKenneth D. MerryThe verbose flag has special functionality for the
9989deea857SKenneth D. Merry.Em tags
9999806e231SRuslan Ermilovargument.
10009806e231SRuslan ErmilovIt causes
10017c7fb079SRuslan Ermilov.Nm
10029deea857SKenneth D. Merryto print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
10031252c1bbSRuslan Ermilov.Bl -tag -width 13n
10049deea857SKenneth D. Merry.It dev_openings
10059deea857SKenneth D. MerryThis is the amount of capacity for transactions queued to a given device.
10069deea857SKenneth D. Merry.It dev_active
10079deea857SKenneth D. MerryThis is the number of transactions currently queued to a device.
10089deea857SKenneth D. Merry.It devq_openings
10099806e231SRuslan ErmilovThis is the kernel queue space for transactions.
10109806e231SRuslan ErmilovThis count usually mirrors
10119deea857SKenneth D. Merrydev_openings except during error recovery operations when
10129deea857SKenneth D. Merrythe device queue is frozen (device is not allowed to receive
10139deea857SKenneth D. Merrycommands), the number of dev_openings is reduced, or transaction
10149deea857SKenneth D. Merryreplay is occurring.
10159deea857SKenneth D. Merry.It devq_queued
10169deea857SKenneth D. MerryThis is the number of transactions waiting in the kernel queue for capacity
10179806e231SRuslan Ermilovon the device.
10189806e231SRuslan ErmilovThis number is usually zero unless error recovery is in
10199deea857SKenneth D. Merryprogress.
10209deea857SKenneth D. Merry.It held
10219deea857SKenneth D. MerryThe held count is the number of CCBs held by peripheral drivers that have
10229deea857SKenneth D. Merryeither just been completed or are about to be released to the transport
10239806e231SRuslan Ermilovlayer for service by a device.
10249806e231SRuslan ErmilovHeld CCBs reserve capacity on a given
10259deea857SKenneth D. Merrydevice.
10269deea857SKenneth D. Merry.It mintags
10279deea857SKenneth D. MerryThis is the current "hard" minimum number of transactions that can be
10289806e231SRuslan Ermilovqueued to a device at once.
10299806e231SRuslan ErmilovThe
10309deea857SKenneth D. Merry.Ar dev_openings
10319806e231SRuslan Ermilovvalue above cannot go below this number.
10329806e231SRuslan ErmilovThe default value for
10339deea857SKenneth D. Merry.Ar mintags
10349deea857SKenneth D. Merryis 2, although it may be set higher or lower for various devices.
10359deea857SKenneth D. Merry.It maxtags
10369deea857SKenneth D. MerryThis is the "hard" maximum number of transactions that can be queued to a
10379806e231SRuslan Ermilovdevice at one time.
10389806e231SRuslan ErmilovThe
10399deea857SKenneth D. Merry.Ar dev_openings
10409806e231SRuslan Ermilovvalue cannot go above this number.
10419806e231SRuslan ErmilovThe default value for
10429deea857SKenneth D. Merry.Ar maxtags
10439deea857SKenneth D. Merryis 255, although it may be set higher or lower for various devices.
10449deea857SKenneth D. Merry.El
10459deea857SKenneth D. Merry.El
104633fab22eSKenneth D. Merry.It Ic negotiate
10479806e231SRuslan ErmilovShow or negotiate various communication parameters.
10489806e231SRuslan ErmilovSome controllers may
10499806e231SRuslan Ermilovnot support setting or changing some of these values.
10509806e231SRuslan ErmilovFor instance, the
10519deea857SKenneth D. MerryAdaptec 174x controllers do not support changing a device's sync rate or
10529deea857SKenneth D. Merryoffset.
1053e1205e80SPhilippe CharnierThe
10547c7fb079SRuslan Ermilov.Nm
1055e1205e80SPhilippe Charnierutility
10569deea857SKenneth D. Merrywill not attempt to set the parameter if the controller indicates that it
10579806e231SRuslan Ermilovdoes not support setting the parameter.
10589806e231SRuslan ErmilovTo find out what the controller
10599deea857SKenneth D. Merrysupports, use the
10609deea857SKenneth D. Merry.Fl v
10619806e231SRuslan Ermilovflag.
10629806e231SRuslan ErmilovThe meaning of the
10639deea857SKenneth D. Merry.Fl v
10649deea857SKenneth D. Merryflag for the
106533fab22eSKenneth D. Merry.Ic negotiate
10669806e231SRuslan Ermilovcommand is described below.
10670227791bSRuslan ErmilovAlso, some controller drivers do not support
10689deea857SKenneth D. Merrysetting negotiation parameters, even if the underlying controller supports
10699806e231SRuslan Ermilovnegotiation changes.
10709806e231SRuslan ErmilovSome controllers, such as the Advansys wide
10719deea857SKenneth D. Merrycontrollers, support enabling and disabling synchronous negotiation for
10729deea857SKenneth D. Merrya device, but do not support setting the synchronous negotiation rate.
10731252c1bbSRuslan Ermilov.Bl -tag -width 17n
10749deea857SKenneth D. Merry.It Fl a
10759deea857SKenneth D. MerryAttempt to make the negotiation settings take effect immediately by sending
10769deea857SKenneth D. Merrya Test Unit Ready command to the device.
10779deea857SKenneth D. Merry.It Fl c
10789806e231SRuslan ErmilovShow or set current negotiation settings.
10799806e231SRuslan ErmilovThis is the default.
10809deea857SKenneth D. Merry.It Fl D Ar enable|disable
10819deea857SKenneth D. MerryEnable or disable disconnection.
1082b447e682SAlexander Motin.It Fl M Ar mode
1083b447e682SAlexander MotinSet ATA mode.
10849deea857SKenneth D. Merry.It Fl O Ar offset
10859deea857SKenneth D. MerrySet the command delay offset.
10869deea857SKenneth D. Merry.It Fl q
10870227791bSRuslan ErmilovBe quiet, do not print anything.
10889806e231SRuslan ErmilovThis is generally useful when you want to
10890227791bSRuslan Ermilovset a parameter, but do not want any status information.
10909deea857SKenneth D. Merry.It Fl R Ar syncrate
10919806e231SRuslan ErmilovChange the synchronization rate for a device.
10929806e231SRuslan ErmilovThe sync rate is a floating
10939806e231SRuslan Ermilovpoint value specified in MHz.
10949806e231SRuslan ErmilovSo, for instance,
10959deea857SKenneth D. Merry.Sq 20.000
10969deea857SKenneth D. Merryis a legal value, as is
10979deea857SKenneth D. Merry.Sq 20 .
10989deea857SKenneth D. Merry.It Fl T Ar enable|disable
10999deea857SKenneth D. MerryEnable or disable tagged queueing for a device.
11009deea857SKenneth D. Merry.It Fl U
11019806e231SRuslan ErmilovShow or set user negotiation settings.
11029806e231SRuslan ErmilovThe default is to show or set
11039deea857SKenneth D. Merrycurrent negotiation settings.
11049deea857SKenneth D. Merry.It Fl v
11059deea857SKenneth D. MerryThe verbose switch has special meaning for the
110633fab22eSKenneth D. Merry.Ic negotiate
11079806e231SRuslan Ermilovsubcommand.
11089806e231SRuslan ErmilovIt causes
11097c7fb079SRuslan Ermilov.Nm
11109deea857SKenneth D. Merryto print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
11119deea857SKenneth D. Merrycontroller driver.
11129deea857SKenneth D. Merry.It Fl W Ar bus_width
11139806e231SRuslan ErmilovSpecify the bus width to negotiate with a device.
11149806e231SRuslan ErmilovThe bus width is
11159806e231SRuslan Ermilovspecified in bits.
11169806e231SRuslan ErmilovThe only useful values to specify are 8, 16, and 32
11179806e231SRuslan Ermilovbits.
11189806e231SRuslan ErmilovThe controller must support the bus width in question in order for
11199deea857SKenneth D. Merrythe setting to take effect.
11209deea857SKenneth D. Merry.El
11219deea857SKenneth D. Merry.Pp
11229deea857SKenneth D. MerryIn general, sync rate and offset settings will not take effect for a
11239806e231SRuslan Ermilovdevice until a command has been sent to the device.
11249806e231SRuslan ErmilovThe
11259deea857SKenneth D. Merry.Fl a
11269deea857SKenneth D. Merryswitch above will automatically send a Test Unit Ready to the device so
11279deea857SKenneth D. Merrynegotiation parameters will take effect.
112833fab22eSKenneth D. Merry.It Ic format
112996a93c63SKenneth D. MerryIssue the
113096a93c63SKenneth D. Merry.Tn SCSI
113196a93c63SKenneth D. MerryFORMAT UNIT command to the named device.
113296a93c63SKenneth D. Merry.Pp
113396a93c63SKenneth D. Merry.Em WARNING! WARNING! WARNING!
113496a93c63SKenneth D. Merry.Pp
11359806e231SRuslan ErmilovLow level formatting a disk will destroy ALL data on the disk.
11369806e231SRuslan ErmilovUse
11379806e231SRuslan Ermilovextreme caution when issuing this command.
11389806e231SRuslan ErmilovMany users low-level format
11399806e231SRuslan Ermilovdisks that do not really need to be low-level formatted.
11409806e231SRuslan ErmilovThere are
114196a93c63SKenneth D. Merryrelatively few scenarios that call for low-level formatting a disk.
114296a93c63SKenneth D. MerryOne reason for
114396a93c63SKenneth D. Merrylow-level formatting a disk is to initialize the disk after changing
11449806e231SRuslan Ermilovits physical sector size.
11459806e231SRuslan ErmilovAnother reason for low-level formatting a disk
114696a93c63SKenneth D. Merryis to revive the disk if you are getting "medium format corrupted" errors
114796a93c63SKenneth D. Merryfrom the disk in response to read and write requests.
114896a93c63SKenneth D. Merry.Pp
11499806e231SRuslan ErmilovSome disks take longer than others to format.
11509806e231SRuslan ErmilovUsers should specify a
11519806e231SRuslan Ermilovtimeout long enough to allow the format to complete.
11529806e231SRuslan ErmilovThe default format
11539806e231SRuslan Ermilovtimeout is 3 hours, which should be long enough for most disks.
11549806e231SRuslan ErmilovSome hard
115596a93c63SKenneth D. Merrydisks will complete a format operation in a very short period of time
11569806e231SRuslan Ermilov(on the order of 5 minutes or less).
11579806e231SRuslan ErmilovThis is often because the drive
11580227791bSRuslan Ermilovdoes not really support the FORMAT UNIT command -- it just accepts the
115996a93c63SKenneth D. Merrycommand, waits a few minutes and then returns it.
116096a93c63SKenneth D. Merry.Pp
116196a93c63SKenneth D. MerryThe
116296a93c63SKenneth D. Merry.Sq format
11639806e231SRuslan Ermilovsubcommand takes several arguments that modify its default behavior.
11649806e231SRuslan ErmilovThe
116596a93c63SKenneth D. Merry.Fl q
116696a93c63SKenneth D. Merryand
116796a93c63SKenneth D. Merry.Fl y
116896a93c63SKenneth D. Merryarguments can be useful for scripts.
11691252c1bbSRuslan Ermilov.Bl -tag -width 6n
117096a93c63SKenneth D. Merry.It Fl q
11710227791bSRuslan ErmilovBe quiet, do not print any status messages.
11729806e231SRuslan ErmilovThis option will not disable
11739806e231SRuslan Ermilovthe questions, however.
11749806e231SRuslan ErmilovTo disable questions, use the
117596a93c63SKenneth D. Merry.Fl y
117696a93c63SKenneth D. Merryargument, below.
1177e9e4d3e4SKenneth D. Merry.It Fl r
1178e9e4d3e4SKenneth D. MerryRun in
1179e9e4d3e4SKenneth D. Merry.Dq report only
1180e9e4d3e4SKenneth D. Merrymode.
1181e9e4d3e4SKenneth D. MerryThis will report status on a format that is already running on the drive.
118296a93c63SKenneth D. Merry.It Fl w
11839806e231SRuslan ErmilovIssue a non-immediate format command.
11849806e231SRuslan ErmilovBy default,
11857c7fb079SRuslan Ermilov.Nm
11869806e231SRuslan Ermilovissues the FORMAT UNIT command with the immediate bit set.
11879806e231SRuslan ErmilovThis tells the
118896a93c63SKenneth D. Merrydevice to immediately return the format command, before the format has
11899806e231SRuslan Ermilovactually completed.
11909806e231SRuslan ErmilovThen,
11917c7fb079SRuslan Ermilov.Nm
119296a93c63SKenneth D. Merrygathers
119396a93c63SKenneth D. Merry.Tn SCSI
119496a93c63SKenneth D. Merrysense information from the device every second to determine how far along
11959806e231SRuslan Ermilovin the format process it is.
11969806e231SRuslan ErmilovIf the
119796a93c63SKenneth D. Merry.Fl w
119896a93c63SKenneth D. Merryargument is specified,
11997c7fb079SRuslan Ermilov.Nm
120096a93c63SKenneth D. Merrywill issue a non-immediate format command, and will be unable to print any
120196a93c63SKenneth D. Merryinformation to let the user know what percentage of the disk has been
120296a93c63SKenneth D. Merryformatted.
120396a93c63SKenneth D. Merry.It Fl y
12040227791bSRuslan ErmilovDo not ask any questions.
12059806e231SRuslan ErmilovBy default,
12067c7fb079SRuslan Ermilov.Nm
120796a93c63SKenneth D. Merrywill ask the user if he/she really wants to format the disk in question,
12089806e231SRuslan Ermilovand also if the default format command timeout is acceptable.
12099806e231SRuslan ErmilovThe user
121096a93c63SKenneth D. Merrywill not be asked about the timeout if a timeout is specified on the
121196a93c63SKenneth D. Merrycommand line.
121296a93c63SKenneth D. Merry.El
1213ffead710SBryan Venteicher.It Ic sanitize
1214ffead710SBryan VenteicherIssue the
1215ffead710SBryan Venteicher.Tn SCSI
1216ffead710SBryan VenteicherSANITIZE command to the named device.
1217ffead710SBryan Venteicher.Pp
1218ffead710SBryan Venteicher.Em WARNING! WARNING! WARNING!
1219ffead710SBryan Venteicher.Pp
1220ffead710SBryan VenteicherALL data in the cache and on the disk will be destroyed or made inaccessible.
1221ffead710SBryan VenteicherRecovery of the data is not possible.
1222ffead710SBryan VenteicherUse extreme caution when issuing this command.
1223ffead710SBryan Venteicher.Pp
1224ffead710SBryan VenteicherThe
1225ffead710SBryan Venteicher.Sq sanitize
1226ffead710SBryan Venteichersubcommand takes several arguments that modify its default behavior.
1227ffead710SBryan VenteicherThe
1228ffead710SBryan Venteicher.Fl q
1229ffead710SBryan Venteicherand
1230ffead710SBryan Venteicher.Fl y
1231ffead710SBryan Venteicherarguments can be useful for scripts.
1232ffead710SBryan Venteicher.Bl -tag -width 6n
1233ffead710SBryan Venteicher.It Fl a Ar operation
1234ffead710SBryan VenteicherSpecify the sanitize operation to perform.
1235ffead710SBryan Venteicher.Bl -tag -width 16n
1236ffead710SBryan Venteicher.It overwrite
1237ffead710SBryan VenteicherPerform an overwrite operation by writing a user supplied
1238ffead710SBryan Venteicherdata pattern to the device one or more times.
1239ffead710SBryan VenteicherThe pattern is given by the
1240ffead710SBryan Venteicher.Fl P
1241ffead710SBryan Venteicherargument.
1242ffead710SBryan VenteicherThe number of times is given by the
1243ffead710SBryan Venteicher.Fl c
1244ffead710SBryan Venteicherargument.
1245ffead710SBryan Venteicher.It block
1246ffead710SBryan VenteicherPerform a block erase operation.
1247ffead710SBryan VenteicherAll the device's blocks are set to a vendor defined
1248ffead710SBryan Venteichervalue, typically zero.
1249ffead710SBryan Venteicher.It crypto
1250ffead710SBryan VenteicherPerform a cryptographic erase operation.
1251ffead710SBryan VenteicherThe encryption keys are changed to prevent the decryption
1252ffead710SBryan Venteicherof the data.
1253ffead710SBryan Venteicher.It exitfailure
1254ffead710SBryan VenteicherExits a previously failed sanitize operation.
1255ffead710SBryan VenteicherA failed sanitize operation can only be exited if it was
1256ffead710SBryan Venteicherrun in the unrestricted completion mode, as provided by the
1257ffead710SBryan Venteicher.Fl U
1258ffead710SBryan Venteicherargument.
1259ffead710SBryan Venteicher.El
1260ffead710SBryan Venteicher.It Fl c Ar passes
1261ffead710SBryan VenteicherThe number of passes when performing an
1262ffead710SBryan Venteicher.Sq overwrite
1263ffead710SBryan Venteicheroperation.
12645bb17266SJoel DahlValid values are between 1 and 31.
12655bb17266SJoel DahlThe default is 1.
1266ffead710SBryan Venteicher.It Fl I
1267ffead710SBryan VenteicherWhen performing an
1268ffead710SBryan Venteicher.Sq overwrite
1269ffead710SBryan Venteicheroperation, the pattern is inverted between consecutive passes.
1270ffead710SBryan Venteicher.It Fl P Ar pattern
1271ffead710SBryan VenteicherPath to the file containing the pattern to use when
1272ffead710SBryan Venteicherperforming an
1273ffead710SBryan Venteicher.Sq overwrite
1274ffead710SBryan Venteicheroperation.
1275ffead710SBryan VenteicherThe pattern is repeated as needed to fill each block.
1276ffead710SBryan Venteicher.It Fl q
1277ffead710SBryan VenteicherBe quiet, do not print any status messages.
1278ffead710SBryan VenteicherThis option will not disable
1279ffead710SBryan Venteicherthe questions, however.
1280ffead710SBryan VenteicherTo disable questions, use the
1281ffead710SBryan Venteicher.Fl y
1282ffead710SBryan Venteicherargument, below.
1283ffead710SBryan Venteicher.It Fl U
1284ffead710SBryan VenteicherPerform the sanitize in the unrestricted completion mode.
1285ffead710SBryan VenteicherIf the operation fails, it can later be exited with the
1286ffead710SBryan Venteicher.Sq exitfailure
1287ffead710SBryan Venteicheroperation.
1288ffead710SBryan Venteicher.It Fl r
1289ffead710SBryan VenteicherRun in
1290ffead710SBryan Venteicher.Dq report only
1291ffead710SBryan Venteichermode.
1292ffead710SBryan VenteicherThis will report status on a sanitize that is already running on the drive.
1293ffead710SBryan Venteicher.It Fl w
1294ffead710SBryan VenteicherIssue a non-immediate sanitize command.
1295ffead710SBryan VenteicherBy default,
1296ffead710SBryan Venteicher.Nm
1297ffead710SBryan Venteicherissues the SANITIZE command with the immediate bit set.
1298ffead710SBryan VenteicherThis tells the
1299ffead710SBryan Venteicherdevice to immediately return the sanitize command, before
1300ffead710SBryan Venteicherthe sanitize has actually completed.
1301ffead710SBryan VenteicherThen,
1302ffead710SBryan Venteicher.Nm
1303ffead710SBryan Venteichergathers
1304ffead710SBryan Venteicher.Tn SCSI
1305ffead710SBryan Venteichersense information from the device every second to determine how far along
1306ffead710SBryan Venteicherin the sanitize process it is.
1307ffead710SBryan VenteicherIf the
1308ffead710SBryan Venteicher.Fl w
1309ffead710SBryan Venteicherargument is specified,
1310ffead710SBryan Venteicher.Nm
1311ffead710SBryan Venteicherwill issue a non-immediate sanitize command, and will be unable to print any
1312ffead710SBryan Venteicherinformation to let the user know what percentage of the disk has been
1313ffead710SBryan Venteichersanitized.
1314ffead710SBryan Venteicher.It Fl y
1315ffead710SBryan VenteicherDo not ask any questions.
1316ffead710SBryan VenteicherBy default,
1317ffead710SBryan Venteicher.Nm
1318ffead710SBryan Venteicherwill ask the user if he/she really wants to sanitize the disk in question,
1319ffead710SBryan Venteicherand also if the default sanitize command timeout is acceptable.
1320ffead710SBryan VenteicherThe user
1321ffead710SBryan Venteicherwill not be asked about the timeout if a timeout is specified on the
1322ffead710SBryan Venteichercommand line.
1323ffead710SBryan Venteicher.El
132450c9a276SAlexander Motin.It Ic idle
13255bb17266SJoel DahlPut ATA device into IDLE state.
13265bb17266SJoel DahlOptional parameter
132772166fbaSAlexander Motin.Pq Fl t
13285bb17266SJoel Dahlspecifies automatic standby timer value in seconds.
13295bb17266SJoel DahlValue 0 disables timer.
133050c9a276SAlexander Motin.It Ic standby
13315bb17266SJoel DahlPut ATA device into STANDBY state.
13325bb17266SJoel DahlOptional parameter
133372166fbaSAlexander Motin.Pq Fl t
13345bb17266SJoel Dahlspecifies automatic standby timer value in seconds.
13355bb17266SJoel DahlValue 0 disables timer.
133650c9a276SAlexander Motin.It Ic sleep
13375bb17266SJoel DahlPut ATA device into SLEEP state.
13385bb17266SJoel DahlNote that the only way get device out of
133950c9a276SAlexander Motinthis state may be reset.
1340e7affda5SAlexander Motin.It Ic apm
1341e7affda5SAlexander MotinIt optional parameter
1342e7affda5SAlexander Motin.Pq Fl l
1343e7affda5SAlexander Motinspecified, enables and sets advanced power management level, where
1344e7affda5SAlexander Motin1 -- minimum power, 127 -- maximum performance with standby,
1345e7affda5SAlexander Motin128 -- minimum power without standby, 254 -- maximum performance.
1346e7affda5SAlexander MotinIf not specified -- APM is disabled.
1347e7affda5SAlexander Motin.It Ic aam
1348e7affda5SAlexander MotinIt optional parameter
1349e7affda5SAlexander Motin.Pq Fl l
1350e7affda5SAlexander Motinspecified, enables and sets automatic acoustic management level, where
1351e7affda5SAlexander Motin1 -- minimum noise, 254 -- maximum performance.
1352e7affda5SAlexander MotinIf not specified -- AAM is disabled.
13531146874aSSteven Hartland.It Ic security
13541146874aSSteven HartlandUpdate or report security settings, using an ATA identify command (0xec).
13551146874aSSteven HartlandBy default,
13561146874aSSteven Hartland.Nm
13571146874aSSteven Hartlandwill print out the security support and associated settings of the device.
13581146874aSSteven HartlandThe
13591146874aSSteven Hartland.Ic security
13601146874aSSteven Hartlandcommand takes several arguments:
13611146874aSSteven Hartland.Bl -tag -width 0n
13621146874aSSteven Hartland.It Fl d Ar pwd
13631146874aSSteven Hartland.Pp
13641146874aSSteven HartlandDisable device security using the given password for the selected user according
13651146874aSSteven Hartlandto the devices configured security level.
13661146874aSSteven Hartland.It Fl e Ar pwd
13671146874aSSteven Hartland.Pp
13681146874aSSteven HartlandErase the device using the given password for the selected user.
13691146874aSSteven Hartland.Pp
13701146874aSSteven Hartland.Em WARNING! WARNING! WARNING!
13711146874aSSteven Hartland.Pp
13721146874aSSteven HartlandIssuing a secure erase will
13731146874aSSteven Hartland.Em ERASE ALL
13741146874aSSteven Hartlanduser data on the device and may take several hours to complete.
13751146874aSSteven Hartland.Pp
13761146874aSSteven HartlandWhen this command is used against an SSD drive all its cells will be marked as
13775bb17266SJoel Dahlempty, restoring it to factory default write performance.
13785bb17266SJoel DahlFor SSD's this action
13791146874aSSteven Hartlandusually takes just a few seconds.
13801146874aSSteven Hartland.It Fl f
13811146874aSSteven Hartland.Pp
13821146874aSSteven HartlandFreeze the security configuration of the specified device.
13831146874aSSteven Hartland.Pp
13841146874aSSteven HartlandAfter command completion any other commands that update the device lock mode
1385e36a4a7eSJoel Dahlshall be command aborted.
1386e36a4a7eSJoel DahlFrozen mode is disabled by power-off or hardware reset.
13871146874aSSteven Hartland.It Fl h Ar pwd
13881146874aSSteven Hartland.Pp
13891146874aSSteven HartlandEnhanced erase the device using the given password for the selected user.
13901146874aSSteven Hartland.Pp
13911146874aSSteven Hartland.Em WARNING! WARNING! WARNING!
13921146874aSSteven Hartland.Pp
13931146874aSSteven HartlandIssuing an enhanced secure erase will
13941146874aSSteven Hartland.Em ERASE ALL
13951146874aSSteven Hartlanduser data on the device and may take several hours to complete.
13961146874aSSteven Hartland.Pp
13971146874aSSteven HartlandAn enhanced erase writes predetermined data patterns to all user data areas,
13981146874aSSteven Hartlandall previously written user data shall be overwritten, including sectors that
13991146874aSSteven Hartlandare no longer in use due to reallocation.
14001146874aSSteven Hartland.It Fl k Ar pwd
14011146874aSSteven Hartland.Pp
14021146874aSSteven HartlandUnlock the device using the given password for the selected user according to
14031146874aSSteven Hartlandthe devices configured security level.
14041146874aSSteven Hartland.It Fl l Ar high|maximum
14051146874aSSteven Hartland.Pp
14061146874aSSteven HartlandSpecifies which security level to set when issuing a
14071146874aSSteven Hartland.Fl s Ar pwd
14085bb17266SJoel Dahlcommand.
14095bb17266SJoel DahlThe security level determines device behavior when the master
14105bb17266SJoel Dahlpassword is used to unlock the device.
14115bb17266SJoel DahlWhen the security level is set to high
14121146874aSSteven Hartlandthe device requires the unlock command and the master password to unlock.
14131146874aSSteven HartlandWhen the security level is set to maximum the device requires a secure erase
14141146874aSSteven Hartlandwith the master password to unlock.
14151146874aSSteven Hartland.Pp
14161146874aSSteven HartlandThis option must be used in conjunction with one of the security action commands.
14171146874aSSteven Hartland.Pp
14181146874aSSteven HartlandDefaults to
14191146874aSSteven Hartland.Em high
14201146874aSSteven Hartland.It Fl q
14211146874aSSteven Hartland.Pp
14221146874aSSteven HartlandBe quiet, do not print any status messages.
14231146874aSSteven HartlandThis option will not disable the questions, however.
14241146874aSSteven HartlandTo disable questions, use the
14251146874aSSteven Hartland.Fl y
14261146874aSSteven Hartlandargument, below.
14271146874aSSteven Hartland.It Fl s Ar pwd
14281146874aSSteven Hartland.Pp
14291146874aSSteven HartlandPassword the device (enable security) using the given password for the selected
14305bb17266SJoel Dahluser.
14315bb17266SJoel DahlThis option can be combined with other options such as
14321146874aSSteven Hartland.Fl e Em pwd
14331146874aSSteven Hartland.Pp
14341146874aSSteven HartlandA master password may be set in a addition to the user password. The purpose of
14351146874aSSteven Hartlandthe master password is to allow an administrator to establish a password that
14361146874aSSteven Hartlandis kept secret from the user, and which may be used to unlock the device if the
14371146874aSSteven Hartlanduser password is lost.
14381146874aSSteven Hartland.Pp
14391146874aSSteven Hartland.Em Note:
14401146874aSSteven HartlandSetting the master password does not enable device security.
14411146874aSSteven Hartland.Pp
14421146874aSSteven HartlandIf the master password is set and the drive supports a Master Revision Code
14431146874aSSteven Hartlandfeature the Master Password Revision Code will be decremented.
14441146874aSSteven Hartland.It Fl T Ar timeout
14451146874aSSteven Hartland.Pp
14461146874aSSteven HartlandOverrides the default timeout, specified in seconds, used for both
14471146874aSSteven Hartland.Fl e
14481146874aSSteven Hartlandand
14491146874aSSteven Hartland.Fl h
14501146874aSSteven Hartlandthis is useful if your system has problems processing long timeouts correctly.
14511146874aSSteven Hartland.Pp
14521146874aSSteven HartlandUsually the timeout is calculated from the information stored on the drive if
14531146874aSSteven Hartlandpresent, otherwise it defaults to 2 hours.
14541146874aSSteven Hartland.It Fl U Ar user|master
14551146874aSSteven Hartland.Pp
14561146874aSSteven HartlandSpecifies which user to set / use for the running action command, valid values
14571146874aSSteven Hartlandare user or master and defaults to master if not set.
14581146874aSSteven Hartland.Pp
14591146874aSSteven HartlandThis option must be used in conjunction with one of the security action commands.
14601146874aSSteven Hartland.Pp
14611146874aSSteven HartlandDefaults to
14621146874aSSteven Hartland.Em master
14631146874aSSteven Hartland.It Fl y
14641146874aSSteven Hartland.Pp
14651146874aSSteven HartlandConfirm yes to dangerous options such as
14661146874aSSteven Hartland.Fl e
14671146874aSSteven Hartlandwithout prompting for confirmation.
14681146874aSSteven Hartland.El
1469f636caf1SJoel Dahl.Pp
14705bb17266SJoel DahlIf the password specified for any action commands does not match the configured
14711146874aSSteven Hartlandpassword for the specified user the command will fail.
14721146874aSSteven Hartland.Pp
14731146874aSSteven HartlandThe password in all cases is limited to 32 characters, longer passwords will
14741146874aSSteven Hartlandfail.
14759e68761cSSteven Hartland.It Ic hpa
14769e68761cSSteven HartlandUpdate or report Host Protected Area details.
14779e68761cSSteven HartlandBy default
14789e68761cSSteven Hartland.Nm
14799e68761cSSteven Hartlandwill print out the HPA support and associated settings of the device.
14809e68761cSSteven HartlandThe
14819e68761cSSteven Hartland.Ic hpa
14829e68761cSSteven Hartlandcommand takes several optional arguments:
14839e68761cSSteven Hartland.Bl -tag -width 0n
14849e68761cSSteven Hartland.It Fl f
14859e68761cSSteven Hartland.Pp
14869e68761cSSteven HartlandFreeze the HPA configuration of the specified device.
14879e68761cSSteven Hartland.Pp
14889e68761cSSteven HartlandAfter command completion any other commands that update the HPA configuration
14899e68761cSSteven Hartlandshall be command aborted.
14909e68761cSSteven HartlandFrozen mode is disabled by power-off or hardware reset.
14919e68761cSSteven Hartland.It Fl l
14929e68761cSSteven Hartland.Pp
14939e68761cSSteven HartlandLock the HPA configuration of the device until a successful call to unlock or
14949e68761cSSteven Hartlandthe next power-on reset occurs.
14959e68761cSSteven Hartland.It Fl P
14969e68761cSSteven Hartland.Pp
14979e68761cSSteven HartlandMake the HPA max sectors persist across power-on reset or a hardware reset.
14989e68761cSSteven HartlandThis must be used in combination with
14999e68761cSSteven Hartland.Fl s Ar max_sectors
15009e68761cSSteven Hartland.
15019e68761cSSteven Hartland.It Fl p Ar pwd
15029e68761cSSteven Hartland.Pp
15039e68761cSSteven HartlandSet the HPA configuration password required for unlock calls.
15049e68761cSSteven Hartland.It Fl q
15059e68761cSSteven Hartland.Pp
15069e68761cSSteven HartlandBe quiet, do not print any status messages.
15079e68761cSSteven HartlandThis option will not disable the questions.
15089e68761cSSteven HartlandTo disable questions, use the
15099e68761cSSteven Hartland.Fl y
15109e68761cSSteven Hartlandargument, below.
15119e68761cSSteven Hartland.It Fl s Ar max_sectors
15129e68761cSSteven Hartland.Pp
15139e68761cSSteven HartlandConfigures the maximum user accessible sectors of the device.
15149e68761cSSteven HartlandThis will change the number of sectors the device reports.
15159e68761cSSteven Hartland.Pp
15169e68761cSSteven Hartland.Em WARNING! WARNING! WARNING!
15179e68761cSSteven Hartland.Pp
15189e68761cSSteven HartlandChanging the max sectors of a device using this option will make the data on
15199e68761cSSteven Hartlandthe device beyond the specified value inaccessible.
15209e68761cSSteven Hartland.Pp
15219e68761cSSteven HartlandOnly one successful
15229e68761cSSteven Hartland.Fl s Ar max_sectors
15239e68761cSSteven Hartlandcall can be made without a power-on reset or a hardware reset of the device.
15249e68761cSSteven Hartland.It Fl U Ar pwd
15259e68761cSSteven Hartland.Pp
15269e68761cSSteven HartlandUnlock the HPA configuration of the specified device using the given password.
15275bb17266SJoel DahlIf the password specified does not match the password configured via
15289e68761cSSteven Hartland.Fl p Ar pwd
15299e68761cSSteven Hartlandthe command will fail.
15309e68761cSSteven Hartland.Pp
15319e68761cSSteven HartlandAfter 5 failed unlock calls, due to password miss-match, the device will refuse
15329e68761cSSteven Hartlandadditional unlock calls until after a power-on reset.
15339e68761cSSteven Hartland.It Fl y
15349e68761cSSteven Hartland.Pp
15359e68761cSSteven HartlandConfirm yes to dangerous options such as
15369e68761cSSteven Hartland.Fl e
15379e68761cSSteven Hartlandwithout prompting for confirmation
15389e68761cSSteven Hartland.El
1539f636caf1SJoel Dahl.Pp
15409e68761cSSteven HartlandThe password for all HPA commands is limited to 32 characters, longer passwords
15419e68761cSSteven Hartlandwill fail.
15421f4782a4SEd Maste.It Ic fwdownload
15430e358df0SKenneth D. MerryProgram firmware of the named
15440e358df0SKenneth D. Merry.Tn SCSI
15450e358df0SKenneth D. Merryor ATA device using the image file provided.
15461f4782a4SEd Maste.Pp
15470e358df0SKenneth D. MerryIf the device is a
15480e358df0SKenneth D. Merry.Tn SCSI
15490e358df0SKenneth D. Merrydevice and it provides a recommended timeout for the WRITE BUFFER command
15500e358df0SKenneth D. Merry(see the
15510e358df0SKenneth D. Merry.Nm
15520e358df0SKenneth D. Merryopcodes subcommand), that timeout will be used for the firmware download.
15530e358df0SKenneth D. MerryThe drive-recommended timeout value may be overridden on the command line
15540e358df0SKenneth D. Merrywith the
15550e358df0SKenneth D. Merry.Fl t
15560e358df0SKenneth D. Merryoption.
15570e358df0SKenneth D. Merry.Pp
15580e358df0SKenneth D. MerryCurrent list of supported vendors for SCSI/SAS drives:
15590e358df0SKenneth D. Merry.Bl -tag -width 10n
15600e358df0SKenneth D. Merry.It HGST
15610e358df0SKenneth D. MerryTested with 4TB SAS drives, model number HUS724040ALS640.
15620e358df0SKenneth D. Merry.It HITACHI
15630e358df0SKenneth D. Merry.It HP
15640e358df0SKenneth D. Merry.It IBM
15650e358df0SKenneth D. MerryTested with LTO-5 (ULTRIUM-HH5) and LTO-6 (ULTRIUM-HH6) tape drives.
15660e358df0SKenneth D. MerryThere is a separate table entry for hard drives, because the update method
15670e358df0SKenneth D. Merryfor hard drives is different than the method for tape drives.
15680e358df0SKenneth D. Merry.It PLEXTOR
15690e358df0SKenneth D. Merry.It QUALSTAR
15700e358df0SKenneth D. Merry.It QUANTUM
15710e358df0SKenneth D. Merry.It SAMSUNG
15720e358df0SKenneth D. MerryTested with SM1625 SSDs.
15730e358df0SKenneth D. Merry.It SEAGATE
15740e358df0SKenneth D. MerryTested with Constellation ES (ST32000444SS), ES.2 (ST33000651SS) and
15750e358df0SKenneth D. MerryES.3 (ST1000NM0023) drives.
15760e358df0SKenneth D. Merry.It SmrtStor
15770e358df0SKenneth D. MerryTested with 400GB Optimus SSDs (TXA2D20400GA6001).
15781f4782a4SEd Maste.El
15791f4782a4SEd Maste.Pp
15801f4782a4SEd Maste.Em WARNING! WARNING! WARNING!
15811f4782a4SEd Maste.Pp
15821f4782a4SEd MasteLittle testing has been done to make sure that different device models from
15831f4782a4SEd Masteeach vendor work correctly with the fwdownload command.
15841f4782a4SEd MasteA vendor name appearing in the supported list means only that firmware of at
15851f4782a4SEd Masteleast one device type from that vendor has successfully been programmed with
15861f4782a4SEd Mastethe fwdownload command.
15871f4782a4SEd MasteExtra caution should be taken when using this command since there is no
15881f4782a4SEd Masteguarantee it will not break a device from the listed vendors.
15891f4782a4SEd MasteEnsure that you have a recent backup of the data on the device before
15901f4782a4SEd Masteperforming a firmware update.
15910e358df0SKenneth D. Merry.Pp
15920e358df0SKenneth D. MerryNote that unknown
15930e358df0SKenneth D. Merry.Tn SCSI
15940e358df0SKenneth D. Merryprotocol devices will not be programmed, since there is little chance of
15950e358df0SKenneth D. Merrythe firmware download succeeding.
15960e358df0SKenneth D. Merry.Pp
15970e358df0SKenneth D. Merry.Nm
15980e358df0SKenneth D. Merrywill currently attempt a firmware download to any
15990e358df0SKenneth D. Merry.Tn ATA
16000e358df0SKenneth D. Merryor
16010e358df0SKenneth D. Merry.Tn SATA
16020e358df0SKenneth D. Merrydevice, since the standard
16030e358df0SKenneth D. Merry.Tn ATA
16040e358df0SKenneth D. MerryDOWNLOAD MICROCODE command may work.
16050e358df0SKenneth D. MerryFirmware downloads to
16060e358df0SKenneth D. Merry.Tn ATA
16070e358df0SKenneth D. Merryand
16080e358df0SKenneth D. Merry.Tn SATA
16090e358df0SKenneth D. Merrydevices are supported for devices connected
16100e358df0SKenneth D. Merryto standard
16110e358df0SKenneth D. Merry.Tn ATA
16120e358df0SKenneth D. Merryand
16130e358df0SKenneth D. Merry.Tn SATA
16140e358df0SKenneth D. Merrycontrollers, and devices connected to SAS controllers
16150e358df0SKenneth D. Merrywith
16160e358df0SKenneth D. Merry.Tn SCSI
16170e358df0SKenneth D. Merryto
16180e358df0SKenneth D. Merry.Tn ATA
16190e358df0SKenneth D. Merrytranslation capability.
16200e358df0SKenneth D. MerryIn the latter case,
16210e358df0SKenneth D. Merry.Nm
16220e358df0SKenneth D. Merryuses the
16230e358df0SKenneth D. Merry.Tn SCSI
16240e358df0SKenneth D. Merry.Tn ATA
16250e358df0SKenneth D. MerryPASS-THROUGH command to send the
16260e358df0SKenneth D. Merry.Tn ATA
16270e358df0SKenneth D. MerryDOWNLOAD MICROCODE command to the drive.
16280e358df0SKenneth D. MerrySome
16290e358df0SKenneth D. Merry.Tn SCSI
16300e358df0SKenneth D. Merryto
16310e358df0SKenneth D. Merry.Tn ATA
16320e358df0SKenneth D. Merrytranslation implementations don't work fully when translating
16330e358df0SKenneth D. Merry.Tn SCSI
16340e358df0SKenneth D. MerryWRITE BUFFER commands to
16350e358df0SKenneth D. Merry.Tn ATA
16360e358df0SKenneth D. MerryDOWNLOAD MICROCODE commands, but do support
16370e358df0SKenneth D. Merry.Tn ATA
16380e358df0SKenneth D. Merrypassthrough well enough to do a firmware download.
16391f4782a4SEd Maste.Bl -tag -width 11n
16401f4782a4SEd Maste.It Fl f Ar fw_image
16411f4782a4SEd MastePath to the firmware image file to be downloaded to the specified device.
16420e358df0SKenneth D. Merry.It Fl q
16430e358df0SKenneth D. MerryDo not print informational messages, only print errors.
16440e358df0SKenneth D. MerryThis option should be used with the
16450e358df0SKenneth D. Merry.Fl y
16460e358df0SKenneth D. Merryoption to suppress all output.
16471f4782a4SEd Maste.It Fl s
16481f4782a4SEd MasteRun in simulation mode.
16490e358df0SKenneth D. MerryDevice checks are run and the confirmation dialog is shown, but no firmware
16500e358df0SKenneth D. Merrydownload will occur.
16511f4782a4SEd Maste.It Fl v
16520e358df0SKenneth D. MerryShow
16530e358df0SKenneth D. Merry.Tn SCSI
16540e358df0SKenneth D. Merryor
16550e358df0SKenneth D. Merry.Tn ATA
16560e358df0SKenneth D. Merryerrors in the event of a failure.
16570e358df0SKenneth D. Merry.Pp
16580e358df0SKenneth D. MerryIn simulation mode, print out the
16590e358df0SKenneth D. Merry.Tn SCSI
16600e358df0SKenneth D. MerryCDB
16610e358df0SKenneth D. Merryor
16620e358df0SKenneth D. Merry.Tn ATA
16630e358df0SKenneth D. Merryregister values that would be used for the firmware download command.
16640e358df0SKenneth D. Merry.It Fl y
16650e358df0SKenneth D. MerryDo not ask for confirmation.
16661f4782a4SEd Maste.El
166708df2e3eSKenneth D. Merry.It Ic persist
166808df2e3eSKenneth D. MerryPersistent reservation support.
166908df2e3eSKenneth D. MerryPersistent reservations are a way to reserve a particular
167008df2e3eSKenneth D. Merry.Tn SCSI
167108df2e3eSKenneth D. MerryLUN for use by one or more
167208df2e3eSKenneth D. Merry.Tn SCSI
167308df2e3eSKenneth D. Merryinitiators.
167408df2e3eSKenneth D. MerryIf the
167508df2e3eSKenneth D. Merry.Fl i
167608df2e3eSKenneth D. Merryoption is specified,
167708df2e3eSKenneth D. Merry.Nm
167808df2e3eSKenneth D. Merrywill issue the
167908df2e3eSKenneth D. Merry.Tn SCSI
168008df2e3eSKenneth D. MerryPERSISTENT RESERVE IN
168108df2e3eSKenneth D. Merrycommand using the requested service action.
168208df2e3eSKenneth D. MerryIf the
168308df2e3eSKenneth D. Merry.Fl o
168408df2e3eSKenneth D. Merryoption is specified,
168508df2e3eSKenneth D. Merry.Nm
168608df2e3eSKenneth D. Merrywill issue the
168708df2e3eSKenneth D. Merry.Tn SCSI
168808df2e3eSKenneth D. MerryPERSISTENT RESERVE OUT
168908df2e3eSKenneth D. Merrycommand using the requested service action.
169008df2e3eSKenneth D. MerryOne of those two options is required.
169108df2e3eSKenneth D. Merry.Pp
169208df2e3eSKenneth D. MerryPersistent reservations are complex, and fully explaining them is outside
169308df2e3eSKenneth D. Merrythe scope of this manual.
169408df2e3eSKenneth D. MerryPlease visit
169508df2e3eSKenneth D. Merryhttp://www.t10.org
169608df2e3eSKenneth D. Merryand download the latest SPC spec for a full explanation of persistent
169708df2e3eSKenneth D. Merryreservations.
169808df2e3eSKenneth D. Merry.Bl -tag -width 8n
169908df2e3eSKenneth D. Merry.It Fl i Ar mode
170008df2e3eSKenneth D. MerrySpecify the service action for the PERSISTENT RESERVE IN command.
170108df2e3eSKenneth D. MerrySupported service actions:
170208df2e3eSKenneth D. Merry.Bl -tag -width 19n
170308df2e3eSKenneth D. Merry.It read_keys
170408df2e3eSKenneth D. MerryReport the current persistent reservation generation (PRgeneration) and any
170508df2e3eSKenneth D. Merryregistered keys.
170608df2e3eSKenneth D. Merry.It read_reservation
170708df2e3eSKenneth D. MerryReport the persistent reservation, if any.
170808df2e3eSKenneth D. Merry.It report_capabilities
170908df2e3eSKenneth D. MerryReport the persistent reservation capabilities of the LUN.
171008df2e3eSKenneth D. Merry.It read_full_status
171108df2e3eSKenneth D. MerryReport the full status of persistent reservations on the LUN.
171208df2e3eSKenneth D. Merry.El
171308df2e3eSKenneth D. Merry.It Fl o Ar mode
171408df2e3eSKenneth D. MerrySpecify the service action for the PERSISTENT RESERVE OUT command.
171508df2e3eSKenneth D. MerryFor service actions like register that are components of other service
171608df2e3eSKenneth D. Merryaction names, the entire name must be specified.
171708df2e3eSKenneth D. MerryOtherwise, enough of the service action name must be specified to
171808df2e3eSKenneth D. Merrydistinguish it from other possible service actions.
171908df2e3eSKenneth D. MerrySupported service actions:
172008df2e3eSKenneth D. Merry.Bl -tag -width 15n
172108df2e3eSKenneth D. Merry.It register
172208df2e3eSKenneth D. MerryRegister a reservation key with the LUN or unregister a reservation key.
172308df2e3eSKenneth D. MerryTo register a key, specify the requested key as the Service Action
172408df2e3eSKenneth D. MerryReservation Key.
172508df2e3eSKenneth D. MerryTo unregister a key, specify the previously registered key as the
172608df2e3eSKenneth D. MerryReservation Key.
172708df2e3eSKenneth D. MerryTo change a key, specify the old key as the Reservation Key and the new
172808df2e3eSKenneth D. Merrykey as the Service Action Reservation Key.
172908df2e3eSKenneth D. Merry.It register_ignore
173008df2e3eSKenneth D. MerryThis is similar to the register subcommand, except that the Reservation Key
173108df2e3eSKenneth D. Merryis ignored.
173208df2e3eSKenneth D. MerryThe Service Action Reservation Key will overwrite any previous key
173308df2e3eSKenneth D. Merryregistered for the initiator.
173408df2e3eSKenneth D. Merry.It reserve
173508df2e3eSKenneth D. MerryCreate a reservation.
173608df2e3eSKenneth D. MerryA key must be registered with the LUN before the LUN can be reserved, and
173708df2e3eSKenneth D. Merryit must be specified as the Reservation Key.
173808df2e3eSKenneth D. MerryThe type of reservation must also be specified.
173908df2e3eSKenneth D. MerryThe scope defaults to LUN scope (LU_SCOPE), but may be changed.
174008df2e3eSKenneth D. Merry.It release
174108df2e3eSKenneth D. MerryRelease a reservation.
174208df2e3eSKenneth D. MerryThe Reservation Key must be specified.
174308df2e3eSKenneth D. Merry.It clear
174408df2e3eSKenneth D. MerryRelease a reservation and remove all keys from the device.
174508df2e3eSKenneth D. MerryThe Reservation Key must be specified.
174608df2e3eSKenneth D. Merry.It preempt
174708df2e3eSKenneth D. MerryRemove a reservation belonging to another initiator.
174808df2e3eSKenneth D. MerryThe Reservation Key must be specified.
174908df2e3eSKenneth D. MerryThe Service Action Reservation Key may be specified, depending on the
175008df2e3eSKenneth D. Merryoperation being performed.
175108df2e3eSKenneth D. Merry.It preempt_abort
175208df2e3eSKenneth D. MerryRemove a reservation belonging to another initiator and abort all
175308df2e3eSKenneth D. Merryoutstanding commands from that initiator.
175408df2e3eSKenneth D. MerryThe Reservation Key must be specified.
175508df2e3eSKenneth D. MerryThe Service Action Reservation Key may be specified, depending on the
175608df2e3eSKenneth D. Merryoperation being performed.
175708df2e3eSKenneth D. Merry.It register_move
175808df2e3eSKenneth D. MerryRegister another initiator with the LUN, and establish a reservation on the
175908df2e3eSKenneth D. MerryLUN for that initiator.
176008df2e3eSKenneth D. MerryThe Reservation Key and Service Action Reservation Key must be specified.
176108df2e3eSKenneth D. Merry.It replace_lost
176208df2e3eSKenneth D. MerryReplace Lost Reservation information.
176308df2e3eSKenneth D. Merry.El
176408df2e3eSKenneth D. Merry.It Fl a
176508df2e3eSKenneth D. MerrySet the All Target Ports (ALL_TG_PT) bit.
176608df2e3eSKenneth D. MerryThis requests that the key registration be applied to all target ports and
176708df2e3eSKenneth D. Merrynot just the particular target port that receives the command.
176808df2e3eSKenneth D. MerryThis only applies to the register and register_ignore actions.
176908df2e3eSKenneth D. Merry.It Fl I Ar tid
177008df2e3eSKenneth D. MerrySpecify a Transport ID.
177108df2e3eSKenneth D. MerryThis only applies to the Register and Register and Move service actions for
177208df2e3eSKenneth D. MerryPersistent Reserve Out.
177308df2e3eSKenneth D. MerryMultiple Transport IDs may be specified with multiple
177408df2e3eSKenneth D. Merry.Fl I
177508df2e3eSKenneth D. Merryarguments.
177608df2e3eSKenneth D. MerryWith the Register service action, specifying one or more Transport IDs
177708df2e3eSKenneth D. Merryimplicitly enables the
177808df2e3eSKenneth D. Merry.Fl S
177908df2e3eSKenneth D. Merryoption which turns on the SPEC_I_PT bit.
178008df2e3eSKenneth D. MerryTransport IDs generally have the format protocol,id.
178108df2e3eSKenneth D. Merry.Bl -tag -width 5n
178208df2e3eSKenneth D. Merry.It SAS
178308df2e3eSKenneth D. MerryA SAS Transport ID consists of
178408df2e3eSKenneth D. Merry.Dq sas,
178508df2e3eSKenneth D. Merryfollowed by a 64-bit SAS address.
178608df2e3eSKenneth D. MerryFor example:
178708df2e3eSKenneth D. Merry.Pp
178808df2e3eSKenneth D. Merry.Dl sas,0x1234567812345678
178908df2e3eSKenneth D. Merry.It FC
179008df2e3eSKenneth D. MerryA Fibre Channel Transport ID consists of
179108df2e3eSKenneth D. Merry.Dq fcp,
179208df2e3eSKenneth D. Merryfollowed by a 64-bit Fibre Channel World Wide Name.
179308df2e3eSKenneth D. MerryFor example:
179408df2e3eSKenneth D. Merry.Pp
179508df2e3eSKenneth D. Merry.Dl fcp,0x1234567812345678
179608df2e3eSKenneth D. Merry.It SPI
179708df2e3eSKenneth D. MerryA Parallel SCSI address consists of
179808df2e3eSKenneth D. Merry.Dq spi,
179908df2e3eSKenneth D. Merryfollowed by a SCSI target ID and a relative target port identifier.
180008df2e3eSKenneth D. MerryFor example:
180108df2e3eSKenneth D. Merry.Pp
180208df2e3eSKenneth D. Merry.Dl spi,4,1
180308df2e3eSKenneth D. Merry.It 1394
180408df2e3eSKenneth D. MerryAn IEEE 1394 (Firewire) Transport ID consists of
180508df2e3eSKenneth D. Merry.Dq sbp,
180608df2e3eSKenneth D. Merryfollowed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
180708df2e3eSKenneth D. MerryFor example:
180808df2e3eSKenneth D. Merry.Pp
180908df2e3eSKenneth D. Merry.Dl sbp,0x1234567812345678
181008df2e3eSKenneth D. Merry.It RDMA
181108df2e3eSKenneth D. MerryA SCSI over RDMA Transport ID consists of
181208df2e3eSKenneth D. Merry.Dq srp,
181308df2e3eSKenneth D. Merryfollowed by a 128-bit RDMA initiator port identifier.
181408df2e3eSKenneth D. MerryThe port identifier must be exactly 32 or 34 (if the leading 0x is
181508df2e3eSKenneth D. Merryincluded) hexadecimal digits.
181608df2e3eSKenneth D. MerryOnly hexadecimal (base 16) numbers are supported.
181708df2e3eSKenneth D. MerryFor example:
181808df2e3eSKenneth D. Merry.Pp
181908df2e3eSKenneth D. Merry.Dl srp,0x12345678123456781234567812345678
182008df2e3eSKenneth D. Merry.It iSCSI
182108df2e3eSKenneth D. MerryAn iSCSI Transport ID consists an iSCSI name and optionally a separator and
182208df2e3eSKenneth D. MerryiSCSI session ID.
182308df2e3eSKenneth D. MerryFor example, if only the iSCSI name is specified:
182408df2e3eSKenneth D. Merry.Pp
182508df2e3eSKenneth D. Merry.Dl iqn.2012-06.com.example:target0
182608df2e3eSKenneth D. Merry.Pp
182708df2e3eSKenneth D. MerryIf the iSCSI separator and initiator session ID are specified:
182808df2e3eSKenneth D. Merry.Pp
182908df2e3eSKenneth D. Merry.Dl iqn.2012-06.com.example:target0,i,0x123
183008df2e3eSKenneth D. Merry.It PCIe
183108df2e3eSKenneth D. MerryA SCSI over PCIe Transport ID consists of
183208df2e3eSKenneth D. Merry.Dq sop,
183308df2e3eSKenneth D. Merryfollowed by a PCIe Routing ID.
183408df2e3eSKenneth D. MerryThe Routing ID consists of a bus, device and function or in the alternate
183508df2e3eSKenneth D. Merryform, a bus and function.
183608df2e3eSKenneth D. MerryThe bus must be in the range of 0 to 255 inclusive and the device must be
183708df2e3eSKenneth D. Merryin the range of 0 to 31 inclusive.
183808df2e3eSKenneth D. MerryThe function must be in the range of 0 to 7 inclusive if the standard form
183908df2e3eSKenneth D. Merryis used, and in the range of 0 to 255 inclusive if the alternate form is
184008df2e3eSKenneth D. Merryused.
184108df2e3eSKenneth D. MerryFor example, if a bus, device and function are specified for the standard
184208df2e3eSKenneth D. MerryRouting ID form:
184308df2e3eSKenneth D. Merry.Pp
184408df2e3eSKenneth D. Merry.Dl sop,4,5,1
184508df2e3eSKenneth D. Merry.Pp
184608df2e3eSKenneth D. MerryIf the alternate Routing ID form is used:
184708df2e3eSKenneth D. Merry.Pp
184808df2e3eSKenneth D. Merry.Dl sop,4,1
184908df2e3eSKenneth D. Merry.El
185008df2e3eSKenneth D. Merry.It Fl k Ar key
185108df2e3eSKenneth D. MerrySpecify the Reservation Key.
185208df2e3eSKenneth D. MerryThis may be in decimal, octal or hexadecimal format.
185308df2e3eSKenneth D. MerryThe value is zero by default if not otherwise specified.
185408df2e3eSKenneth D. MerryThe value must be between 0 and 2^64 - 1, inclusive.
185508df2e3eSKenneth D. Merry.It Fl K Ar key
185608df2e3eSKenneth D. MerrySpecify the Service Action Reservation Key.
185708df2e3eSKenneth D. MerryThis may be in decimal, octal or hexadecimal format.
185808df2e3eSKenneth D. MerryThe value is zero by default if not otherwise specified.
185908df2e3eSKenneth D. MerryThe value must be between 0 and 2^64 - 1, inclusive.
186008df2e3eSKenneth D. Merry.It Fl p
186108df2e3eSKenneth D. MerryEnable the Activate Persist Through Power Loss bit.
186208df2e3eSKenneth D. MerryThis is only used for the register and register_ignore actions.
186308df2e3eSKenneth D. MerryThis requests that the reservation persist across power loss events.
186408df2e3eSKenneth D. Merry.It Fl s Ar scope
186508df2e3eSKenneth D. MerrySpecify the scope of the reservation.
186608df2e3eSKenneth D. MerryThe scope may be specified by name or by number.
186708df2e3eSKenneth D. MerryThe scope is ignored for register, register_ignore and clear.
186808df2e3eSKenneth D. MerryIf the desired scope isn't available by name, you may specify the number.
186908df2e3eSKenneth D. Merry.Bl -tag -width 7n
187008df2e3eSKenneth D. Merry.It lun
187108df2e3eSKenneth D. MerryLUN scope (0x00).
187208df2e3eSKenneth D. MerryThis encompasses the entire LUN.
187308df2e3eSKenneth D. Merry.It extent
187408df2e3eSKenneth D. MerryExtent scope (0x01).
187508df2e3eSKenneth D. Merry.It element
187608df2e3eSKenneth D. MerryElement scope (0x02).
187708df2e3eSKenneth D. Merry.El
187808df2e3eSKenneth D. Merry.It Fl R Ar rtp
187908df2e3eSKenneth D. MerrySpecify the Relative Target Port.
188008df2e3eSKenneth D. MerryThis only applies to the Register and Move service action of the Persistent
188108df2e3eSKenneth D. MerryReserve Out command.
188208df2e3eSKenneth D. Merry.It Fl S
188308df2e3eSKenneth D. MerryEnable the SPEC_I_PT bit.
188408df2e3eSKenneth D. MerryThis only applies to the Register service action of Persistent Reserve Out.
188508df2e3eSKenneth D. MerryYou must also specify at least one Transport ID with
188608df2e3eSKenneth D. Merry.Fl I
188708df2e3eSKenneth D. Merryif this option is set.
188808df2e3eSKenneth D. MerryIf you specify a Transport ID, this option is automatically set.
188908df2e3eSKenneth D. MerryIt is an error to specify this option for any service action other than
189008df2e3eSKenneth D. MerryRegister.
189108df2e3eSKenneth D. Merry.It Fl T Ar type
189208df2e3eSKenneth D. MerrySpecify the reservation type.
189308df2e3eSKenneth D. MerryThe reservation type may be specified by name or by number.
189408df2e3eSKenneth D. MerryIf the desired reservation type isn't available by name, you may specify
189508df2e3eSKenneth D. Merrythe number.
189608df2e3eSKenneth D. MerrySupported reservation type names:
189708df2e3eSKenneth D. Merry.Bl -tag -width 11n
189808df2e3eSKenneth D. Merry.It read_shared
189908df2e3eSKenneth D. MerryRead Shared mode.
190008df2e3eSKenneth D. Merry.It wr_ex
190108df2e3eSKenneth D. MerryWrite Exclusive mode.
190208df2e3eSKenneth D. MerryMay also be specified as
190308df2e3eSKenneth D. Merry.Dq write_exclusive .
190408df2e3eSKenneth D. Merry.It rd_ex
190508df2e3eSKenneth D. MerryRead Exclusive mode.
190608df2e3eSKenneth D. MerryMay also be specified as
190708df2e3eSKenneth D. Merry.Dq read_exclusive .
190808df2e3eSKenneth D. Merry.It ex_ac
190908df2e3eSKenneth D. MerryExclusive access mode.
191008df2e3eSKenneth D. MerryMay also be specified as
191108df2e3eSKenneth D. Merry.Dq exclusive_access .
191208df2e3eSKenneth D. Merry.It wr_ex_ro
191308df2e3eSKenneth D. MerryWrite Exclusive Registrants Only mode.
191408df2e3eSKenneth D. MerryMay also be specified as
191508df2e3eSKenneth D. Merry.Dq write_exclusive_reg_only .
191608df2e3eSKenneth D. Merry.It ex_ac_ro
191708df2e3eSKenneth D. MerryExclusive Access Registrants Only mode.
191808df2e3eSKenneth D. MerryMay also be specified as
191908df2e3eSKenneth D. Merry.Dq exclusive_access_reg_only .
192008df2e3eSKenneth D. Merry.It wr_ex_ar
192108df2e3eSKenneth D. MerryWrite Exclusive All Registrants mode.
192208df2e3eSKenneth D. MerryMay also be specified as
192308df2e3eSKenneth D. Merry.Dq write_exclusive_all_regs .
192408df2e3eSKenneth D. Merry.It ex_ac_ar
192508df2e3eSKenneth D. MerryExclusive Access All Registrants mode.
192608df2e3eSKenneth D. MerryMay also be specified as
192708df2e3eSKenneth D. Merry.Dq exclusive_access_all_regs .
192808df2e3eSKenneth D. Merry.El
192908df2e3eSKenneth D. Merry.It Fl U
193008df2e3eSKenneth D. MerrySpecify that the target should unregister the initiator that sent
193108df2e3eSKenneth D. Merrythe Register and Move request.
193208df2e3eSKenneth D. MerryBy default, the target will not unregister the initiator that sends the
193308df2e3eSKenneth D. MerryRegister and Move request.
193408df2e3eSKenneth D. MerryThis option only applies to the Register and Move service action of the
193508df2e3eSKenneth D. MerryPersistent Reserve Out command.
193608df2e3eSKenneth D. Merry.El
19375672fac9SKenneth D. Merry.It Ic attrib
19385672fac9SKenneth D. MerryIssue the
19395672fac9SKenneth D. Merry.Tn SCSI
19405672fac9SKenneth D. MerryREAD or WRITE ATTRIBUTE commands.
19415672fac9SKenneth D. MerryThese commands are used to read and write attributes in Medium Auxiliary
19425672fac9SKenneth D. MerryMemory (MAM).
19435672fac9SKenneth D. MerryThe most common place Medium Auxiliary Memory is found is small flash chips
19445672fac9SKenneth D. Merryincluded tape cartriges.
19455672fac9SKenneth D. MerryFor instance,
19465672fac9SKenneth D. Merry.Tn LTO
19475672fac9SKenneth D. Merrytapes have MAM.
19485672fac9SKenneth D. MerryEither the
19495672fac9SKenneth D. Merry.Fl r
19505672fac9SKenneth D. Merryoption or the
19515672fac9SKenneth D. Merry.Fl w
19525672fac9SKenneth D. Merryoption must be specified.
19535672fac9SKenneth D. Merry.Bl -tag -width 14n
19545672fac9SKenneth D. Merry.It Fl r Ar action
19555672fac9SKenneth D. MerrySpecify the READ ATTRIBUTE service action.
19565672fac9SKenneth D. Merry.Bl -tag -width 11n
19575672fac9SKenneth D. Merry.It attr_values
19585672fac9SKenneth D. MerryIssue the ATTRIBUTE VALUES service action.
19595672fac9SKenneth D. MerryRead and decode the available attributes and their values.
19605672fac9SKenneth D. Merry.It attr_list
19615672fac9SKenneth D. MerryIssue the ATTRIBUTE LIST service action.
19625672fac9SKenneth D. MerryList the attributes that are available to read and write.
19635672fac9SKenneth D. Merry.It lv_list
19645672fac9SKenneth D. MerryIssue the LOGICAL VOLUME LIST service action.
19655672fac9SKenneth D. MerryList the available logical volumes in the MAM.
19665672fac9SKenneth D. Merry.It part_list
19675672fac9SKenneth D. MerryIssue the PARTITION LIST service action.
19685672fac9SKenneth D. MerryList the available partitions in the MAM.
19695672fac9SKenneth D. Merry.It supp_attr
19705672fac9SKenneth D. MerryIssue the SUPPORTED ATTRIBUTES service action.
19715672fac9SKenneth D. MerryList attributes that are supported for reading or writing.
19725672fac9SKenneth D. MerryThese attributes may or may not be currently present in the MAM.
19735672fac9SKenneth D. Merry.El
19745672fac9SKenneth D. Merry.It Fl w Ar attr
19755672fac9SKenneth D. MerrySpecify an attribute to write to the MAM.
19765672fac9SKenneth D. MerryThis option is not yet implemented.
19775672fac9SKenneth D. Merry.It Fl a Ar num
19785672fac9SKenneth D. MerrySpecify the attribute number to display.
19795672fac9SKenneth D. MerryThis option only works with the attr_values, attr_list and supp_attr
19805672fac9SKenneth D. Merryarguments to
19815672fac9SKenneth D. Merry.Fl r .
19825672fac9SKenneth D. Merry.It Fl c
19835672fac9SKenneth D. MerryDisplay cached attributes.
19845672fac9SKenneth D. MerryIf the device supports this flag, it allows displaying attributes for the
19855672fac9SKenneth D. Merrylast piece of media loaded in the drive.
19865672fac9SKenneth D. Merry.It Fl e Ar num
19875672fac9SKenneth D. MerrySpecify the element address.
19885672fac9SKenneth D. MerryThis is used for specifying which element number in a medium changer to
19895672fac9SKenneth D. Merryaccess when reading attributes.
19905672fac9SKenneth D. MerryThe element number could be for a picker, portal, slot or drive.
19915672fac9SKenneth D. Merry.It Fl F Ar form1,form2
19925672fac9SKenneth D. MerrySpecify the output format for the attribute values (attr_val) display as a
19935672fac9SKenneth D. Merrycomma separated list of options.
19945672fac9SKenneth D. MerryThe default output is currently set to field_all,nonascii_trim,text_raw.
19955672fac9SKenneth D. MerryOnce this code is ported to FreeBSD 10, any text fields will be converted
19965672fac9SKenneth D. Merryfrom their codeset to the user's native codeset with
19975672fac9SKenneth D. Merry.Xr iconv 3 .
19985672fac9SKenneth D. Merry.Pp
19995672fac9SKenneth D. MerryThe text options are mutually exclusive; if you specify more than one, you
20005672fac9SKenneth D. Merrywill get unpredictable results.
20015672fac9SKenneth D. MerryThe nonascii options are also mutually exclusive.
20025672fac9SKenneth D. MerryMost of the field options may be logically ORed together.
20035672fac9SKenneth D. Merry.Bl -tag -width 12n
20045672fac9SKenneth D. Merry.It text_esc
20055672fac9SKenneth D. MerryPrint text fields with non-ASCII characters escaped.
20065672fac9SKenneth D. Merry.It text_raw
20075672fac9SKenneth D. MerryPrint text fields natively, with no codeset conversion.
20085672fac9SKenneth D. Merry.It nonascii_esc
20095672fac9SKenneth D. MerryIf any non-ASCII characters occur in fields that are supposed to be ASCII,
20105672fac9SKenneth D. Merryescape the non-ASCII characters.
20115672fac9SKenneth D. Merry.It nonascii_trim
20125672fac9SKenneth D. MerryIf any non-ASCII characters occur in fields that are supposed to be ASCII,
20135672fac9SKenneth D. Merryomit the non-ASCII characters.
20145672fac9SKenneth D. Merry.It nonascii_raw
20155672fac9SKenneth D. MerryIf any non-ASCII characters occur in fields that are supposed to be ASCII,
20165672fac9SKenneth D. Merryprint them as they are.
20175672fac9SKenneth D. Merry.It field_all
20185672fac9SKenneth D. MerryPrint all of the prefix fields: description, attribute number, attribute
20195672fac9SKenneth D. Merrysize, and the attribute's readonly status.
20205672fac9SKenneth D. MerryIf field_all is specified, specifying any other field options will not have
20215672fac9SKenneth D. Merryan effect.
20225672fac9SKenneth D. Merry.It field_none
20235672fac9SKenneth D. MerryPrint none of the prefix fields, and only print out the attribute value.
20245672fac9SKenneth D. MerryIf field_none is specified, specifying any other field options will result
20255672fac9SKenneth D. Merryin those fields being printed.
20265672fac9SKenneth D. Merry.It field_desc
20275672fac9SKenneth D. MerryPrint out the attribute description.
20285672fac9SKenneth D. Merry.It field_num
20295672fac9SKenneth D. MerryPrint out the attribute number.
20305672fac9SKenneth D. Merry.It field_size
20315672fac9SKenneth D. MerryPrint out the attribute size.
20325672fac9SKenneth D. Merry.It field_rw
20335672fac9SKenneth D. MerryPrint out the attribute's readonly status.
20345672fac9SKenneth D. Merry.El
20355672fac9SKenneth D. Merry.It Fl p Ar part
20365672fac9SKenneth D. MerrySpecify the partition.
20375672fac9SKenneth D. MerryWhen the media has multiple partitions, specifying different partition
20385672fac9SKenneth D. Merrynumbers allows seeing the values for each individual partition.
20395672fac9SKenneth D. Merry.It Fl s Ar start_num
20405672fac9SKenneth D. MerrySpecify the starting attribute number.
20415672fac9SKenneth D. MerryThis requests that the target device return attribute information starting
20425672fac9SKenneth D. Merryat the given number.
20435672fac9SKenneth D. Merry.It Fl T Ar elem_type
20445672fac9SKenneth D. MerrySpecify the element type.
20455672fac9SKenneth D. MerryFor medium changer devices, this allows specifying the type the element
20465672fac9SKenneth D. Merryreferenced in the element address (
20475672fac9SKenneth D. Merry.Fl e ) .
20485672fac9SKenneth D. MerryValid types are:
20495672fac9SKenneth D. Merry.Dq all ,
20505672fac9SKenneth D. Merry.Dq picker ,
20515672fac9SKenneth D. Merry.Dq slot ,
20525672fac9SKenneth D. Merry.Dq portal ,
20535672fac9SKenneth D. Merryand
20545672fac9SKenneth D. Merry.Dq drive .
20555672fac9SKenneth D. Merry.El
20565672fac9SKenneth D. Merry.It Fl V Ar vol_num
20575672fac9SKenneth D. MerrySpecify the number of the logical volume to operate on.
20585672fac9SKenneth D. MerryIf the media has multiple logical volumes, this will allow displaying
20595672fac9SKenneth D. Merryor writing attributes on the given logical volume.
20600e358df0SKenneth D. Merry.It Ic opcodes
20610e358df0SKenneth D. MerryIssue the REPORT SUPPORTED OPCODES service action of the
20620e358df0SKenneth D. Merry.Tn SCSI
20630e358df0SKenneth D. MerryMAINTENANCE IN
20640e358df0SKenneth D. Merrycommand.
20650e358df0SKenneth D. MerryWithout arguments, this command will return a list of all
20660e358df0SKenneth D. Merry.Tn SCSI
20670e358df0SKenneth D. Merrycommands supported by the device, including service actions of commands
20680e358df0SKenneth D. Merrythat support service actions.
20690e358df0SKenneth D. MerryIt will also include the
20700e358df0SKenneth D. Merry.Tn SCSI
20710e358df0SKenneth D. MerryCDB (Command Data Block) length for each command, and the description of
20720e358df0SKenneth D. Merryeach command if it is known.
20730e358df0SKenneth D. Merry.Bl -tag -width 18n
20740e358df0SKenneth D. Merry.It Fl o Ar opcode
20750e358df0SKenneth D. MerryRequest information on a specific opcode instead of the list of supported
20760e358df0SKenneth D. Merrycommands.
20770e358df0SKenneth D. MerryIf supported, the target will return a CDB-like structure that indicates
20780e358df0SKenneth D. Merrythe opcode, service action (if any), and a mask of bits that are supported
20790e358df0SKenneth D. Merryin that CDB.
20800e358df0SKenneth D. Merry.It Fl s Ar service_action
20810e358df0SKenneth D. MerryFor commands that support a service action, specify the service action to
20820e358df0SKenneth D. Merryquery.
20830e358df0SKenneth D. Merry.It Fl N
20840e358df0SKenneth D. MerryIf a service action is specified for a given opcode, and the device does
20850e358df0SKenneth D. Merrynot support the given service action, the device should not return a
20860e358df0SKenneth D. Merry.Tn SCSI
20870e358df0SKenneth D. Merryerror, but rather indicate in the returned parameter data that the command
20880e358df0SKenneth D. Merryis not supported.
20890e358df0SKenneth D. MerryBy default, if a service action is specified for an opcode, and service
20900e358df0SKenneth D. Merryactions are not supported for the opcode in question, the device will
20910e358df0SKenneth D. Merryreturn an error.
20920e358df0SKenneth D. Merry.It Fl T
20930e358df0SKenneth D. MerryInclude timeout values.
20940e358df0SKenneth D. MerryThis option works with the default display, which includes all commands
20950e358df0SKenneth D. Merrysupported by the device, and with the
20960e358df0SKenneth D. Merry.Fl o
20970e358df0SKenneth D. Merryand
20980e358df0SKenneth D. Merry.Fl s
20990e358df0SKenneth D. Merryoptions, which request information on a specific command and service
21000e358df0SKenneth D. Merryaction.
21010e358df0SKenneth D. MerryThis requests that the device report Nominal and Recommended timeout values
21020e358df0SKenneth D. Merryfor the given command or commands.
21030e358df0SKenneth D. MerryThe timeout values are in seconds.
21040e358df0SKenneth D. MerryThe timeout descriptor also includes a command-specific
21050e358df0SKenneth D. Merry.El
210633fab22eSKenneth D. Merry.It Ic help
21075a251d70SKenneth D. MerryPrint out verbose usage information.
2108525689f1SJustin T. Gibbs.El
2109525689f1SJustin T. Gibbs.Sh ENVIRONMENT
2110525689f1SJustin T. GibbsThe
2111525689f1SJustin T. Gibbs.Ev SCSI_MODES
2112525689f1SJustin T. Gibbsvariable allows the user to specify an alternate mode page format file.
2113525689f1SJustin T. Gibbs.Pp
2114525689f1SJustin T. GibbsThe
2115525689f1SJustin T. Gibbs.Ev EDITOR
2116525689f1SJustin T. Gibbsvariable determines which text editor
21177c7fb079SRuslan Ermilov.Nm
2118525689f1SJustin T. Gibbsstarts when editing mode pages.
2119525689f1SJustin T. Gibbs.Sh FILES
2120525689f1SJustin T. Gibbs.Bl -tag -width /usr/share/misc/scsi_modes -compact
2121525689f1SJustin T. Gibbs.It Pa /usr/share/misc/scsi_modes
2122525689f1SJustin T. Gibbsis the SCSI mode format database.
2123525689f1SJustin T. Gibbs.It Pa /dev/xpt0
2124525689f1SJustin T. Gibbsis the transport layer device.
2125525689f1SJustin T. Gibbs.It Pa /dev/pass*
2126525689f1SJustin T. Gibbsare the CAM application passthrough devices.
2127525689f1SJustin T. Gibbs.El
2128525689f1SJustin T. Gibbs.Sh EXAMPLES
2129525689f1SJustin T. Gibbs.Dl camcontrol eject -n cd -u 1 -v
2130525689f1SJustin T. Gibbs.Pp
2131525689f1SJustin T. GibbsEject the CD from cd1, and print SCSI sense information if the command
2132525689f1SJustin T. Gibbsfails.
2133525689f1SJustin T. Gibbs.Pp
2134b3550398SKenneth D. Merry.Dl camcontrol tur da0
2135525689f1SJustin T. Gibbs.Pp
2136525689f1SJustin T. GibbsSend the SCSI test unit ready command to da0.
2137e1205e80SPhilippe CharnierThe
21387c7fb079SRuslan Ermilov.Nm
2139e1205e80SPhilippe Charnierutility will report whether the disk is ready, but will not display sense
2140525689f1SJustin T. Gibbsinformation if the command fails since the
2141525689f1SJustin T. Gibbs.Fl v
2142525689f1SJustin T. Gibbsswitch was not specified.
2143c7938743SMike Pritchard.Bd -literal -offset indent
2144c60e19a8SKenneth D. Merrycamcontrol tur da1 -E -C 4 -t 50 -v
2145525689f1SJustin T. Gibbs.Ed
2146525689f1SJustin T. Gibbs.Pp
21479806e231SRuslan ErmilovSend a test unit ready command to da1.
21489806e231SRuslan ErmilovEnable kernel error recovery.
21499806e231SRuslan ErmilovSpecify a retry count of 4, and a timeout of 50 seconds.
21509806e231SRuslan ErmilovEnable sense
2151525689f1SJustin T. Gibbsprinting (with the
2152525689f1SJustin T. Gibbs.Fl v
21539806e231SRuslan Ermilovflag) if the command fails.
21549806e231SRuslan ErmilovSince error recovery is turned on, the
2155525689f1SJustin T. Gibbsdisk will be spun up if it is not currently spinning.
2156e1205e80SPhilippe CharnierThe
21577c7fb079SRuslan Ermilov.Nm
2158e1205e80SPhilippe Charnierutility will report whether the disk is ready.
2159c7938743SMike Pritchard.Bd -literal -offset indent
2160525689f1SJustin T. Gibbscamcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
2161525689f1SJustin T. Gibbs	-i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
2162525689f1SJustin T. Gibbs.Ed
2163525689f1SJustin T. Gibbs.Pp
21649806e231SRuslan ErmilovIssue a READ BUFFER command (0x3C) to cd1.
21659806e231SRuslan ErmilovDisplay the buffer size of cd1,
21669806e231SRuslan Ermilovand display the first 10 bytes from the cache on cd1.
21679806e231SRuslan ErmilovDisplay SCSI sense
2168525689f1SJustin T. Gibbsinformation if the command fails.
2169c7938743SMike Pritchard.Bd -literal -offset indent
21708604fe2eSSADA Kenjicamcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
2171525689f1SJustin T. Gibbs	-o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
2172525689f1SJustin T. Gibbs.Ed
2173525689f1SJustin T. Gibbs.Pp
21749806e231SRuslan ErmilovIssue a WRITE BUFFER (0x3B) command to cd1.
21759806e231SRuslan ErmilovWrite out 10 bytes of data,
21769806e231SRuslan Ermilovnot including the (reserved) 4 byte header.
21779806e231SRuslan ErmilovPrint out sense information if
21789806e231SRuslan Ermilovthe command fails.
21799806e231SRuslan ErmilovBe very careful with this command, improper use may
2180525689f1SJustin T. Gibbscause data corruption.
2181c7938743SMike Pritchard.Bd -literal -offset indent
2182c60e19a8SKenneth D. Merrycamcontrol modepage da3 -m 1 -e -P 3
218394d09127SKenneth D. Merry.Ed
2184525689f1SJustin T. Gibbs.Pp
2185525689f1SJustin T. GibbsEdit mode page 1 (the Read-Write Error Recover page) for da3, and save the
21869806e231SRuslan Ermilovsettings on the drive.
21879806e231SRuslan ErmilovMode page 1 contains a disk drive's auto read and
2188525689f1SJustin T. Gibbswrite reallocation settings, among other things.
2189525689f1SJustin T. Gibbs.Pp
21905710d224SKenneth D. Merry.Dl camcontrol rescan all
21915710d224SKenneth D. Merry.Pp
21925710d224SKenneth D. MerryRescan all SCSI busses in the system for devices that have been added,
21935710d224SKenneth D. Merryremoved or changed.
21945710d224SKenneth D. Merry.Pp
2195525689f1SJustin T. Gibbs.Dl camcontrol rescan 0
2196525689f1SJustin T. Gibbs.Pp
2197525689f1SJustin T. GibbsRescan SCSI bus 0 for devices that have been added, removed or changed.
2198525689f1SJustin T. Gibbs.Pp
2199525689f1SJustin T. Gibbs.Dl camcontrol rescan 0:1:0
2200525689f1SJustin T. Gibbs.Pp
2201525689f1SJustin T. GibbsRescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
2202525689f1SJustin T. Gibbschanged.
22039deea857SKenneth D. Merry.Pp
2204c60e19a8SKenneth D. Merry.Dl camcontrol tags da5 -N 24
22059deea857SKenneth D. Merry.Pp
22069deea857SKenneth D. MerrySet the number of concurrent transactions for da5 to 24.
2207c7938743SMike Pritchard.Bd -literal -offset indent
22089deea857SKenneth D. Merrycamcontrol negotiate -n da -u 4 -T disable
22099deea857SKenneth D. Merry.Ed
22109deea857SKenneth D. Merry.Pp
22119deea857SKenneth D. MerryDisable tagged queueing for da4.
2212c7938743SMike Pritchard.Bd -literal -offset indent
22139deea857SKenneth D. Merrycamcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
22149deea857SKenneth D. Merry.Ed
22159deea857SKenneth D. Merry.Pp
22169806e231SRuslan ErmilovNegotiate a sync rate of 20MHz and an offset of 15 with da3.
22179806e231SRuslan ErmilovThen send a
22189deea857SKenneth D. MerryTest Unit Ready command to make the settings take effect.
221906e79492SKenneth D. Merry.Bd -literal -offset indent
222006e79492SKenneth D. Merrycamcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
222106e79492SKenneth D. Merry.Ed
222206e79492SKenneth D. Merry.Pp
222306e79492SKenneth D. MerrySend the SMP REPORT GENERAL command to ses0, and display the number of PHYs
222406e79492SKenneth D. Merryit contains.
222506e79492SKenneth D. MerryDisplay SMP errors if the command fails.
22261146874aSSteven Hartland.Bd -literal -offset indent
22271146874aSSteven Hartlandcamcontrol security ada0
22281146874aSSteven Hartland.Ed
22291146874aSSteven Hartland.Pp
22301146874aSSteven HartlandReport security support and settings for ada0
22311146874aSSteven Hartland.Bd -literal -offset indent
223291804910SGavin Atkinsoncamcontrol security ada0 -U user -s MyPass
22331146874aSSteven Hartland.Ed
22341146874aSSteven Hartland.Pp
22351146874aSSteven HartlandEnable security on device ada0 with the password MyPass
22361146874aSSteven Hartland.Bd -literal -offset indent
223791804910SGavin Atkinsoncamcontrol security ada0 -U user -e MyPass
22381146874aSSteven Hartland.Ed
22391146874aSSteven Hartland.Pp
22401146874aSSteven HartlandSecure erase ada0 which has had security enabled with user password MyPass
22411146874aSSteven Hartland.Pp
22421146874aSSteven Hartland.Em WARNING! WARNING! WARNING!
22431146874aSSteven Hartland.Pp
22441146874aSSteven HartlandThis will
22451146874aSSteven Hartland.Em ERASE ALL
22461146874aSSteven Hartlanddata from the device, so backup your data before using!
22471146874aSSteven Hartland.Pp
22485bb17266SJoel DahlThis command can be used against an SSD drive to restoring it to
22491146874aSSteven Hartlandfactory default write performance.
22509e68761cSSteven Hartland.Bd -literal -offset indent
22519e68761cSSteven Hartlandcamcontrol hpa ada0
22529e68761cSSteven Hartland.Ed
22539e68761cSSteven Hartland.Pp
22549e68761cSSteven HartlandReport HPA support and settings for ada0 (also reported via
22559e68761cSSteven Hartlandidentify).
22569e68761cSSteven Hartland.Bd -literal -offset indent
22579e68761cSSteven Hartlandcamcontrol hpa ada0 -s 10240
22589e68761cSSteven Hartland.Ed
22599e68761cSSteven Hartland.Pp
22609e68761cSSteven HartlandEnables HPA on ada0 setting the maximum reported sectors to 10240.
22619e68761cSSteven Hartland.Pp
22629e68761cSSteven Hartland.Em WARNING! WARNING! WARNING!
22639e68761cSSteven Hartland.Pp
22649e68761cSSteven HartlandThis will
22659e68761cSSteven Hartland.Em PREVENT ACCESS
22669e68761cSSteven Hartlandto all data on the device beyond this limit until HPA is disabled by setting
22679e68761cSSteven HartlandHPA to native max sectors of the device, which can only be done after a
22689e68761cSSteven Hartlandpower-on or hardware reset!
22699e68761cSSteven Hartland.Pp
22709e68761cSSteven Hartland.Em DO NOT
22719e68761cSSteven Hartlanduse this on a device which has an active filesystem!
227208df2e3eSKenneth D. Merry.Bd -literal -offset indent
227308df2e3eSKenneth D. Merrycamcontrol persist da0 -v -i read_keys
227408df2e3eSKenneth D. Merry.Ed
227508df2e3eSKenneth D. Merry.Pp
227608df2e3eSKenneth D. MerryThis will read any persistent reservation keys registered with da0, and
227708df2e3eSKenneth D. Merrydisplay any errors encountered when sending the PERSISTENT RESERVE IN
227808df2e3eSKenneth D. Merry.Tn SCSI
227908df2e3eSKenneth D. Merrycommand.
228008df2e3eSKenneth D. Merry.Bd -literal -offset indent
228108df2e3eSKenneth D. Merrycamcontrol persist da0 -v -o register -a -K 0x12345678
228208df2e3eSKenneth D. Merry.Ed
228308df2e3eSKenneth D. Merry.Pp
228408df2e3eSKenneth D. MerryThis will register the persistent reservation key 0x12345678 with da0,
228508df2e3eSKenneth D. Merryapply that registration to all ports on da0, and display any errors that
228608df2e3eSKenneth D. Merryoccur when sending the PERSISTENT RESERVE OUT command.
228708df2e3eSKenneth D. Merry.Bd -literal -offset indent
228808df2e3eSKenneth D. Merrycamcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
228908df2e3eSKenneth D. Merry.Ed
229008df2e3eSKenneth D. Merry.Pp
229108df2e3eSKenneth D. MerryThis will reserve da0 for the exlusive use of the initiator issuing the
229208df2e3eSKenneth D. Merrycommand.
229308df2e3eSKenneth D. MerryThe scope of the reservation is the entire LUN.
229408df2e3eSKenneth D. MerryAny errors sending the PERSISTENT RESERVE OUT command will be displayed.
229508df2e3eSKenneth D. Merry.Bd -literal -offset indent
229608df2e3eSKenneth D. Merrycamcontrol persist da0 -v -i read_full
229708df2e3eSKenneth D. Merry.Ed
229808df2e3eSKenneth D. Merry.Pp
229908df2e3eSKenneth D. MerryThis will display the full status of all reservations on da0 and print out
230008df2e3eSKenneth D. Merrystatus if there are any errors.
230108df2e3eSKenneth D. Merry.Bd -literal -offset indent
230208df2e3eSKenneth D. Merrycamcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
230308df2e3eSKenneth D. Merry.Ed
230408df2e3eSKenneth D. Merry.Pp
230508df2e3eSKenneth D. MerryThis will release a reservation on da0 of the type ex_ac
230608df2e3eSKenneth D. Merry(Exclusive Access).
230708df2e3eSKenneth D. MerryThe Reservation Key for this registration is 0x12345678.
230808df2e3eSKenneth D. MerryAny errors that occur will be displayed.
230908df2e3eSKenneth D. Merry.Bd -literal -offset indent
231008df2e3eSKenneth D. Merrycamcontrol persist da0 -v -o register -K 0x12345678 -S \e
231108df2e3eSKenneth D. Merry	-I sas,0x1234567812345678 -I sas,0x8765432187654321
231208df2e3eSKenneth D. Merry.Ed
231308df2e3eSKenneth D. Merry.Pp
231408df2e3eSKenneth D. MerryThis will register the key 0x12345678 with da0, specifying that it applies
231508df2e3eSKenneth D. Merryto the SAS initiators with SAS addresses 0x1234567812345678 and
231608df2e3eSKenneth D. Merry0x8765432187654321.
231708df2e3eSKenneth D. Merry.Bd -literal -offset indent
231808df2e3eSKenneth D. Merrycamcontrol persist da0 -v -o register_move -k 0x87654321 \e
231908df2e3eSKenneth D. Merry	-K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
232008df2e3eSKenneth D. Merry.Ed
232108df2e3eSKenneth D. Merry.Pp
232208df2e3eSKenneth D. MerryThis will move the registration from the current initiator, whose
232308df2e3eSKenneth D. MerryRegistration Key is 0x87654321, to the Fibre Channel initiator with the
232408df2e3eSKenneth D. MerryFiber Channel World Wide Node Name 0x1234567812345678.
232508df2e3eSKenneth D. MerryA new registration key, 0x12345678, will be registered for the initiator
232608df2e3eSKenneth D. Merrywith the Fibre Channel World Wide Node Name 0x1234567812345678, and the
232708df2e3eSKenneth D. Merrycurrent initiator will be unregistered from the target.
232808df2e3eSKenneth D. MerryThe reservation will be moved to relative target port 2 on the target
232908df2e3eSKenneth D. Merrydevice.
233008df2e3eSKenneth D. MerryThe registration will persist across power losses.
23315672fac9SKenneth D. Merry.Bd -literal -offset indent
23325672fac9SKenneth D. Merrycamcontrol attrib sa0 -v -i attr_values -p 1
23335672fac9SKenneth D. Merry.Ed
23345672fac9SKenneth D. Merry.Pp
23355672fac9SKenneth D. MerryThis will read and decode the attribute values from partition 1 on the tape
23365672fac9SKenneth D. Merryin tape drive sa0, and will display any
23375672fac9SKenneth D. Merry.Tn SCSI
23385672fac9SKenneth D. Merryerrors that result.
2339525689f1SJustin T. Gibbs.Sh SEE ALSO
2340525689f1SJustin T. Gibbs.Xr cam 3 ,
23419deea857SKenneth D. Merry.Xr cam_cdbparse 3 ,
2342c0bdb22bSMatthew Hunt.Xr cam 4 ,
2343525689f1SJustin T. Gibbs.Xr pass 4 ,
2344c0bdb22bSMatthew Hunt.Xr xpt 4
2345525689f1SJustin T. Gibbs.Sh HISTORY
2346525689f1SJustin T. GibbsThe
23477c7fb079SRuslan Ermilov.Nm
2348e1205e80SPhilippe Charnierutility first appeared in
2349525689f1SJustin T. Gibbs.Fx 3.0 .
2350525689f1SJustin T. Gibbs.Pp
2351525689f1SJustin T. GibbsThe mode page editing code and arbitrary SCSI command code are based upon
2352525689f1SJustin T. Gibbscode in the old
2353525689f1SJustin T. Gibbs.Xr scsi 8
2354525689f1SJustin T. Gibbsutility and
2355525689f1SJustin T. Gibbs.Xr scsi 3
23569806e231SRuslan Ermilovlibrary, written by Julian Elischer and Peter Dufault.
23579806e231SRuslan ErmilovThe
2358525689f1SJustin T. Gibbs.Xr scsi 8
2359753d686dSRuslan Ermilovprogram first appeared in
2360753d686dSRuslan Ermilov.Bx 386 0.1.2.4 ,
2361753d686dSRuslan Ermilovand first appeared in
236233fab22eSKenneth D. Merry.Fx
2363525689f1SJustin T. Gibbsin
2364525689f1SJustin T. Gibbs.Fx 2.0.5 .
2365525689f1SJustin T. Gibbs.Sh AUTHORS
2366bd0891ceSBaptiste Daroussin.An Kenneth Merry Aq Mt ken@FreeBSD.org
2367525689f1SJustin T. Gibbs.Sh BUGS
23680227791bSRuslan ErmilovThe code that parses the generic command line arguments does not know that
23699806e231SRuslan Ermilovsome of the subcommands take multiple arguments.
23709806e231SRuslan ErmilovSo if, for instance, you
2371525689f1SJustin T. Gibbstried something like this:
2372c7938743SMike Pritchard.Bd -literal -offset indent
2373b9e3972aSKenneth D. Merrycamcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
2374525689f1SJustin T. Gibbs.Ed
2375525689f1SJustin T. Gibbs.Pp
2376525689f1SJustin T. GibbsThe sense information from the test unit ready command would not get
2377525689f1SJustin T. Gibbsprinted out, since the first
2378525689f1SJustin T. Gibbs.Xr getopt 3
2379525689f1SJustin T. Gibbscall in
23807c7fb079SRuslan Ermilov.Nm
2381525689f1SJustin T. Gibbsbails out when it sees the second argument to
2382525689f1SJustin T. Gibbs.Fl c
2383c4d9468eSRuslan Ermilov(0x00),
23849806e231SRuslan Ermilovabove.
23859806e231SRuslan ErmilovFixing this behavior would take some gross code, or changes to the
2386525689f1SJustin T. Gibbs.Xr getopt 3
23879806e231SRuslan Ermilovinterface.
23889806e231SRuslan ErmilovThe best way to circumvent this problem is to always make sure
2389525689f1SJustin T. Gibbsto specify generic
23907c7fb079SRuslan Ermilov.Nm
2391525689f1SJustin T. Gibbsarguments before any command-specific arguments.
2392