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.\" 3079c37de6SBryan Venteicher.Dd September 6, 2013 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 44*56dc4e72SScott 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 10133fab22eSKenneth D. Merry.Ic rescan 1025710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 1037c7fb079SRuslan Ermilov.Nm 10433fab22eSKenneth D. Merry.Ic reset 1055710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 1067c7fb079SRuslan Ermilov.Nm 10733fab22eSKenneth D. Merry.Ic defects 108c60e19a8SKenneth D. Merry.Op device id 109525689f1SJustin T. Gibbs.Op generic args 110525689f1SJustin T. Gibbs.Aq Fl f Ar format 111525689f1SJustin T. Gibbs.Op Fl P 112525689f1SJustin T. Gibbs.Op Fl G 1137c7fb079SRuslan Ermilov.Nm 11433fab22eSKenneth D. Merry.Ic modepage 115c60e19a8SKenneth D. Merry.Op device id 116525689f1SJustin T. Gibbs.Op generic args 1179916c5d2SRuslan Ermilov.Aq Fl m Ar page | Fl l 1181ac2383cSBill Fumerola.Op Fl P Ar pgctl 1197e32b20dSKelly Yancey.Op Fl b | Fl e 120525689f1SJustin T. Gibbs.Op Fl d 1217c7fb079SRuslan Ermilov.Nm 12233fab22eSKenneth D. Merry.Ic cmd 123c60e19a8SKenneth D. Merry.Op device id 124525689f1SJustin T. Gibbs.Op generic args 12580976615SAlexander Motin.Aq Fl a Ar cmd Op args 126525689f1SJustin T. Gibbs.Aq Fl c Ar cmd Op args 127f930c0dbSAlexander Motin.Op Fl d 128f930c0dbSAlexander Motin.Op Fl f 129525689f1SJustin T. Gibbs.Op Fl i Ar len Ar fmt 130525689f1SJustin T. Gibbs.Bk -words 131525689f1SJustin T. Gibbs.Op Fl o Ar len Ar fmt Op args 13280976615SAlexander Motin.Op Fl r Ar fmt 133525689f1SJustin T. Gibbs.Ek 1347c7fb079SRuslan Ermilov.Nm 13506e79492SKenneth D. Merry.Ic smpcmd 13606e79492SKenneth D. Merry.Op device id 13706e79492SKenneth D. Merry.Op generic args 13806e79492SKenneth D. Merry.Aq Fl r Ar len Ar fmt Op args 13906e79492SKenneth D. Merry.Aq Fl R Ar len Ar fmt Op args 14006e79492SKenneth D. Merry.Nm 14106e79492SKenneth D. Merry.Ic smprg 14206e79492SKenneth D. Merry.Op device id 14306e79492SKenneth D. Merry.Op generic args 14406e79492SKenneth D. Merry.Op Fl l 14506e79492SKenneth D. Merry.Nm 14606e79492SKenneth D. Merry.Ic smppc 14706e79492SKenneth D. Merry.Op device id 14806e79492SKenneth D. Merry.Op generic args 14906e79492SKenneth D. Merry.Aq Fl p Ar phy 15006e79492SKenneth D. Merry.Op Fl l 15106e79492SKenneth D. Merry.Op Fl o Ar operation 15206e79492SKenneth D. Merry.Op Fl d Ar name 15306e79492SKenneth D. Merry.Op Fl m Ar rate 15406e79492SKenneth D. Merry.Op Fl M Ar rate 15506e79492SKenneth D. Merry.Op Fl T Ar pp_timeout 15606e79492SKenneth D. Merry.Op Fl a Ar enable|disable 15706e79492SKenneth D. Merry.Op Fl A Ar enable|disable 15806e79492SKenneth D. Merry.Op Fl s Ar enable|disable 15906e79492SKenneth D. Merry.Op Fl S Ar enable|disable 16006e79492SKenneth D. Merry.Nm 16106e79492SKenneth D. Merry.Ic smpphylist 16206e79492SKenneth D. Merry.Op device id 16306e79492SKenneth D. Merry.Op generic args 16406e79492SKenneth D. Merry.Op Fl l 16506e79492SKenneth D. Merry.Op Fl q 16606e79492SKenneth D. Merry.Nm 16706e79492SKenneth D. Merry.Ic smpmaninfo 16806e79492SKenneth D. Merry.Op device id 16906e79492SKenneth D. Merry.Op generic args 17006e79492SKenneth D. Merry.Op Fl l 17106e79492SKenneth D. Merry.Nm 17233fab22eSKenneth D. Merry.Ic debug 173525689f1SJustin T. Gibbs.Op Fl I 174a7e5261eSNate Lawson.Op Fl P 175525689f1SJustin T. Gibbs.Op Fl T 176525689f1SJustin T. Gibbs.Op Fl S 177a7e5261eSNate Lawson.Op Fl X 17894d09127SKenneth D. Merry.Op Fl c 179fbfb753fSAlexander Motin.Op Fl p 180525689f1SJustin T. Gibbs.Aq all|off|bus Ns Op :target Ns Op :lun 1817c7fb079SRuslan Ermilov.Nm 18233fab22eSKenneth D. Merry.Ic tags 183c60e19a8SKenneth D. Merry.Op device id 1849deea857SKenneth D. Merry.Op generic args 1859deea857SKenneth D. Merry.Op Fl N Ar tags 1869deea857SKenneth D. Merry.Op Fl q 1879deea857SKenneth D. Merry.Op Fl v 1887c7fb079SRuslan Ermilov.Nm 18933fab22eSKenneth D. Merry.Ic negotiate 190c60e19a8SKenneth D. Merry.Op device id 1919deea857SKenneth D. Merry.Op generic args 1929deea857SKenneth D. Merry.Op Fl c 1939deea857SKenneth D. Merry.Op Fl D Ar enable|disable 194b447e682SAlexander Motin.Op Fl M Ar mode 1959deea857SKenneth D. Merry.Op Fl O Ar offset 1969deea857SKenneth D. Merry.Op Fl q 1979deea857SKenneth D. Merry.Op Fl R Ar syncrate 1989deea857SKenneth D. Merry.Op Fl T Ar enable|disable 1999deea857SKenneth D. Merry.Op Fl U 2009deea857SKenneth D. Merry.Op Fl W Ar bus_width 2019deea857SKenneth D. Merry.Op Fl v 2027c7fb079SRuslan Ermilov.Nm 20333fab22eSKenneth D. Merry.Ic format 20496a93c63SKenneth D. Merry.Op device id 20596a93c63SKenneth D. Merry.Op generic args 20696a93c63SKenneth D. Merry.Op Fl q 207e9e4d3e4SKenneth D. Merry.Op Fl r 20896a93c63SKenneth D. Merry.Op Fl w 20996a93c63SKenneth D. Merry.Op Fl y 2107c7fb079SRuslan Ermilov.Nm 211ffead710SBryan Venteicher.Ic sanitize 212ffead710SBryan Venteicher.Op device id 213ffead710SBryan Venteicher.Op generic args 214ffead710SBryan Venteicher.Aq Fl a Ar overwrite | block | crypto | exitfailure 215ffead710SBryan Venteicher.Op Fl c Ar passes 216ffead710SBryan Venteicher.Op Fl I 217ffead710SBryan Venteicher.Op Fl P Ar pattern 218ffead710SBryan Venteicher.Op Fl q 219ffead710SBryan Venteicher.Op Fl U 220ffead710SBryan Venteicher.Op Fl r 221ffead710SBryan Venteicher.Op Fl w 222ffead710SBryan Venteicher.Op Fl y 223ffead710SBryan Venteicher.Nm 22450c9a276SAlexander Motin.Ic idle 22550c9a276SAlexander Motin.Op device id 22650c9a276SAlexander Motin.Op generic args 22750c9a276SAlexander Motin.Op Fl t Ar time 22850c9a276SAlexander Motin.Nm 22950c9a276SAlexander Motin.Ic standby 23050c9a276SAlexander Motin.Op device id 23150c9a276SAlexander Motin.Op generic args 23250c9a276SAlexander Motin.Op Fl t Ar time 23350c9a276SAlexander Motin.Nm 23450c9a276SAlexander Motin.Ic sleep 23550c9a276SAlexander Motin.Op device id 23650c9a276SAlexander Motin.Op generic args 23750c9a276SAlexander Motin.Nm 2381f4782a4SEd Maste.Ic fwdownload 2391f4782a4SEd Maste.Op device id 2401f4782a4SEd Maste.Op generic args 2411f4782a4SEd Maste.Aq Fl f Ar fw_image 2421f4782a4SEd Maste.Op Fl y 2431f4782a4SEd Maste.Op Fl s 2441f4782a4SEd Maste.Nm 2451146874aSSteven Hartland.Ic security 2461146874aSSteven Hartland.Op device id 2471146874aSSteven Hartland.Op generic args 2481146874aSSteven Hartland.Op Fl d Ar pwd 2491146874aSSteven Hartland.Op Fl e Ar pwd 2501146874aSSteven Hartland.Op Fl f 2511146874aSSteven Hartland.Op Fl h Ar pwd 2521146874aSSteven Hartland.Op Fl k Ar pwd 2531146874aSSteven Hartland.Op Fl l Ar high|maximum 2541146874aSSteven Hartland.Op Fl q 2551146874aSSteven Hartland.Op Fl s Ar pwd 2561146874aSSteven Hartland.Op Fl T Ar timeout 2571146874aSSteven Hartland.Op Fl U Ar user|master 2581146874aSSteven Hartland.Op Fl y 2591146874aSSteven Hartland.Nm 2609e68761cSSteven Hartland.Ic hpa 2619e68761cSSteven Hartland.Op device id 2629e68761cSSteven Hartland.Op generic args 2639e68761cSSteven Hartland.Op Fl f 2649e68761cSSteven Hartland.Op Fl l 2659e68761cSSteven Hartland.Op Fl P 2669e68761cSSteven Hartland.Op Fl p Ar pwd 2679e68761cSSteven Hartland.Op Fl q 2689e68761cSSteven Hartland.Op Fl s Ar max_sectors 2699e68761cSSteven Hartland.Op Fl U Ar pwd 2709e68761cSSteven Hartland.Op Fl y 2719e68761cSSteven Hartland.Nm 27233fab22eSKenneth D. Merry.Ic help 273525689f1SJustin T. Gibbs.Sh DESCRIPTION 274e1205e80SPhilippe CharnierThe 2757c7fb079SRuslan Ermilov.Nm 276e1205e80SPhilippe Charnierutility is designed to provide a way for users to access and control the 27733fab22eSKenneth D. Merry.Fx 278525689f1SJustin T. GibbsCAM subsystem. 279525689f1SJustin T. Gibbs.Pp 280e1205e80SPhilippe CharnierThe 2817c7fb079SRuslan Ermilov.Nm 282e1205e80SPhilippe Charnierutility 2839806e231SRuslan Ermilovcan cause a loss of data and/or system crashes if used improperly. 2849806e231SRuslan ErmilovEven 2859deea857SKenneth D. Merryexpert users are encouraged to exercise caution when using this command. 286525689f1SJustin T. GibbsNovice users should stay away from this utility. 287525689f1SJustin T. Gibbs.Pp 288e1205e80SPhilippe CharnierThe 2897c7fb079SRuslan Ermilov.Nm 290e1205e80SPhilippe Charnierutility has a number of primary functions, many of which support an optional 2919806e231SRuslan Ermilovdevice identifier. 2929806e231SRuslan ErmilovA device identifier can take one of three forms: 2931252c1bbSRuslan Ermilov.Bl -tag -width 14n 294c60e19a8SKenneth D. Merry.It deviceUNIT 295c60e19a8SKenneth D. MerrySpecify a device name and unit number combination, like "da5" or "cd3". 296c60e19a8SKenneth D. Merry.It bus:target 2979806e231SRuslan ErmilovSpecify a bus number and target id. 2989806e231SRuslan ErmilovThe bus number can be determined from 299c60e19a8SKenneth D. Merrythe output of 300c60e19a8SKenneth D. Merry.Dq camcontrol devlist . 301c60e19a8SKenneth D. MerryThe lun defaults to 0. 302c60e19a8SKenneth D. Merry.It bus:target:lun 3039806e231SRuslan ErmilovSpecify the bus, target and lun for a device. 3049806e231SRuslan Ermilov(e.g.\& 1:2:0) 305c60e19a8SKenneth D. Merry.El 306c60e19a8SKenneth D. Merry.Pp 307c60e19a8SKenneth D. MerryThe device identifier, if it is specified, 308c60e19a8SKenneth D. Merry.Em must 309c60e19a8SKenneth D. Merrycome immediately after the function name, and before any generic or 3109806e231SRuslan Ermilovfunction-specific arguments. 3119806e231SRuslan ErmilovNote that the 312c60e19a8SKenneth D. Merry.Fl n 313c60e19a8SKenneth D. Merryand 314c60e19a8SKenneth D. Merry.Fl u 315c60e19a8SKenneth D. Merryarguments described below will override any device name or unit number 3169806e231SRuslan Ermilovspecified beforehand. 3179806e231SRuslan ErmilovThe 318c60e19a8SKenneth D. Merry.Fl n 319c60e19a8SKenneth D. Merryand 320c60e19a8SKenneth D. Merry.Fl u 321c60e19a8SKenneth D. Merryarguments will 322c60e19a8SKenneth D. Merry.Em not 32396a93c63SKenneth D. Merryoverride a specified bus:target or bus:target:lun, however. 324c60e19a8SKenneth D. Merry.Pp 325c60e19a8SKenneth D. MerryMost of the 3267c7fb079SRuslan Ermilov.Nm 327c60e19a8SKenneth D. Merryprimary functions support these generic arguments: 3281252c1bbSRuslan Ermilov.Bl -tag -width 14n 329525689f1SJustin T. Gibbs.It Fl C Ar count 3309806e231SRuslan ErmilovSCSI command retry count. 3319806e231SRuslan ErmilovIn order for this to work, error recovery 3321252c1bbSRuslan Ermilov.Pq Fl E 333525689f1SJustin T. Gibbsmust be turned on. 334525689f1SJustin T. Gibbs.It Fl E 335525689f1SJustin T. GibbsInstruct the kernel to perform generic SCSI error recovery for the given 3369806e231SRuslan Ermilovcommand. 3379806e231SRuslan ErmilovThis is needed in order for the retry count 3381252c1bbSRuslan Ermilov.Pq Fl C 3399806e231SRuslan Ermilovto be honored. 3409806e231SRuslan ErmilovOther than retrying commands, the generic error recovery in 341525689f1SJustin T. Gibbsthe code will generally attempt to spin up drives that are not spinning. 342525689f1SJustin T. GibbsIt may take some other actions, depending upon the sense code returned from 343525689f1SJustin T. Gibbsthe command. 344525689f1SJustin T. Gibbs.It Fl n Ar dev_name 3459806e231SRuslan ErmilovSpecify the device type to operate on, e.g.\& "da", "cd". 346525689f1SJustin T. Gibbs.It Fl t Ar timeout 3479806e231SRuslan ErmilovSCSI command timeout in seconds. 3489806e231SRuslan ErmilovThis overrides the default timeout for 349525689f1SJustin T. Gibbsany given command. 350525689f1SJustin T. Gibbs.It Fl u Ar unit_number 3519806e231SRuslan ErmilovSpecify the device unit number, e.g.\& "1", "5". 352525689f1SJustin T. Gibbs.It Fl v 353525689f1SJustin T. GibbsBe verbose, print out sense information for failed SCSI commands. 354525689f1SJustin T. Gibbs.El 355525689f1SJustin T. Gibbs.Pp 356d13d1cd2SKenneth D. MerryPrimary command functions: 357525689f1SJustin T. Gibbs.Bl -tag -width periphlist 35833fab22eSKenneth D. Merry.It Ic devlist 359525689f1SJustin T. GibbsList all physical devices (logical units) attached to the CAM subsystem. 360525689f1SJustin T. GibbsThis also includes a list of peripheral drivers attached to each device. 361525689f1SJustin T. GibbsWith the 362525689f1SJustin T. Gibbs.Fl v 363525689f1SJustin T. Gibbsargument, SCSI bus number, adapter name and unit numbers are printed as 364525689f1SJustin T. Gibbswell. 365*56dc4e72SScott LongOn the other hand, with the 366*56dc4e72SScott Long.Fl b 367*56dc4e72SScott Longargument, only the bus adapter, and unit information will be printed, and 368*56dc4e72SScott Longdevice information will be omitted. 36933fab22eSKenneth D. Merry.It Ic periphlist 370525689f1SJustin T. GibbsList all peripheral drivers attached to a given physical device (logical 371525689f1SJustin T. Gibbsunit). 37233fab22eSKenneth D. Merry.It Ic tur 373525689f1SJustin T. GibbsSend the SCSI test unit ready (0x00) command to the given device. 374e1205e80SPhilippe CharnierThe 3757c7fb079SRuslan Ermilov.Nm 376e1205e80SPhilippe Charnierutility will report whether the device is ready or not. 37733fab22eSKenneth D. Merry.It Ic inquiry 3789806e231SRuslan ErmilovSend a SCSI inquiry command (0x12) to a device. 3799806e231SRuslan ErmilovBy default, 3807c7fb079SRuslan Ermilov.Nm 381525689f1SJustin T. Gibbswill print out the standard inquiry data, device serial number, and 3829806e231SRuslan Ermilovtransfer rate information. 3839806e231SRuslan ErmilovThe user can specify that only certain types of 384525689f1SJustin T. Gibbsinquiry data be printed: 3851252c1bbSRuslan Ermilov.Bl -tag -width 4n 386525689f1SJustin T. Gibbs.It Fl D 387525689f1SJustin T. GibbsGet the standard inquiry data. 388525689f1SJustin T. Gibbs.It Fl S 3899806e231SRuslan ErmilovPrint out the serial number. 3909806e231SRuslan ErmilovIf this flag is the only one specified, 3917c7fb079SRuslan Ermilov.Nm 392525689f1SJustin T. Gibbswill not print out "Serial Number" before the value returned by the drive. 393525689f1SJustin T. GibbsThis is to aid in script writing. 394525689f1SJustin T. Gibbs.It Fl R 395525689f1SJustin T. GibbsPrint out transfer rate information. 396525689f1SJustin T. Gibbs.El 39752c9ce25SScott Long.It Ic identify 39852c9ce25SScott LongSend a ATA identify command (0xec) to a device. 39942cb6a80SKenneth D. Merry.It Ic reportluns 40042cb6a80SKenneth D. MerrySend the SCSI REPORT LUNS (0xA0) command to the given device. 40142cb6a80SKenneth D. MerryBy default, 40242cb6a80SKenneth D. Merry.Nm 40342cb6a80SKenneth D. Merrywill print out the list of logical units (LUNs) supported by the target device. 40442cb6a80SKenneth D. MerryThere are a couple of options to modify the output: 4058266d476SRuslan Ermilov.Bl -tag -width 14n 40642cb6a80SKenneth D. Merry.It Fl c 40742cb6a80SKenneth D. MerryJust print out a count of LUNs, not the actual LUN numbers. 40842cb6a80SKenneth D. Merry.It Fl l 409b1edef17SJoel DahlJust print out the LUNs, and do not print out the count. 41042cb6a80SKenneth D. Merry.It Fl r Ar reporttype 41142cb6a80SKenneth D. MerrySpecify the type of report to request from the target: 41242cb6a80SKenneth D. Merry.Bl -tag -width 012345678 41342cb6a80SKenneth D. Merry.It default 41442cb6a80SKenneth D. MerryReturn the default report. 41542cb6a80SKenneth D. MerryThis is the 41642cb6a80SKenneth D. Merry.Nm 41742cb6a80SKenneth D. Merrydefault. 41842cb6a80SKenneth D. MerryMost targets will support this report if they support the REPORT LUNS 41942cb6a80SKenneth D. Merrycommand. 42042cb6a80SKenneth D. Merry.It wellknown 42142cb6a80SKenneth D. MerryReturn only well known LUNs. 42242cb6a80SKenneth D. Merry.It all 42342cb6a80SKenneth D. MerryReturn all available LUNs. 42442cb6a80SKenneth D. Merry.El 42542cb6a80SKenneth D. Merry.El 42642cb6a80SKenneth D. Merry.Pp 42742cb6a80SKenneth D. Merry.Nm 42842cb6a80SKenneth D. Merrywill try to print out LUN numbers in a reasonable format. 42942cb6a80SKenneth D. MerryIt can understand the peripheral, flat, LUN and extended LUN formats. 430f553b7b3SKenneth D. Merry.It Ic readcap 431f553b7b3SKenneth D. MerrySend the SCSI READ CAPACITY command to the given device and display 432f553b7b3SKenneth D. Merrythe results. 433f553b7b3SKenneth D. MerryIf the device is larger than 2TB, the SCSI READ CAPACITY (16) service 434f553b7b3SKenneth D. Merryaction will be sent to obtain the full size of the device. 435f553b7b3SKenneth D. MerryBy default, 436f553b7b3SKenneth D. Merry.Nm 437f553b7b3SKenneth D. Merrywill print out the last logical block of the device, and the blocksize of 438f553b7b3SKenneth D. Merrythe device in bytes. 439f553b7b3SKenneth D. MerryTo modify the output format, use the following options: 440f553b7b3SKenneth D. Merry.Bl -tag -width 5n 441f553b7b3SKenneth D. Merry.It Fl b 442f553b7b3SKenneth D. MerryJust print out the blocksize, not the last block or device size. 443f553b7b3SKenneth D. MerryThis cannot be used with 444f553b7b3SKenneth D. Merry.Fl N 445f553b7b3SKenneth D. Merryor 446f553b7b3SKenneth D. Merry.Fl s . 447f553b7b3SKenneth D. Merry.It Fl h 448f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 2, 1K == 1024) format. 449f553b7b3SKenneth D. MerryThis implies 450f553b7b3SKenneth D. Merry.Fl N 451f553b7b3SKenneth D. Merryand cannot be used with 452f553b7b3SKenneth D. Merry.Fl q 453f553b7b3SKenneth D. Merryor 454f553b7b3SKenneth D. Merry.Fl b . 455f553b7b3SKenneth D. Merry.It Fl H 456f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 10, 1K == 1000) format. 457f553b7b3SKenneth D. Merry.It Fl N 458f553b7b3SKenneth D. MerryPrint out the number of blocks in the device instead of the last logical 459f553b7b3SKenneth D. Merryblock. 460f553b7b3SKenneth D. Merry.It Fl q 461f553b7b3SKenneth D. MerryQuiet, print out the numbers only (separated by a comma if 462f553b7b3SKenneth D. Merry.Fl b 463f553b7b3SKenneth D. Merryor 464f553b7b3SKenneth D. Merry.Fl s 465f553b7b3SKenneth D. Merryare not specified). 466f553b7b3SKenneth D. Merry.It Fl s 467f553b7b3SKenneth D. MerryPrint out the last logical block or the size of the device only, and omit 468f553b7b3SKenneth D. Merrythe blocksize. 469f553b7b3SKenneth D. Merry.El 47033fab22eSKenneth D. Merry.It Ic start 471525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 472525689f1SJustin T. Gibbsstart bit set. 47333fab22eSKenneth D. Merry.It Ic stop 474525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 475525689f1SJustin T. Gibbsstart bit cleared. 476f9cecca2SMatthew N. Dodd.It Ic load 477f9cecca2SMatthew N. DoddSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 478f9cecca2SMatthew N. Doddstart bit set and the load/eject bit set. 47933fab22eSKenneth D. Merry.It Ic eject 480525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 481f9cecca2SMatthew N. Doddstart bit cleared and the load/eject bit set. 48233fab22eSKenneth D. Merry.It Ic rescan 4835710d224SKenneth D. MerryTell the kernel to scan all busses in the system (with the 4845710d224SKenneth D. Merry.Ar all 4855710d224SKenneth D. Merryargument), the given bus (XPT_SCAN_BUS), or bus:target:lun 4869806e231SRuslan Ermilov(XPT_SCAN_LUN) for new devices or devices that have gone away. 4879806e231SRuslan ErmilovThe user 4889806e231SRuslan Ermilovmay specify a scan of all busses, a single bus, or a lun. 4899806e231SRuslan ErmilovScanning all luns 4900227791bSRuslan Ermilovon a target is not supported. 49133fab22eSKenneth D. Merry.It Ic reset 4925710d224SKenneth D. MerryTell the kernel to reset all busses in the system (with the 4935710d224SKenneth D. Merry.Ar all 4945710d224SKenneth D. Merryargument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus 495a2a44836SMatt Jacobreset for that bus, or to reset the given bus:target:lun 496a2a44836SMatt Jacob(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after 497ef8f7ac9SSheldon Hearnconnecting to that device. 498ef8f7ac9SSheldon HearnNote that this can have a destructive impact 499a2a44836SMatt Jacobon the system. 50033fab22eSKenneth D. Merry.It Ic defects 501525689f1SJustin T. GibbsSend the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and 502525689f1SJustin T. Gibbsprint out any combination of: the total number of defects, the primary 503525689f1SJustin T. Gibbsdefect list (PLIST), and the grown defect list (GLIST). 5041252c1bbSRuslan Ermilov.Bl -tag -width 11n 505525689f1SJustin T. Gibbs.It Fl f Ar format 506525689f1SJustin T. GibbsThe three format options are: 507525689f1SJustin T. Gibbs.Em block , 508525689f1SJustin T. Gibbsto print out the list as logical blocks, 509525689f1SJustin T. Gibbs.Em bfi , 510525689f1SJustin T. Gibbsto print out the list in bytes from index format, and 511525689f1SJustin T. Gibbs.Em phys , 5129806e231SRuslan Ermilovto print out the list in physical sector format. 5139806e231SRuslan ErmilovThe format argument is 5149806e231SRuslan Ermilovrequired. 5159806e231SRuslan ErmilovMost drives support the physical sector format. 5169806e231SRuslan ErmilovSome drives 5179806e231SRuslan Ermilovsupport the logical block format. 5180227791bSRuslan ErmilovMany drives, if they do not support the 519525689f1SJustin T. Gibbsrequested format, return the data in an alternate format, along with sense 5200227791bSRuslan Ermilovinformation indicating that the requested data format is not supported. 521e1205e80SPhilippe CharnierThe 5227c7fb079SRuslan Ermilov.Nm 523e1205e80SPhilippe Charnierutility 524525689f1SJustin T. Gibbsattempts to detect this, and print out whatever format the drive returns. 5250227791bSRuslan ErmilovIf the drive uses a non-standard sense code to report that it does not 526525689f1SJustin T. Gibbssupport the requested format, 5277c7fb079SRuslan Ermilov.Nm 528525689f1SJustin T. Gibbswill probably see the error as a failure to complete the request. 529525689f1SJustin T. Gibbs.It Fl G 5309806e231SRuslan ErmilovPrint out the grown defect list. 5319806e231SRuslan ErmilovThis is a list of bad blocks that have 532525689f1SJustin T. Gibbsbeen remapped since the disk left the factory. 533525689f1SJustin T. Gibbs.It Fl P 534525689f1SJustin T. GibbsPrint out the primary defect list. 535525689f1SJustin T. Gibbs.El 536525689f1SJustin T. Gibbs.Pp 537525689f1SJustin T. GibbsIf neither 538525689f1SJustin T. Gibbs.Fl P 539525689f1SJustin T. Gibbsnor 540525689f1SJustin T. Gibbs.Fl G 541525689f1SJustin T. Gibbsis specified, 5427c7fb079SRuslan Ermilov.Nm 543525689f1SJustin T. Gibbswill print out the number of defects given in the READ DEFECT DATA header 544525689f1SJustin T. Gibbsreturned from the drive. 5457027b9cdSKenneth D. MerrySome drives will report 0 defects if neither the primary or grown defect 5467027b9cdSKenneth D. Merrylists are requested. 54733fab22eSKenneth D. Merry.It Ic modepage 5489806e231SRuslan ErmilovAllows the user to display and optionally edit a SCSI mode page. 5499806e231SRuslan ErmilovThe mode 550525689f1SJustin T. Gibbspage formats are located in 551525689f1SJustin T. Gibbs.Pa /usr/share/misc/scsi_modes . 552525689f1SJustin T. GibbsThis can be overridden by specifying a different file in the 553525689f1SJustin T. Gibbs.Ev SCSI_MODES 55433fab22eSKenneth D. Merryenvironment variable. 55533fab22eSKenneth D. MerryThe 55633fab22eSKenneth D. Merry.Ic modepage 55733fab22eSKenneth D. Merrycommand takes several arguments: 5581252c1bbSRuslan Ermilov.Bl -tag -width 12n 5599deea857SKenneth D. Merry.It Fl d 560525689f1SJustin T. GibbsDisable block descriptors for mode sense. 5617e32b20dSKelly Yancey.It Fl b 5627e32b20dSKelly YanceyDisplays mode page data in binary format. 563525689f1SJustin T. Gibbs.It Fl e 5649806e231SRuslan ErmilovThis flag allows the user to edit values in the mode page. 5659806e231SRuslan ErmilovThe user may 5667e32b20dSKelly Yanceyeither edit mode page values with the text editor pointed to by his 5677e32b20dSKelly Yancey.Ev EDITOR 5687e32b20dSKelly Yanceyenvironment variable, or supply mode page values via standard input, using 5697e32b20dSKelly Yanceythe same format that 5707c7fb079SRuslan Ermilov.Nm 5719806e231SRuslan Ermilovuses to display mode page values. 5729806e231SRuslan ErmilovThe editor will be invoked if 5737c7fb079SRuslan Ermilov.Nm 5747e32b20dSKelly Yanceydetects that standard input is terminal. 5757e32b20dSKelly Yancey.It Fl l 5767e32b20dSKelly YanceyLists all available mode pages. 577525689f1SJustin T. Gibbs.It Fl m Ar mode_page 578525689f1SJustin T. GibbsThis specifies the number of the mode page the user would like to view 5799806e231SRuslan Ermilovand/or edit. 5809806e231SRuslan ErmilovThis argument is mandatory unless 5819402dd99SKelly Yancey.Fl l 5829402dd99SKelly Yanceyis specified. 5831ac2383cSBill Fumerola.It Fl P Ar pgctl 5849806e231SRuslan ErmilovThis allows the user to specify the page control field. 5859806e231SRuslan ErmilovPossible values are: 586525689f1SJustin T. Gibbs.Bl -tag -width xxx -compact 58746a1f3b4SKenneth D. Merry.It 0 588525689f1SJustin T. GibbsCurrent values 58946a1f3b4SKenneth D. Merry.It 1 590525689f1SJustin T. GibbsChangeable values 59146a1f3b4SKenneth D. Merry.It 2 592525689f1SJustin T. GibbsDefault values 59346a1f3b4SKenneth D. Merry.It 3 594525689f1SJustin T. GibbsSaved values 595525689f1SJustin T. Gibbs.El 596525689f1SJustin T. Gibbs.El 59733fab22eSKenneth D. Merry.It Ic cmd 59880976615SAlexander MotinAllows the user to send an arbitrary ATA or SCSI CDB to any device. 59933fab22eSKenneth D. MerryThe 60033fab22eSKenneth D. Merry.Ic cmd 601525689f1SJustin T. Gibbsfunction requires the 602525689f1SJustin T. Gibbs.Fl c 60380976615SAlexander Motinargument to specify SCSI CDB or the 60480976615SAlexander Motin.Fl a 60580976615SAlexander Motinargument to specify ATA Command Block registers values. 6069806e231SRuslan ErmilovOther arguments are optional, depending on 6079806e231SRuslan Ermilovthe command type. 6089806e231SRuslan ErmilovThe command and data specification syntax is documented 609525689f1SJustin T. Gibbsin 61096a93c63SKenneth D. Merry.Xr cam_cdbparse 3 . 611a53bb70bSJoel DahlNOTE: If the CDB specified causes data to be transferred to or from the 612525689f1SJustin T. GibbsSCSI device in question, you MUST specify either 613525689f1SJustin T. Gibbs.Fl i 614525689f1SJustin T. Gibbsor 615525689f1SJustin T. Gibbs.Fl o . 6161252c1bbSRuslan Ermilov.Bl -tag -width 17n 61780976615SAlexander Motin.It Fl a Ar cmd Op args 61880976615SAlexander MotinThis specifies the content of 12 ATA Command Block registers (command, 61980976615SAlexander Motinfeatures, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp. 62080976615SAlexander Motinlba_high_exp, features_exp, sector_count, sector_count_exp). 621525689f1SJustin T. Gibbs.It Fl c Ar cmd Op args 6229806e231SRuslan ErmilovThis specifies the SCSI CDB. 62380976615SAlexander MotinSCSI CDBs may be 6, 10, 12 or 16 bytes. 624f930c0dbSAlexander Motin.It Fl d 625f930c0dbSAlexander MotinSpecifies DMA protocol to be used for ATA command. 626f930c0dbSAlexander Motin.It Fl f 627f930c0dbSAlexander MotinSpecifies FPDMA (NCQ) protocol to be used for ATA command. 628525689f1SJustin T. Gibbs.It Fl i Ar len Ar fmt 629525689f1SJustin T. GibbsThis specifies the amount of data to read, and how it should be displayed. 630525689f1SJustin T. GibbsIf the format is 631525689f1SJustin T. Gibbs.Sq - , 632525689f1SJustin T. Gibbs.Ar len 633525689f1SJustin T. Gibbsbytes of data will be read from the device and written to standard output. 634525689f1SJustin T. Gibbs.It Fl o Ar len Ar fmt Op args 635525689f1SJustin T. GibbsThis specifies the amount of data to be written to a device, and the data 6369806e231SRuslan Ermilovthat is to be written. 6379806e231SRuslan ErmilovIf the format is 638525689f1SJustin T. Gibbs.Sq - , 639525689f1SJustin T. Gibbs.Ar len 640525689f1SJustin T. Gibbsbytes of data will be read from standard input and written to the device. 64180976615SAlexander Motin.It Fl r Ar fmt 64280976615SAlexander MotinThis specifies that 11 result ATA Command Block registers should be displayed 64380976615SAlexander Motin(status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp, 64480976615SAlexander Motinlba_high_exp, sector_count, sector_count_exp), and how. 64580976615SAlexander MotinIf the format is 64680976615SAlexander Motin.Sq - , 64780976615SAlexander Motin11 result registers will be written to standard output in hex. 648525689f1SJustin T. Gibbs.El 64906e79492SKenneth D. Merry.It Ic smpcmd 65006e79492SKenneth D. MerryAllows the user to send an arbitrary Serial 65106e79492SKenneth D. MerryManagement Protocol (SMP) command to a device. 65206e79492SKenneth D. MerryThe 65306e79492SKenneth D. Merry.Ic smpcmd 65406e79492SKenneth D. Merryfunction requires the 65506e79492SKenneth D. Merry.Fl r 65606e79492SKenneth D. Merryargument to specify the SMP request to be sent, and the 65706e79492SKenneth D. Merry.Fl R 65806e79492SKenneth D. Merryargument to specify the format of the SMP response. 65906e79492SKenneth D. MerryThe syntax for the SMP request and response arguments is documented in 66006e79492SKenneth D. Merry.Xr cam_cdbparse 3 . 66106e79492SKenneth D. Merry.Pp 66206e79492SKenneth D. MerryNote that SAS adapters that support SMP passthrough (at least the currently 66306e79492SKenneth D. Merryknown adapters) do not accept CRC bytes from the user in the request and do 66406e79492SKenneth D. Merrynot pass CRC bytes back to the user in the response. 66506e79492SKenneth D. MerryTherefore users should not include the CRC bytes in the length of the 66606e79492SKenneth D. Merryrequest and not expect CRC bytes to be returned in the response. 66706e79492SKenneth D. Merry.Bl -tag -width 17n 66806e79492SKenneth D. Merry.It Fl r Ar len Ar fmt Op args 66906e79492SKenneth D. MerryThis specifies the size of the SMP request, without the CRC bytes, and the 6705bb17266SJoel DahlSMP request format. 6715bb17266SJoel DahlIf the format is 67206e79492SKenneth D. Merry.Sq - , 67306e79492SKenneth D. Merry.Ar len 67406e79492SKenneth D. Merrybytes of data will be read from standard input and written as the SMP 67506e79492SKenneth D. Merryrequest. 67606e79492SKenneth D. Merry.It Fl R Ar len Ar fmt Op args 67706e79492SKenneth D. MerryThis specifies the size of the buffer allocated for the SMP response, and 67806e79492SKenneth D. Merrythe SMP response format. 67906e79492SKenneth D. MerryIf the format is 68006e79492SKenneth D. Merry.Sq - , 68106e79492SKenneth D. Merry.Ar len 68206e79492SKenneth D. Merrybytes of data will be allocated for the response and the response will be 68306e79492SKenneth D. Merrywritten to standard output. 68406e79492SKenneth D. Merry.El 68506e79492SKenneth D. Merry.It Ic smprg 68606e79492SKenneth D. MerryAllows the user to send the Serial Management Protocol (SMP) Report General 68706e79492SKenneth D. Merrycommand to a device. 68806e79492SKenneth D. Merry.Nm 68906e79492SKenneth D. Merrywill display the data returned by the Report General command. 69006e79492SKenneth D. MerryIf the SMP target supports the long response format, the additional data 69106e79492SKenneth D. Merrywill be requested and displayed automatically. 69206e79492SKenneth D. Merry.Bl -tag -width 8n 69306e79492SKenneth D. Merry.It Fl l 69406e79492SKenneth D. MerryRequest the long response format only. 69506e79492SKenneth D. MerryNot all SMP targets support the long response format. 69606e79492SKenneth D. MerryThis option causes 69706e79492SKenneth D. Merry.Nm 69806e79492SKenneth D. Merryto skip sending the initial report general request without the long bit set 69906e79492SKenneth D. Merryand only issue a report general request with the long bit set. 70006e79492SKenneth D. Merry.El 70106e79492SKenneth D. Merry.It Ic smppc 70206e79492SKenneth D. MerryAllows the user to issue the Serial Management Protocol (SMP) PHY Control 70306e79492SKenneth D. Merrycommand to a device. 70406e79492SKenneth D. MerryThis function should be used with some caution, as it can render devices 70506e79492SKenneth D. Merryinaccessible, and could potentially cause data corruption as well. 70606e79492SKenneth D. MerryThe 70706e79492SKenneth D. Merry.Fl p 70806e79492SKenneth D. Merryargument is required to specify the PHY to operate on. 70906e79492SKenneth D. Merry.Bl -tag -width 17n 71006e79492SKenneth D. Merry.It Fl p Ar phy 71106e79492SKenneth D. MerrySpecify the PHY to operate on. 71206e79492SKenneth D. MerryThis argument is required. 71306e79492SKenneth D. Merry.It Fl l 71406e79492SKenneth D. MerryRequest the long request/response format. 71506e79492SKenneth D. MerryNot all SMP targets support the long response format. 71606e79492SKenneth D. MerryFor the PHY Control command, this currently only affects whether the 71706e79492SKenneth D. Merryrequest length is set to a value other than 0. 71806e79492SKenneth D. Merry.It Fl o Ar operation 71906e79492SKenneth D. MerrySpecify a PHY control operation. 72006e79492SKenneth D. MerryOnly one 72106e79492SKenneth D. Merry.Fl o 72206e79492SKenneth D. Merryoperation may be specified. 72306e79492SKenneth D. MerryThe operation may be specified numerically (in decimal, hexadecimal, or octal) 72406e79492SKenneth D. Merryor one of the following operation names may be specified: 72506e79492SKenneth D. Merry.Bl -tag -width 16n 72606e79492SKenneth D. Merry.It nop 72706e79492SKenneth D. MerryNo operation. 72806e79492SKenneth D. MerryIt is not necessary to specify this argument. 72906e79492SKenneth D. Merry.It linkreset 73006e79492SKenneth D. MerrySend the LINK RESET command to the phy. 73106e79492SKenneth D. Merry.It hardreset 73206e79492SKenneth D. MerrySend the HARD RESET command to the phy. 73306e79492SKenneth D. Merry.It disable 73406e79492SKenneth D. MerrySend the DISABLE command to the phy. 73506e79492SKenneth D. MerryNote that the LINK RESET or HARD RESET commands should re-enable the phy. 736ee5320f4SKenneth D. Merry.It clearerrlog 73706e79492SKenneth D. MerrySend the CLEAR ERROR LOG command. 73806e79492SKenneth D. MerryThis clears the error log counters for the specified phy. 73906e79492SKenneth D. Merry.It clearaffiliation 74006e79492SKenneth D. MerrySend the CLEAR AFFILIATION command. 74106e79492SKenneth D. MerryThis clears the affiliation from the STP initiator port with the same SAS 74206e79492SKenneth D. Merryaddress as the SMP initiator that requests the clear operation. 74306e79492SKenneth D. Merry.It sataportsel 74406e79492SKenneth D. MerrySend the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy. 74506e79492SKenneth D. MerryThis will cause a SATA port selector to use the given phy as its active phy 74606e79492SKenneth D. Merryand make the other phy inactive. 74706e79492SKenneth D. Merry.It clearitnl 74806e79492SKenneth D. MerrySend the CLEAR STP I_T NEXUS LOSS command to the PHY. 74906e79492SKenneth D. Merry.It setdevname 75006e79492SKenneth D. MerrySend the SET ATTACHED DEVICE NAME command to the PHY. 75106e79492SKenneth D. MerryThis requires the 75206e79492SKenneth D. Merry.Fl d 75306e79492SKenneth D. Merryargument to specify the device name. 75406e79492SKenneth D. Merry.El 75506e79492SKenneth D. Merry.It Fl d Ar name 75606e79492SKenneth D. MerrySpecify the attached device name. 75706e79492SKenneth D. MerryThis option is needed with the 75806e79492SKenneth D. Merry.Fl o Ar setdevname 75906e79492SKenneth D. Merryphy operation. 76006e79492SKenneth D. MerryThe name is a 64-bit number, and can be specified in decimal, hexadecimal 76106e79492SKenneth D. Merryor octal format. 76206e79492SKenneth D. Merry.It Fl m Ar rate 76306e79492SKenneth D. MerrySet the minimum physical link rate for the phy. 76406e79492SKenneth D. MerryThis is a numeric argument. 76506e79492SKenneth D. MerryCurrently known link rates are: 76606e79492SKenneth D. Merry.Bl -tag -width 5n 76706e79492SKenneth D. Merry.It 0x0 76806e79492SKenneth D. MerryDo not change current value. 76906e79492SKenneth D. Merry.It 0x8 77006e79492SKenneth D. Merry1.5 Gbps 77106e79492SKenneth D. Merry.It 0x9 77206e79492SKenneth D. Merry3 Gbps 77306e79492SKenneth D. Merry.It 0xa 77406e79492SKenneth D. Merry6 Gbps 77506e79492SKenneth D. Merry.El 77606e79492SKenneth D. Merry.Pp 77706e79492SKenneth D. MerryOther values may be specified for newer physical link rates. 77806e79492SKenneth D. Merry.It Fl M Ar rate 77906e79492SKenneth D. MerrySet the maximum physical link rate for the phy. 78006e79492SKenneth D. MerryThis is a numeric argument. 78106e79492SKenneth D. MerrySee the 78206e79492SKenneth D. Merry.Fl m 78306e79492SKenneth D. Merryargument description for known link rate arguments. 78406e79492SKenneth D. Merry.It Fl T Ar pp_timeout 78506e79492SKenneth D. MerrySet the partial pathway timeout value, in microseconds. 78606e79492SKenneth D. MerrySee the 78706e79492SKenneth D. Merry.Tn ANSI 78806e79492SKenneth D. Merry.Tn SAS 78919769ec2SJoel DahlProtocol Layer (SPL) 79006e79492SKenneth D. Merryspecification for more information on this field. 79106e79492SKenneth D. Merry.It Fl a Ar enable|disable 79206e79492SKenneth D. MerryEnable or disable SATA slumber phy power conditions. 79306e79492SKenneth D. Merry.It Fl A Ar enable|disable 79406e79492SKenneth D. MerryEnable or disable SATA partial power conditions. 79506e79492SKenneth D. Merry.It Fl s Ar enable|disable 79606e79492SKenneth D. MerryEnable or disable SAS slumber phy power conditions. 79706e79492SKenneth D. Merry.It Fl S Ar enable|disable 79806e79492SKenneth D. MerryEnable or disable SAS partial phy power conditions. 79906e79492SKenneth D. Merry.El 80006e79492SKenneth D. Merry.It Ic smpphylist 80106e79492SKenneth D. MerryList phys attached to a SAS expander, the address of the end device 80206e79492SKenneth D. Merryattached to the phy, and the inquiry data for that device and peripheral 80306e79492SKenneth D. Merrydevices attached to that device. 80406e79492SKenneth D. MerryThe inquiry data and peripheral devices are displayed if available. 80506e79492SKenneth D. Merry.Bl -tag -width 5n 80606e79492SKenneth D. Merry.It Fl l 80706e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for 80806e79492SKenneth D. Merrythis command. 80906e79492SKenneth D. Merry.It Fl q 81006e79492SKenneth D. MerryOnly print out phys that are attached to a device in the CAM EDT (Existing 81106e79492SKenneth D. MerryDevice Table). 81206e79492SKenneth D. Merry.El 81306e79492SKenneth D. Merry.It Ic smpmaninfo 81406e79492SKenneth D. MerrySend the SMP Report Manufacturer Information command to the device and 81506e79492SKenneth D. Merrydisplay the response. 81606e79492SKenneth D. Merry.Bl -tag -width 5n 81706e79492SKenneth D. Merry.It Fl l 81806e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for 81906e79492SKenneth D. Merrythis command. 82006e79492SKenneth D. Merry.El 82133fab22eSKenneth D. Merry.It Ic debug 8229806e231SRuslan ErmilovTurn on CAM debugging printfs in the kernel. 8239806e231SRuslan ErmilovThis requires options CAMDEBUG 8249806e231SRuslan Ermilovin your kernel config file. 8259806e231SRuslan ErmilovWARNING: enabling debugging printfs currently 8269806e231SRuslan Ermilovcauses an EXTREME number of kernel printfs. 8279806e231SRuslan ErmilovYou may have difficulty 828525689f1SJustin T. Gibbsturning off the debugging printfs once they start, since the kernel will be 829525689f1SJustin T. Gibbsbusy printing messages and unable to service other requests quickly. 83033fab22eSKenneth D. MerryThe 83133fab22eSKenneth D. Merry.Ic debug 83233fab22eSKenneth D. Merryfunction takes a number of arguments: 8331252c1bbSRuslan Ermilov.Bl -tag -width 18n 834525689f1SJustin T. Gibbs.It Fl I 835525689f1SJustin T. GibbsEnable CAM_DEBUG_INFO printfs. 836a7e5261eSNate Lawson.It Fl P 837a7e5261eSNate LawsonEnable CAM_DEBUG_PERIPH printfs. 838525689f1SJustin T. Gibbs.It Fl T 839525689f1SJustin T. GibbsEnable CAM_DEBUG_TRACE printfs. 840525689f1SJustin T. Gibbs.It Fl S 841525689f1SJustin T. GibbsEnable CAM_DEBUG_SUBTRACE printfs. 842a7e5261eSNate Lawson.It Fl X 843a7e5261eSNate LawsonEnable CAM_DEBUG_XPT printfs. 844d05caa00SKenneth D. Merry.It Fl c 8459806e231SRuslan ErmilovEnable CAM_DEBUG_CDB printfs. 8469806e231SRuslan ErmilovThis will cause the kernel to print out the 847d05caa00SKenneth D. MerrySCSI CDBs sent to the specified device(s). 848fbfb753fSAlexander Motin.It Fl p 849fbfb753fSAlexander MotinEnable CAM_DEBUG_PROBE printfs. 850525689f1SJustin T. Gibbs.It all 851525689f1SJustin T. GibbsEnable debugging for all devices. 852525689f1SJustin T. Gibbs.It off 853525689f1SJustin T. GibbsTurn off debugging for all devices 854525689f1SJustin T. Gibbs.It bus Ns Op :target Ns Op :lun 8559806e231SRuslan ErmilovTurn on debugging for the given bus, target or lun. 8569806e231SRuslan ErmilovIf the lun or target 8579806e231SRuslan Ermilovand lun are not specified, they are wildcarded. 8589806e231SRuslan Ermilov(i.e., just specifying a 859525689f1SJustin T. Gibbsbus turns on debugging printfs for all devices on that bus.) 860525689f1SJustin T. Gibbs.El 86133fab22eSKenneth D. Merry.It Ic tags 8629deea857SKenneth D. MerryShow or set the number of "tagged openings" or simultaneous transactions 8639806e231SRuslan Ermilovwe attempt to queue to a particular device. 8649806e231SRuslan ErmilovBy default, the 86533fab22eSKenneth D. Merry.Ic tags 8669806e231SRuslan Ermilovcommand, with no command-specific arguments (i.e., only generic arguments) 8679deea857SKenneth D. Merryprints out the "soft" maximum number of transactions that can be queued to 8689806e231SRuslan Ermilovthe device in question. 8699806e231SRuslan ErmilovFor more detailed information, use the 8709deea857SKenneth D. Merry.Fl v 8719deea857SKenneth D. Merryargument described below. 8721252c1bbSRuslan Ermilov.Bl -tag -width 7n 8739deea857SKenneth D. Merry.It Fl N Ar tags 8749806e231SRuslan ErmilovSet the number of tags for the given device. 8759806e231SRuslan ErmilovThis must be between the 8769806e231SRuslan Ermilovminimum and maximum number set in the kernel quirk table. 8779806e231SRuslan ErmilovThe default for 8789deea857SKenneth D. Merrymost devices that support tagged queueing is a minimum of 2 and a maximum 8799806e231SRuslan Ermilovof 255. 8809806e231SRuslan ErmilovThe minimum and maximum values for a given device may be 8819deea857SKenneth D. Merrydetermined by using the 8829deea857SKenneth D. Merry.Fl v 8839806e231SRuslan Ermilovswitch. 8849806e231SRuslan ErmilovThe meaning of the 8859deea857SKenneth D. Merry.Fl v 8869deea857SKenneth D. Merryswitch for this 8877c7fb079SRuslan Ermilov.Nm 8889deea857SKenneth D. Merrysubcommand is described below. 8899deea857SKenneth D. Merry.It Fl q 8900227791bSRuslan ErmilovBe quiet, and do not report the number of tags. 8919806e231SRuslan ErmilovThis is generally used when 8929deea857SKenneth D. Merrysetting the number of tags. 8939deea857SKenneth D. Merry.It Fl v 8949deea857SKenneth D. MerryThe verbose flag has special functionality for the 8959deea857SKenneth D. Merry.Em tags 8969806e231SRuslan Ermilovargument. 8979806e231SRuslan ErmilovIt causes 8987c7fb079SRuslan Ermilov.Nm 8999deea857SKenneth D. Merryto print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB: 9001252c1bbSRuslan Ermilov.Bl -tag -width 13n 9019deea857SKenneth D. Merry.It dev_openings 9029deea857SKenneth D. MerryThis is the amount of capacity for transactions queued to a given device. 9039deea857SKenneth D. Merry.It dev_active 9049deea857SKenneth D. MerryThis is the number of transactions currently queued to a device. 9059deea857SKenneth D. Merry.It devq_openings 9069806e231SRuslan ErmilovThis is the kernel queue space for transactions. 9079806e231SRuslan ErmilovThis count usually mirrors 9089deea857SKenneth D. Merrydev_openings except during error recovery operations when 9099deea857SKenneth D. Merrythe device queue is frozen (device is not allowed to receive 9109deea857SKenneth D. Merrycommands), the number of dev_openings is reduced, or transaction 9119deea857SKenneth D. Merryreplay is occurring. 9129deea857SKenneth D. Merry.It devq_queued 9139deea857SKenneth D. MerryThis is the number of transactions waiting in the kernel queue for capacity 9149806e231SRuslan Ermilovon the device. 9159806e231SRuslan ErmilovThis number is usually zero unless error recovery is in 9169deea857SKenneth D. Merryprogress. 9179deea857SKenneth D. Merry.It held 9189deea857SKenneth D. MerryThe held count is the number of CCBs held by peripheral drivers that have 9199deea857SKenneth D. Merryeither just been completed or are about to be released to the transport 9209806e231SRuslan Ermilovlayer for service by a device. 9219806e231SRuslan ErmilovHeld CCBs reserve capacity on a given 9229deea857SKenneth D. Merrydevice. 9239deea857SKenneth D. Merry.It mintags 9249deea857SKenneth D. MerryThis is the current "hard" minimum number of transactions that can be 9259806e231SRuslan Ermilovqueued to a device at once. 9269806e231SRuslan ErmilovThe 9279deea857SKenneth D. Merry.Ar dev_openings 9289806e231SRuslan Ermilovvalue above cannot go below this number. 9299806e231SRuslan ErmilovThe default value for 9309deea857SKenneth D. Merry.Ar mintags 9319deea857SKenneth D. Merryis 2, although it may be set higher or lower for various devices. 9329deea857SKenneth D. Merry.It maxtags 9339deea857SKenneth D. MerryThis is the "hard" maximum number of transactions that can be queued to a 9349806e231SRuslan Ermilovdevice at one time. 9359806e231SRuslan ErmilovThe 9369deea857SKenneth D. Merry.Ar dev_openings 9379806e231SRuslan Ermilovvalue cannot go above this number. 9389806e231SRuslan ErmilovThe default value for 9399deea857SKenneth D. Merry.Ar maxtags 9409deea857SKenneth D. Merryis 255, although it may be set higher or lower for various devices. 9419deea857SKenneth D. Merry.El 9429deea857SKenneth D. Merry.El 94333fab22eSKenneth D. Merry.It Ic negotiate 9449806e231SRuslan ErmilovShow or negotiate various communication parameters. 9459806e231SRuslan ErmilovSome controllers may 9469806e231SRuslan Ermilovnot support setting or changing some of these values. 9479806e231SRuslan ErmilovFor instance, the 9489deea857SKenneth D. MerryAdaptec 174x controllers do not support changing a device's sync rate or 9499deea857SKenneth D. Merryoffset. 950e1205e80SPhilippe CharnierThe 9517c7fb079SRuslan Ermilov.Nm 952e1205e80SPhilippe Charnierutility 9539deea857SKenneth D. Merrywill not attempt to set the parameter if the controller indicates that it 9549806e231SRuslan Ermilovdoes not support setting the parameter. 9559806e231SRuslan ErmilovTo find out what the controller 9569deea857SKenneth D. Merrysupports, use the 9579deea857SKenneth D. Merry.Fl v 9589806e231SRuslan Ermilovflag. 9599806e231SRuslan ErmilovThe meaning of the 9609deea857SKenneth D. Merry.Fl v 9619deea857SKenneth D. Merryflag for the 96233fab22eSKenneth D. Merry.Ic negotiate 9639806e231SRuslan Ermilovcommand is described below. 9640227791bSRuslan ErmilovAlso, some controller drivers do not support 9659deea857SKenneth D. Merrysetting negotiation parameters, even if the underlying controller supports 9669806e231SRuslan Ermilovnegotiation changes. 9679806e231SRuslan ErmilovSome controllers, such as the Advansys wide 9689deea857SKenneth D. Merrycontrollers, support enabling and disabling synchronous negotiation for 9699deea857SKenneth D. Merrya device, but do not support setting the synchronous negotiation rate. 9701252c1bbSRuslan Ermilov.Bl -tag -width 17n 9719deea857SKenneth D. Merry.It Fl a 9729deea857SKenneth D. MerryAttempt to make the negotiation settings take effect immediately by sending 9739deea857SKenneth D. Merrya Test Unit Ready command to the device. 9749deea857SKenneth D. Merry.It Fl c 9759806e231SRuslan ErmilovShow or set current negotiation settings. 9769806e231SRuslan ErmilovThis is the default. 9779deea857SKenneth D. Merry.It Fl D Ar enable|disable 9789deea857SKenneth D. MerryEnable or disable disconnection. 979b447e682SAlexander Motin.It Fl M Ar mode 980b447e682SAlexander MotinSet ATA mode. 9819deea857SKenneth D. Merry.It Fl O Ar offset 9829deea857SKenneth D. MerrySet the command delay offset. 9839deea857SKenneth D. Merry.It Fl q 9840227791bSRuslan ErmilovBe quiet, do not print anything. 9859806e231SRuslan ErmilovThis is generally useful when you want to 9860227791bSRuslan Ermilovset a parameter, but do not want any status information. 9879deea857SKenneth D. Merry.It Fl R Ar syncrate 9889806e231SRuslan ErmilovChange the synchronization rate for a device. 9899806e231SRuslan ErmilovThe sync rate is a floating 9909806e231SRuslan Ermilovpoint value specified in MHz. 9919806e231SRuslan ErmilovSo, for instance, 9929deea857SKenneth D. Merry.Sq 20.000 9939deea857SKenneth D. Merryis a legal value, as is 9949deea857SKenneth D. Merry.Sq 20 . 9959deea857SKenneth D. Merry.It Fl T Ar enable|disable 9969deea857SKenneth D. MerryEnable or disable tagged queueing for a device. 9979deea857SKenneth D. Merry.It Fl U 9989806e231SRuslan ErmilovShow or set user negotiation settings. 9999806e231SRuslan ErmilovThe default is to show or set 10009deea857SKenneth D. Merrycurrent negotiation settings. 10019deea857SKenneth D. Merry.It Fl v 10029deea857SKenneth D. MerryThe verbose switch has special meaning for the 100333fab22eSKenneth D. Merry.Ic negotiate 10049806e231SRuslan Ermilovsubcommand. 10059806e231SRuslan ErmilovIt causes 10067c7fb079SRuslan Ermilov.Nm 10079deea857SKenneth D. Merryto print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the 10089deea857SKenneth D. Merrycontroller driver. 10099deea857SKenneth D. Merry.It Fl W Ar bus_width 10109806e231SRuslan ErmilovSpecify the bus width to negotiate with a device. 10119806e231SRuslan ErmilovThe bus width is 10129806e231SRuslan Ermilovspecified in bits. 10139806e231SRuslan ErmilovThe only useful values to specify are 8, 16, and 32 10149806e231SRuslan Ermilovbits. 10159806e231SRuslan ErmilovThe controller must support the bus width in question in order for 10169deea857SKenneth D. Merrythe setting to take effect. 10179deea857SKenneth D. Merry.El 10189deea857SKenneth D. Merry.Pp 10199deea857SKenneth D. MerryIn general, sync rate and offset settings will not take effect for a 10209806e231SRuslan Ermilovdevice until a command has been sent to the device. 10219806e231SRuslan ErmilovThe 10229deea857SKenneth D. Merry.Fl a 10239deea857SKenneth D. Merryswitch above will automatically send a Test Unit Ready to the device so 10249deea857SKenneth D. Merrynegotiation parameters will take effect. 102533fab22eSKenneth D. Merry.It Ic format 102696a93c63SKenneth D. MerryIssue the 102796a93c63SKenneth D. Merry.Tn SCSI 102896a93c63SKenneth D. MerryFORMAT UNIT command to the named device. 102996a93c63SKenneth D. Merry.Pp 103096a93c63SKenneth D. Merry.Em WARNING! WARNING! WARNING! 103196a93c63SKenneth D. Merry.Pp 10329806e231SRuslan ErmilovLow level formatting a disk will destroy ALL data on the disk. 10339806e231SRuslan ErmilovUse 10349806e231SRuslan Ermilovextreme caution when issuing this command. 10359806e231SRuslan ErmilovMany users low-level format 10369806e231SRuslan Ermilovdisks that do not really need to be low-level formatted. 10379806e231SRuslan ErmilovThere are 103896a93c63SKenneth D. Merryrelatively few scenarios that call for low-level formatting a disk. 103996a93c63SKenneth D. MerryOne reason for 104096a93c63SKenneth D. Merrylow-level formatting a disk is to initialize the disk after changing 10419806e231SRuslan Ermilovits physical sector size. 10429806e231SRuslan ErmilovAnother reason for low-level formatting a disk 104396a93c63SKenneth D. Merryis to revive the disk if you are getting "medium format corrupted" errors 104496a93c63SKenneth D. Merryfrom the disk in response to read and write requests. 104596a93c63SKenneth D. Merry.Pp 10469806e231SRuslan ErmilovSome disks take longer than others to format. 10479806e231SRuslan ErmilovUsers should specify a 10489806e231SRuslan Ermilovtimeout long enough to allow the format to complete. 10499806e231SRuslan ErmilovThe default format 10509806e231SRuslan Ermilovtimeout is 3 hours, which should be long enough for most disks. 10519806e231SRuslan ErmilovSome hard 105296a93c63SKenneth D. Merrydisks will complete a format operation in a very short period of time 10539806e231SRuslan Ermilov(on the order of 5 minutes or less). 10549806e231SRuslan ErmilovThis is often because the drive 10550227791bSRuslan Ermilovdoes not really support the FORMAT UNIT command -- it just accepts the 105696a93c63SKenneth D. Merrycommand, waits a few minutes and then returns it. 105796a93c63SKenneth D. Merry.Pp 105896a93c63SKenneth D. MerryThe 105996a93c63SKenneth D. Merry.Sq format 10609806e231SRuslan Ermilovsubcommand takes several arguments that modify its default behavior. 10619806e231SRuslan ErmilovThe 106296a93c63SKenneth D. Merry.Fl q 106396a93c63SKenneth D. Merryand 106496a93c63SKenneth D. Merry.Fl y 106596a93c63SKenneth D. Merryarguments can be useful for scripts. 10661252c1bbSRuslan Ermilov.Bl -tag -width 6n 106796a93c63SKenneth D. Merry.It Fl q 10680227791bSRuslan ErmilovBe quiet, do not print any status messages. 10699806e231SRuslan ErmilovThis option will not disable 10709806e231SRuslan Ermilovthe questions, however. 10719806e231SRuslan ErmilovTo disable questions, use the 107296a93c63SKenneth D. Merry.Fl y 107396a93c63SKenneth D. Merryargument, below. 1074e9e4d3e4SKenneth D. Merry.It Fl r 1075e9e4d3e4SKenneth D. MerryRun in 1076e9e4d3e4SKenneth D. Merry.Dq report only 1077e9e4d3e4SKenneth D. Merrymode. 1078e9e4d3e4SKenneth D. MerryThis will report status on a format that is already running on the drive. 107996a93c63SKenneth D. Merry.It Fl w 10809806e231SRuslan ErmilovIssue a non-immediate format command. 10819806e231SRuslan ErmilovBy default, 10827c7fb079SRuslan Ermilov.Nm 10839806e231SRuslan Ermilovissues the FORMAT UNIT command with the immediate bit set. 10849806e231SRuslan ErmilovThis tells the 108596a93c63SKenneth D. Merrydevice to immediately return the format command, before the format has 10869806e231SRuslan Ermilovactually completed. 10879806e231SRuslan ErmilovThen, 10887c7fb079SRuslan Ermilov.Nm 108996a93c63SKenneth D. Merrygathers 109096a93c63SKenneth D. Merry.Tn SCSI 109196a93c63SKenneth D. Merrysense information from the device every second to determine how far along 10929806e231SRuslan Ermilovin the format process it is. 10939806e231SRuslan ErmilovIf the 109496a93c63SKenneth D. Merry.Fl w 109596a93c63SKenneth D. Merryargument is specified, 10967c7fb079SRuslan Ermilov.Nm 109796a93c63SKenneth D. Merrywill issue a non-immediate format command, and will be unable to print any 109896a93c63SKenneth D. Merryinformation to let the user know what percentage of the disk has been 109996a93c63SKenneth D. Merryformatted. 110096a93c63SKenneth D. Merry.It Fl y 11010227791bSRuslan ErmilovDo not ask any questions. 11029806e231SRuslan ErmilovBy default, 11037c7fb079SRuslan Ermilov.Nm 110496a93c63SKenneth D. Merrywill ask the user if he/she really wants to format the disk in question, 11059806e231SRuslan Ermilovand also if the default format command timeout is acceptable. 11069806e231SRuslan ErmilovThe user 110796a93c63SKenneth D. Merrywill not be asked about the timeout if a timeout is specified on the 110896a93c63SKenneth D. Merrycommand line. 110996a93c63SKenneth D. Merry.El 1110ffead710SBryan Venteicher.It Ic sanitize 1111ffead710SBryan VenteicherIssue the 1112ffead710SBryan Venteicher.Tn SCSI 1113ffead710SBryan VenteicherSANITIZE command to the named device. 1114ffead710SBryan Venteicher.Pp 1115ffead710SBryan Venteicher.Em WARNING! WARNING! WARNING! 1116ffead710SBryan Venteicher.Pp 1117ffead710SBryan VenteicherALL data in the cache and on the disk will be destroyed or made inaccessible. 1118ffead710SBryan VenteicherRecovery of the data is not possible. 1119ffead710SBryan VenteicherUse extreme caution when issuing this command. 1120ffead710SBryan Venteicher.Pp 1121ffead710SBryan VenteicherThe 1122ffead710SBryan Venteicher.Sq sanitize 1123ffead710SBryan Venteichersubcommand takes several arguments that modify its default behavior. 1124ffead710SBryan VenteicherThe 1125ffead710SBryan Venteicher.Fl q 1126ffead710SBryan Venteicherand 1127ffead710SBryan Venteicher.Fl y 1128ffead710SBryan Venteicherarguments can be useful for scripts. 1129ffead710SBryan Venteicher.Bl -tag -width 6n 1130ffead710SBryan Venteicher.It Fl a Ar operation 1131ffead710SBryan VenteicherSpecify the sanitize operation to perform. 1132ffead710SBryan Venteicher.Bl -tag -width 16n 1133ffead710SBryan Venteicher.It overwrite 1134ffead710SBryan VenteicherPerform an overwrite operation by writing a user supplied 1135ffead710SBryan Venteicherdata pattern to the device one or more times. 1136ffead710SBryan VenteicherThe pattern is given by the 1137ffead710SBryan Venteicher.Fl P 1138ffead710SBryan Venteicherargument. 1139ffead710SBryan VenteicherThe number of times is given by the 1140ffead710SBryan Venteicher.Fl c 1141ffead710SBryan Venteicherargument. 1142ffead710SBryan Venteicher.It block 1143ffead710SBryan VenteicherPerform a block erase operation. 1144ffead710SBryan VenteicherAll the device's blocks are set to a vendor defined 1145ffead710SBryan Venteichervalue, typically zero. 1146ffead710SBryan Venteicher.It crypto 1147ffead710SBryan VenteicherPerform a cryptographic erase operation. 1148ffead710SBryan VenteicherThe encryption keys are changed to prevent the decryption 1149ffead710SBryan Venteicherof the data. 1150ffead710SBryan Venteicher.It exitfailure 1151ffead710SBryan VenteicherExits a previously failed sanitize operation. 1152ffead710SBryan VenteicherA failed sanitize operation can only be exited if it was 1153ffead710SBryan Venteicherrun in the unrestricted completion mode, as provided by the 1154ffead710SBryan Venteicher.Fl U 1155ffead710SBryan Venteicherargument. 1156ffead710SBryan Venteicher.El 1157ffead710SBryan Venteicher.It Fl c Ar passes 1158ffead710SBryan VenteicherThe number of passes when performing an 1159ffead710SBryan Venteicher.Sq overwrite 1160ffead710SBryan Venteicheroperation. 11615bb17266SJoel DahlValid values are between 1 and 31. 11625bb17266SJoel DahlThe default is 1. 1163ffead710SBryan Venteicher.It Fl I 1164ffead710SBryan VenteicherWhen performing an 1165ffead710SBryan Venteicher.Sq overwrite 1166ffead710SBryan Venteicheroperation, the pattern is inverted between consecutive passes. 1167ffead710SBryan Venteicher.It Fl P Ar pattern 1168ffead710SBryan VenteicherPath to the file containing the pattern to use when 1169ffead710SBryan Venteicherperforming an 1170ffead710SBryan Venteicher.Sq overwrite 1171ffead710SBryan Venteicheroperation. 1172ffead710SBryan VenteicherThe pattern is repeated as needed to fill each block. 1173ffead710SBryan Venteicher.It Fl q 1174ffead710SBryan VenteicherBe quiet, do not print any status messages. 1175ffead710SBryan VenteicherThis option will not disable 1176ffead710SBryan Venteicherthe questions, however. 1177ffead710SBryan VenteicherTo disable questions, use the 1178ffead710SBryan Venteicher.Fl y 1179ffead710SBryan Venteicherargument, below. 1180ffead710SBryan Venteicher.It Fl U 1181ffead710SBryan VenteicherPerform the sanitize in the unrestricted completion mode. 1182ffead710SBryan VenteicherIf the operation fails, it can later be exited with the 1183ffead710SBryan Venteicher.Sq exitfailure 1184ffead710SBryan Venteicheroperation. 1185ffead710SBryan Venteicher.It Fl r 1186ffead710SBryan VenteicherRun in 1187ffead710SBryan Venteicher.Dq report only 1188ffead710SBryan Venteichermode. 1189ffead710SBryan VenteicherThis will report status on a sanitize that is already running on the drive. 1190ffead710SBryan Venteicher.It Fl w 1191ffead710SBryan VenteicherIssue a non-immediate sanitize command. 1192ffead710SBryan VenteicherBy default, 1193ffead710SBryan Venteicher.Nm 1194ffead710SBryan Venteicherissues the SANITIZE command with the immediate bit set. 1195ffead710SBryan VenteicherThis tells the 1196ffead710SBryan Venteicherdevice to immediately return the sanitize command, before 1197ffead710SBryan Venteicherthe sanitize has actually completed. 1198ffead710SBryan VenteicherThen, 1199ffead710SBryan Venteicher.Nm 1200ffead710SBryan Venteichergathers 1201ffead710SBryan Venteicher.Tn SCSI 1202ffead710SBryan Venteichersense information from the device every second to determine how far along 1203ffead710SBryan Venteicherin the sanitize process it is. 1204ffead710SBryan VenteicherIf the 1205ffead710SBryan Venteicher.Fl w 1206ffead710SBryan Venteicherargument is specified, 1207ffead710SBryan Venteicher.Nm 1208ffead710SBryan Venteicherwill issue a non-immediate sanitize command, and will be unable to print any 1209ffead710SBryan Venteicherinformation to let the user know what percentage of the disk has been 1210ffead710SBryan Venteichersanitized. 1211ffead710SBryan Venteicher.It Fl y 1212ffead710SBryan VenteicherDo not ask any questions. 1213ffead710SBryan VenteicherBy default, 1214ffead710SBryan Venteicher.Nm 1215ffead710SBryan Venteicherwill ask the user if he/she really wants to sanitize the disk in question, 1216ffead710SBryan Venteicherand also if the default sanitize command timeout is acceptable. 1217ffead710SBryan VenteicherThe user 1218ffead710SBryan Venteicherwill not be asked about the timeout if a timeout is specified on the 1219ffead710SBryan Venteichercommand line. 1220ffead710SBryan Venteicher.El 122150c9a276SAlexander Motin.It Ic idle 12225bb17266SJoel DahlPut ATA device into IDLE state. 12235bb17266SJoel DahlOptional parameter 122472166fbaSAlexander Motin.Pq Fl t 12255bb17266SJoel Dahlspecifies automatic standby timer value in seconds. 12265bb17266SJoel DahlValue 0 disables timer. 122750c9a276SAlexander Motin.It Ic standby 12285bb17266SJoel DahlPut ATA device into STANDBY state. 12295bb17266SJoel DahlOptional parameter 123072166fbaSAlexander Motin.Pq Fl t 12315bb17266SJoel Dahlspecifies automatic standby timer value in seconds. 12325bb17266SJoel DahlValue 0 disables timer. 123350c9a276SAlexander Motin.It Ic sleep 12345bb17266SJoel DahlPut ATA device into SLEEP state. 12355bb17266SJoel DahlNote that the only way get device out of 123650c9a276SAlexander Motinthis state may be reset. 12371146874aSSteven Hartland.It Ic security 12381146874aSSteven HartlandUpdate or report security settings, using an ATA identify command (0xec). 12391146874aSSteven HartlandBy default, 12401146874aSSteven Hartland.Nm 12411146874aSSteven Hartlandwill print out the security support and associated settings of the device. 12421146874aSSteven HartlandThe 12431146874aSSteven Hartland.Ic security 12441146874aSSteven Hartlandcommand takes several arguments: 12451146874aSSteven Hartland.Bl -tag -width 0n 12461146874aSSteven Hartland.It Fl d Ar pwd 12471146874aSSteven Hartland.Pp 12481146874aSSteven HartlandDisable device security using the given password for the selected user according 12491146874aSSteven Hartlandto the devices configured security level. 12501146874aSSteven Hartland.It Fl e Ar pwd 12511146874aSSteven Hartland.Pp 12521146874aSSteven HartlandErase the device using the given password for the selected user. 12531146874aSSteven Hartland.Pp 12541146874aSSteven Hartland.Em WARNING! WARNING! WARNING! 12551146874aSSteven Hartland.Pp 12561146874aSSteven HartlandIssuing a secure erase will 12571146874aSSteven Hartland.Em ERASE ALL 12581146874aSSteven Hartlanduser data on the device and may take several hours to complete. 12591146874aSSteven Hartland.Pp 12601146874aSSteven HartlandWhen this command is used against an SSD drive all its cells will be marked as 12615bb17266SJoel Dahlempty, restoring it to factory default write performance. 12625bb17266SJoel DahlFor SSD's this action 12631146874aSSteven Hartlandusually takes just a few seconds. 12641146874aSSteven Hartland.It Fl f 12651146874aSSteven Hartland.Pp 12661146874aSSteven HartlandFreeze the security configuration of the specified device. 12671146874aSSteven Hartland.Pp 12681146874aSSteven HartlandAfter command completion any other commands that update the device lock mode 1269e36a4a7eSJoel Dahlshall be command aborted. 1270e36a4a7eSJoel DahlFrozen mode is disabled by power-off or hardware reset. 12711146874aSSteven Hartland.It Fl h Ar pwd 12721146874aSSteven Hartland.Pp 12731146874aSSteven HartlandEnhanced erase the device using the given password for the selected user. 12741146874aSSteven Hartland.Pp 12751146874aSSteven Hartland.Em WARNING! WARNING! WARNING! 12761146874aSSteven Hartland.Pp 12771146874aSSteven HartlandIssuing an enhanced secure erase will 12781146874aSSteven Hartland.Em ERASE ALL 12791146874aSSteven Hartlanduser data on the device and may take several hours to complete. 12801146874aSSteven Hartland.Pp 12811146874aSSteven HartlandAn enhanced erase writes predetermined data patterns to all user data areas, 12821146874aSSteven Hartlandall previously written user data shall be overwritten, including sectors that 12831146874aSSteven Hartlandare no longer in use due to reallocation. 12841146874aSSteven Hartland.It Fl k Ar pwd 12851146874aSSteven Hartland.Pp 12861146874aSSteven HartlandUnlock the device using the given password for the selected user according to 12871146874aSSteven Hartlandthe devices configured security level. 12881146874aSSteven Hartland.It Fl l Ar high|maximum 12891146874aSSteven Hartland.Pp 12901146874aSSteven HartlandSpecifies which security level to set when issuing a 12911146874aSSteven Hartland.Fl s Ar pwd 12925bb17266SJoel Dahlcommand. 12935bb17266SJoel DahlThe security level determines device behavior when the master 12945bb17266SJoel Dahlpassword is used to unlock the device. 12955bb17266SJoel DahlWhen the security level is set to high 12961146874aSSteven Hartlandthe device requires the unlock command and the master password to unlock. 12971146874aSSteven HartlandWhen the security level is set to maximum the device requires a secure erase 12981146874aSSteven Hartlandwith the master password to unlock. 12991146874aSSteven Hartland.Pp 13001146874aSSteven HartlandThis option must be used in conjunction with one of the security action commands. 13011146874aSSteven Hartland.Pp 13021146874aSSteven HartlandDefaults to 13031146874aSSteven Hartland.Em high 13041146874aSSteven Hartland.It Fl q 13051146874aSSteven Hartland.Pp 13061146874aSSteven HartlandBe quiet, do not print any status messages. 13071146874aSSteven HartlandThis option will not disable the questions, however. 13081146874aSSteven HartlandTo disable questions, use the 13091146874aSSteven Hartland.Fl y 13101146874aSSteven Hartlandargument, below. 13111146874aSSteven Hartland.It Fl s Ar pwd 13121146874aSSteven Hartland.Pp 13131146874aSSteven HartlandPassword the device (enable security) using the given password for the selected 13145bb17266SJoel Dahluser. 13155bb17266SJoel DahlThis option can be combined with other options such as 13161146874aSSteven Hartland.Fl e Em pwd 13171146874aSSteven Hartland.Pp 13181146874aSSteven HartlandA master password may be set in a addition to the user password. The purpose of 13191146874aSSteven Hartlandthe master password is to allow an administrator to establish a password that 13201146874aSSteven Hartlandis kept secret from the user, and which may be used to unlock the device if the 13211146874aSSteven Hartlanduser password is lost. 13221146874aSSteven Hartland.Pp 13231146874aSSteven Hartland.Em Note: 13241146874aSSteven HartlandSetting the master password does not enable device security. 13251146874aSSteven Hartland.Pp 13261146874aSSteven HartlandIf the master password is set and the drive supports a Master Revision Code 13271146874aSSteven Hartlandfeature the Master Password Revision Code will be decremented. 13281146874aSSteven Hartland.It Fl T Ar timeout 13291146874aSSteven Hartland.Pp 13301146874aSSteven HartlandOverrides the default timeout, specified in seconds, used for both 13311146874aSSteven Hartland.Fl e 13321146874aSSteven Hartlandand 13331146874aSSteven Hartland.Fl h 13341146874aSSteven Hartlandthis is useful if your system has problems processing long timeouts correctly. 13351146874aSSteven Hartland.Pp 13361146874aSSteven HartlandUsually the timeout is calculated from the information stored on the drive if 13371146874aSSteven Hartlandpresent, otherwise it defaults to 2 hours. 13381146874aSSteven Hartland.It Fl U Ar user|master 13391146874aSSteven Hartland.Pp 13401146874aSSteven HartlandSpecifies which user to set / use for the running action command, valid values 13411146874aSSteven Hartlandare user or master and defaults to master if not set. 13421146874aSSteven Hartland.Pp 13431146874aSSteven HartlandThis option must be used in conjunction with one of the security action commands. 13441146874aSSteven Hartland.Pp 13451146874aSSteven HartlandDefaults to 13461146874aSSteven Hartland.Em master 13471146874aSSteven Hartland.It Fl y 13481146874aSSteven Hartland.Pp 13491146874aSSteven HartlandConfirm yes to dangerous options such as 13501146874aSSteven Hartland.Fl e 13511146874aSSteven Hartlandwithout prompting for confirmation. 13521146874aSSteven Hartland.Pp 13531146874aSSteven Hartland.El 13545bb17266SJoel DahlIf the password specified for any action commands does not match the configured 13551146874aSSteven Hartlandpassword for the specified user the command will fail. 13561146874aSSteven Hartland.Pp 13571146874aSSteven HartlandThe password in all cases is limited to 32 characters, longer passwords will 13581146874aSSteven Hartlandfail. 13599e68761cSSteven Hartland.It Ic hpa 13609e68761cSSteven HartlandUpdate or report Host Protected Area details. 13619e68761cSSteven HartlandBy default 13629e68761cSSteven Hartland.Nm 13639e68761cSSteven Hartlandwill print out the HPA support and associated settings of the device. 13649e68761cSSteven HartlandThe 13659e68761cSSteven Hartland.Ic hpa 13669e68761cSSteven Hartlandcommand takes several optional arguments: 13679e68761cSSteven Hartland.Bl -tag -width 0n 13689e68761cSSteven Hartland.It Fl f 13699e68761cSSteven Hartland.Pp 13709e68761cSSteven HartlandFreeze the HPA configuration of the specified device. 13719e68761cSSteven Hartland.Pp 13729e68761cSSteven HartlandAfter command completion any other commands that update the HPA configuration 13739e68761cSSteven Hartlandshall be command aborted. 13749e68761cSSteven HartlandFrozen mode is disabled by power-off or hardware reset. 13759e68761cSSteven Hartland.It Fl l 13769e68761cSSteven Hartland.Pp 13779e68761cSSteven HartlandLock the HPA configuration of the device until a successful call to unlock or 13789e68761cSSteven Hartlandthe next power-on reset occurs. 13799e68761cSSteven Hartland.It Fl P 13809e68761cSSteven Hartland.Pp 13819e68761cSSteven HartlandMake the HPA max sectors persist across power-on reset or a hardware reset. 13829e68761cSSteven HartlandThis must be used in combination with 13839e68761cSSteven Hartland.Fl s Ar max_sectors 13849e68761cSSteven Hartland. 13859e68761cSSteven Hartland.It Fl p Ar pwd 13869e68761cSSteven Hartland.Pp 13879e68761cSSteven HartlandSet the HPA configuration password required for unlock calls. 13889e68761cSSteven Hartland.It Fl q 13899e68761cSSteven Hartland.Pp 13909e68761cSSteven HartlandBe quiet, do not print any status messages. 13919e68761cSSteven HartlandThis option will not disable the questions. 13929e68761cSSteven HartlandTo disable questions, use the 13939e68761cSSteven Hartland.Fl y 13949e68761cSSteven Hartlandargument, below. 13959e68761cSSteven Hartland.It Fl s Ar max_sectors 13969e68761cSSteven Hartland.Pp 13979e68761cSSteven HartlandConfigures the maximum user accessible sectors of the device. 13989e68761cSSteven HartlandThis will change the number of sectors the device reports. 13999e68761cSSteven Hartland.Pp 14009e68761cSSteven Hartland.Em WARNING! WARNING! WARNING! 14019e68761cSSteven Hartland.Pp 14029e68761cSSteven HartlandChanging the max sectors of a device using this option will make the data on 14039e68761cSSteven Hartlandthe device beyond the specified value inaccessible. 14049e68761cSSteven Hartland.Pp 14059e68761cSSteven HartlandOnly one successful 14069e68761cSSteven Hartland.Fl s Ar max_sectors 14079e68761cSSteven Hartlandcall can be made without a power-on reset or a hardware reset of the device. 14089e68761cSSteven Hartland.It Fl U Ar pwd 14099e68761cSSteven Hartland.Pp 14109e68761cSSteven HartlandUnlock the HPA configuration of the specified device using the given password. 14115bb17266SJoel DahlIf the password specified does not match the password configured via 14129e68761cSSteven Hartland.Fl p Ar pwd 14139e68761cSSteven Hartlandthe command will fail. 14149e68761cSSteven Hartland.Pp 14159e68761cSSteven HartlandAfter 5 failed unlock calls, due to password miss-match, the device will refuse 14169e68761cSSteven Hartlandadditional unlock calls until after a power-on reset. 14179e68761cSSteven Hartland.It Fl y 14189e68761cSSteven Hartland.Pp 14199e68761cSSteven HartlandConfirm yes to dangerous options such as 14209e68761cSSteven Hartland.Fl e 14219e68761cSSteven Hartlandwithout prompting for confirmation 14229e68761cSSteven Hartland.Pp 14239e68761cSSteven Hartland.El 14249e68761cSSteven HartlandThe password for all HPA commands is limited to 32 characters, longer passwords 14259e68761cSSteven Hartlandwill fail. 14261f4782a4SEd Maste.It Ic fwdownload 14271f4782a4SEd MasteProgram firmware of the named SCSI device using the image file provided. 14281f4782a4SEd Maste.Pp 14291f4782a4SEd MasteCurrent list of supported vendors: 14301f4782a4SEd Maste.Bl -bullet -offset indent -compact 14311f4782a4SEd Maste.It 14321f4782a4SEd MasteHITACHI 14331f4782a4SEd Maste.It 14341f4782a4SEd MasteHP 14351f4782a4SEd Maste.It 14361f4782a4SEd MasteIBM 14371f4782a4SEd Maste.It 14381f4782a4SEd MastePLEXTOR 14391f4782a4SEd Maste.It 14401f4782a4SEd MasteQUANTUM 14411f4782a4SEd Maste.It 14422872a0d8SBryan VenteicherSAMSUNG 14432872a0d8SBryan Venteicher.It 14441f4782a4SEd MasteSEAGATE 14451f4782a4SEd Maste.El 14461f4782a4SEd Maste.Pp 14471f4782a4SEd Maste.Em WARNING! WARNING! WARNING! 14481f4782a4SEd Maste.Pp 14491f4782a4SEd MasteLittle testing has been done to make sure that different device models from 14501f4782a4SEd Masteeach vendor work correctly with the fwdownload command. 14511f4782a4SEd MasteA vendor name appearing in the supported list means only that firmware of at 14521f4782a4SEd Masteleast one device type from that vendor has successfully been programmed with 14531f4782a4SEd Mastethe fwdownload command. 14541f4782a4SEd MasteExtra caution should be taken when using this command since there is no 14551f4782a4SEd Masteguarantee it will not break a device from the listed vendors. 14561f4782a4SEd MasteEnsure that you have a recent backup of the data on the device before 14571f4782a4SEd Masteperforming a firmware update. 14581f4782a4SEd Maste.Bl -tag -width 11n 14591f4782a4SEd Maste.It Fl f Ar fw_image 14601f4782a4SEd MastePath to the firmware image file to be downloaded to the specified device. 14611f4782a4SEd Maste.It Fl y 14621f4782a4SEd MasteDo not ask for confirmation. 14631f4782a4SEd Maste.It Fl s 14641f4782a4SEd MasteRun in simulation mode. 14651f4782a4SEd MastePacket sizes that will be sent are shown, but no actual packet is sent to the 14661f4782a4SEd Mastedevice. 146719769ec2SJoel DahlNo confirmation is asked in simulation mode. 14681f4782a4SEd Maste.It Fl v 14691f4782a4SEd MasteBesides showing sense information in case of a failure, the verbose option 14701f4782a4SEd Mastecauses 14711f4782a4SEd Maste.Nm 14721f4782a4SEd Masteto output a line for every firmware segment that is sent to the device by the 14731f4782a4SEd Mastefwdownload command 14741f4782a4SEd Maste-- the same as the ones shown in simulation mode. 14751f4782a4SEd Maste.El 147633fab22eSKenneth D. Merry.It Ic help 14775a251d70SKenneth D. MerryPrint out verbose usage information. 1478525689f1SJustin T. Gibbs.El 1479525689f1SJustin T. Gibbs.Sh ENVIRONMENT 1480525689f1SJustin T. GibbsThe 1481525689f1SJustin T. Gibbs.Ev SCSI_MODES 1482525689f1SJustin T. Gibbsvariable allows the user to specify an alternate mode page format file. 1483525689f1SJustin T. Gibbs.Pp 1484525689f1SJustin T. GibbsThe 1485525689f1SJustin T. Gibbs.Ev EDITOR 1486525689f1SJustin T. Gibbsvariable determines which text editor 14877c7fb079SRuslan Ermilov.Nm 1488525689f1SJustin T. Gibbsstarts when editing mode pages. 1489525689f1SJustin T. Gibbs.Sh FILES 1490525689f1SJustin T. Gibbs.Bl -tag -width /usr/share/misc/scsi_modes -compact 1491525689f1SJustin T. Gibbs.It Pa /usr/share/misc/scsi_modes 1492525689f1SJustin T. Gibbsis the SCSI mode format database. 1493525689f1SJustin T. Gibbs.It Pa /dev/xpt0 1494525689f1SJustin T. Gibbsis the transport layer device. 1495525689f1SJustin T. Gibbs.It Pa /dev/pass* 1496525689f1SJustin T. Gibbsare the CAM application passthrough devices. 1497525689f1SJustin T. Gibbs.El 1498525689f1SJustin T. Gibbs.Sh EXAMPLES 1499525689f1SJustin T. Gibbs.Dl camcontrol eject -n cd -u 1 -v 1500525689f1SJustin T. Gibbs.Pp 1501525689f1SJustin T. GibbsEject the CD from cd1, and print SCSI sense information if the command 1502525689f1SJustin T. Gibbsfails. 1503525689f1SJustin T. Gibbs.Pp 1504b3550398SKenneth D. Merry.Dl camcontrol tur da0 1505525689f1SJustin T. Gibbs.Pp 1506525689f1SJustin T. GibbsSend the SCSI test unit ready command to da0. 1507e1205e80SPhilippe CharnierThe 15087c7fb079SRuslan Ermilov.Nm 1509e1205e80SPhilippe Charnierutility will report whether the disk is ready, but will not display sense 1510525689f1SJustin T. Gibbsinformation if the command fails since the 1511525689f1SJustin T. Gibbs.Fl v 1512525689f1SJustin T. Gibbsswitch was not specified. 1513c7938743SMike Pritchard.Bd -literal -offset indent 1514c60e19a8SKenneth D. Merrycamcontrol tur da1 -E -C 4 -t 50 -v 1515525689f1SJustin T. Gibbs.Ed 1516525689f1SJustin T. Gibbs.Pp 15179806e231SRuslan ErmilovSend a test unit ready command to da1. 15189806e231SRuslan ErmilovEnable kernel error recovery. 15199806e231SRuslan ErmilovSpecify a retry count of 4, and a timeout of 50 seconds. 15209806e231SRuslan ErmilovEnable sense 1521525689f1SJustin T. Gibbsprinting (with the 1522525689f1SJustin T. Gibbs.Fl v 15239806e231SRuslan Ermilovflag) if the command fails. 15249806e231SRuslan ErmilovSince error recovery is turned on, the 1525525689f1SJustin T. Gibbsdisk will be spun up if it is not currently spinning. 1526e1205e80SPhilippe CharnierThe 15277c7fb079SRuslan Ermilov.Nm 1528e1205e80SPhilippe Charnierutility will report whether the disk is ready. 1529c7938743SMike Pritchard.Bd -literal -offset indent 1530525689f1SJustin T. Gibbscamcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e 1531525689f1SJustin T. Gibbs -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1" 1532525689f1SJustin T. Gibbs.Ed 1533525689f1SJustin T. Gibbs.Pp 15349806e231SRuslan ErmilovIssue a READ BUFFER command (0x3C) to cd1. 15359806e231SRuslan ErmilovDisplay the buffer size of cd1, 15369806e231SRuslan Ermilovand display the first 10 bytes from the cache on cd1. 15379806e231SRuslan ErmilovDisplay SCSI sense 1538525689f1SJustin T. Gibbsinformation if the command fails. 1539c7938743SMike Pritchard.Bd -literal -offset indent 15408604fe2eSSADA Kenjicamcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e 1541525689f1SJustin T. Gibbs -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 1542525689f1SJustin T. Gibbs.Ed 1543525689f1SJustin T. Gibbs.Pp 15449806e231SRuslan ErmilovIssue a WRITE BUFFER (0x3B) command to cd1. 15459806e231SRuslan ErmilovWrite out 10 bytes of data, 15469806e231SRuslan Ermilovnot including the (reserved) 4 byte header. 15479806e231SRuslan ErmilovPrint out sense information if 15489806e231SRuslan Ermilovthe command fails. 15499806e231SRuslan ErmilovBe very careful with this command, improper use may 1550525689f1SJustin T. Gibbscause data corruption. 1551c7938743SMike Pritchard.Bd -literal -offset indent 1552c60e19a8SKenneth D. Merrycamcontrol modepage da3 -m 1 -e -P 3 155394d09127SKenneth D. Merry.Ed 1554525689f1SJustin T. Gibbs.Pp 1555525689f1SJustin T. GibbsEdit mode page 1 (the Read-Write Error Recover page) for da3, and save the 15569806e231SRuslan Ermilovsettings on the drive. 15579806e231SRuslan ErmilovMode page 1 contains a disk drive's auto read and 1558525689f1SJustin T. Gibbswrite reallocation settings, among other things. 1559525689f1SJustin T. Gibbs.Pp 15605710d224SKenneth D. Merry.Dl camcontrol rescan all 15615710d224SKenneth D. Merry.Pp 15625710d224SKenneth D. MerryRescan all SCSI busses in the system for devices that have been added, 15635710d224SKenneth D. Merryremoved or changed. 15645710d224SKenneth D. Merry.Pp 1565525689f1SJustin T. Gibbs.Dl camcontrol rescan 0 1566525689f1SJustin T. Gibbs.Pp 1567525689f1SJustin T. GibbsRescan SCSI bus 0 for devices that have been added, removed or changed. 1568525689f1SJustin T. Gibbs.Pp 1569525689f1SJustin T. Gibbs.Dl camcontrol rescan 0:1:0 1570525689f1SJustin T. Gibbs.Pp 1571525689f1SJustin T. GibbsRescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or 1572525689f1SJustin T. Gibbschanged. 15739deea857SKenneth D. Merry.Pp 1574c60e19a8SKenneth D. Merry.Dl camcontrol tags da5 -N 24 15759deea857SKenneth D. Merry.Pp 15769deea857SKenneth D. MerrySet the number of concurrent transactions for da5 to 24. 1577c7938743SMike Pritchard.Bd -literal -offset indent 15789deea857SKenneth D. Merrycamcontrol negotiate -n da -u 4 -T disable 15799deea857SKenneth D. Merry.Ed 15809deea857SKenneth D. Merry.Pp 15819deea857SKenneth D. MerryDisable tagged queueing for da4. 1582c7938743SMike Pritchard.Bd -literal -offset indent 15839deea857SKenneth D. Merrycamcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a 15849deea857SKenneth D. Merry.Ed 15859deea857SKenneth D. Merry.Pp 15869806e231SRuslan ErmilovNegotiate a sync rate of 20MHz and an offset of 15 with da3. 15879806e231SRuslan ErmilovThen send a 15889deea857SKenneth D. MerryTest Unit Ready command to make the settings take effect. 158906e79492SKenneth D. Merry.Bd -literal -offset indent 159006e79492SKenneth D. Merrycamcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1" 159106e79492SKenneth D. Merry.Ed 159206e79492SKenneth D. Merry.Pp 159306e79492SKenneth D. MerrySend the SMP REPORT GENERAL command to ses0, and display the number of PHYs 159406e79492SKenneth D. Merryit contains. 159506e79492SKenneth D. MerryDisplay SMP errors if the command fails. 15961146874aSSteven Hartland.Bd -literal -offset indent 15971146874aSSteven Hartlandcamcontrol security ada0 15981146874aSSteven Hartland.Ed 15991146874aSSteven Hartland.Pp 16001146874aSSteven HartlandReport security support and settings for ada0 16011146874aSSteven Hartland.Bd -literal -offset indent 16021146874aSSteven Hartlandcamcontrol security ada0 -u user -s MyPass 16031146874aSSteven Hartland.Ed 16041146874aSSteven Hartland.Pp 16051146874aSSteven HartlandEnable security on device ada0 with the password MyPass 16061146874aSSteven Hartland.Bd -literal -offset indent 16071146874aSSteven Hartlandcamcontrol security ada0 -u user -e MyPass 16081146874aSSteven Hartland.Ed 16091146874aSSteven Hartland.Pp 16101146874aSSteven HartlandSecure erase ada0 which has had security enabled with user password MyPass 16111146874aSSteven Hartland.Pp 16121146874aSSteven Hartland.Em WARNING! WARNING! WARNING! 16131146874aSSteven Hartland.Pp 16141146874aSSteven HartlandThis will 16151146874aSSteven Hartland.Em ERASE ALL 16161146874aSSteven Hartlanddata from the device, so backup your data before using! 16171146874aSSteven Hartland.Pp 16185bb17266SJoel DahlThis command can be used against an SSD drive to restoring it to 16191146874aSSteven Hartlandfactory default write performance. 16209e68761cSSteven Hartland.Bd -literal -offset indent 16219e68761cSSteven Hartlandcamcontrol hpa ada0 16229e68761cSSteven Hartland.Ed 16239e68761cSSteven Hartland.Pp 16249e68761cSSteven HartlandReport HPA support and settings for ada0 (also reported via 16259e68761cSSteven Hartlandidentify). 16269e68761cSSteven Hartland.Bd -literal -offset indent 16279e68761cSSteven Hartlandcamcontrol hpa ada0 -s 10240 16289e68761cSSteven Hartland.Ed 16299e68761cSSteven Hartland.Pp 16309e68761cSSteven HartlandEnables HPA on ada0 setting the maximum reported sectors to 10240. 16319e68761cSSteven Hartland.Pp 16329e68761cSSteven Hartland.Em WARNING! WARNING! WARNING! 16339e68761cSSteven Hartland.Pp 16349e68761cSSteven HartlandThis will 16359e68761cSSteven Hartland.Em PREVENT ACCESS 16369e68761cSSteven Hartlandto all data on the device beyond this limit until HPA is disabled by setting 16379e68761cSSteven HartlandHPA to native max sectors of the device, which can only be done after a 16389e68761cSSteven Hartlandpower-on or hardware reset! 16399e68761cSSteven Hartland.Pp 16409e68761cSSteven Hartland.Em DO NOT 16419e68761cSSteven Hartlanduse this on a device which has an active filesystem! 1642525689f1SJustin T. Gibbs.Sh SEE ALSO 1643525689f1SJustin T. Gibbs.Xr cam 3 , 16449deea857SKenneth D. Merry.Xr cam_cdbparse 3 , 1645c0bdb22bSMatthew Hunt.Xr cam 4 , 1646525689f1SJustin T. Gibbs.Xr pass 4 , 1647c0bdb22bSMatthew Hunt.Xr xpt 4 1648525689f1SJustin T. Gibbs.Sh HISTORY 1649525689f1SJustin T. GibbsThe 16507c7fb079SRuslan Ermilov.Nm 1651e1205e80SPhilippe Charnierutility first appeared in 1652525689f1SJustin T. Gibbs.Fx 3.0 . 1653525689f1SJustin T. Gibbs.Pp 1654525689f1SJustin T. GibbsThe mode page editing code and arbitrary SCSI command code are based upon 1655525689f1SJustin T. Gibbscode in the old 1656525689f1SJustin T. Gibbs.Xr scsi 8 1657525689f1SJustin T. Gibbsutility and 1658525689f1SJustin T. Gibbs.Xr scsi 3 16599806e231SRuslan Ermilovlibrary, written by Julian Elischer and Peter Dufault. 16609806e231SRuslan ErmilovThe 1661525689f1SJustin T. Gibbs.Xr scsi 8 1662753d686dSRuslan Ermilovprogram first appeared in 1663753d686dSRuslan Ermilov.Bx 386 0.1.2.4 , 1664753d686dSRuslan Ermilovand first appeared in 166533fab22eSKenneth D. Merry.Fx 1666525689f1SJustin T. Gibbsin 1667525689f1SJustin T. Gibbs.Fx 2.0.5 . 1668525689f1SJustin T. Gibbs.Sh AUTHORS 1669aa7c9adaSMike Pritchard.An Kenneth Merry Aq ken@FreeBSD.org 1670525689f1SJustin T. Gibbs.Sh BUGS 16710227791bSRuslan ErmilovThe code that parses the generic command line arguments does not know that 16729806e231SRuslan Ermilovsome of the subcommands take multiple arguments. 16739806e231SRuslan ErmilovSo if, for instance, you 1674525689f1SJustin T. Gibbstried something like this: 1675c7938743SMike Pritchard.Bd -literal -offset indent 1676b9e3972aSKenneth D. Merrycamcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v 1677525689f1SJustin T. Gibbs.Ed 1678525689f1SJustin T. Gibbs.Pp 1679525689f1SJustin T. GibbsThe sense information from the test unit ready command would not get 1680525689f1SJustin T. Gibbsprinted out, since the first 1681525689f1SJustin T. Gibbs.Xr getopt 3 1682525689f1SJustin T. Gibbscall in 16837c7fb079SRuslan Ermilov.Nm 1684525689f1SJustin T. Gibbsbails out when it sees the second argument to 1685525689f1SJustin T. Gibbs.Fl c 1686c4d9468eSRuslan Ermilov(0x00), 16879806e231SRuslan Ermilovabove. 16889806e231SRuslan ErmilovFixing this behavior would take some gross code, or changes to the 1689525689f1SJustin T. Gibbs.Xr getopt 3 16909806e231SRuslan Ermilovinterface. 16919806e231SRuslan ErmilovThe best way to circumvent this problem is to always make sure 1692525689f1SJustin T. Gibbsto specify generic 16937c7fb079SRuslan Ermilov.Nm 1694525689f1SJustin T. Gibbsarguments before any command-specific arguments. 1695