1130f4520SKenneth D. Merry.\" 2130f4520SKenneth D. Merry.\" Copyright (c) 2003 Silicon Graphics International Corp. 3ac503c19SAlexander Motin.\" Copyright (c) 2015-2021 Alexander Motin <mav@FreeBSD.org> 48951f055SMarcelo Araujo.\" Copyright (c) 2018 Marcelo Araujo <araujo@FreeBSD.org> 5130f4520SKenneth D. Merry.\" All rights reserved. 6130f4520SKenneth D. Merry.\" 7130f4520SKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without 8130f4520SKenneth D. Merry.\" modification, are permitted provided that the following conditions 9130f4520SKenneth D. Merry.\" are met: 10130f4520SKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright 11130f4520SKenneth D. Merry.\" notice, this list of conditions, and the following disclaimer, 12130f4520SKenneth D. Merry.\" without modification. 13130f4520SKenneth D. Merry.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 14130f4520SKenneth D. Merry.\" substantially similar to the "NO WARRANTY" disclaimer below 15130f4520SKenneth D. Merry.\" ("Disclaimer") and any redistribution must be conditioned upon 16130f4520SKenneth D. Merry.\" including a substantially similar Disclaimer requirement for further 17130f4520SKenneth D. Merry.\" binary redistribution. 18130f4520SKenneth D. Merry.\" 19130f4520SKenneth D. Merry.\" NO WARRANTY 20130f4520SKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21130f4520SKenneth D. Merry.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22130f4520SKenneth D. Merry.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 23130f4520SKenneth D. Merry.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24130f4520SKenneth D. Merry.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25130f4520SKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26130f4520SKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27130f4520SKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28130f4520SKenneth D. Merry.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29130f4520SKenneth D. Merry.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30130f4520SKenneth D. Merry.\" POSSIBILITY OF SUCH DAMAGES. 31130f4520SKenneth D. Merry.\" 32130f4520SKenneth D. Merry.\" ctladm utility man page. 33130f4520SKenneth D. Merry.\" 34130f4520SKenneth D. Merry.\" Author: Ken Merry <ken@FreeBSD.org> 35130f4520SKenneth D. Merry.\" 36130f4520SKenneth D. Merry.\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ 37130f4520SKenneth D. Merry.\" 38*8206fcc5SJohn Baldwin.Dd February 20, 2025 39130f4520SKenneth D. Merry.Dt CTLADM 8 40130f4520SKenneth D. Merry.Os 41130f4520SKenneth D. Merry.Sh NAME 42130f4520SKenneth D. Merry.Nm ctladm 43130f4520SKenneth D. Merry.Nd CAM Target Layer control utility 44130f4520SKenneth D. Merry.Sh SYNOPSIS 45130f4520SKenneth D. Merry.Nm 46130f4520SKenneth D. Merry.Aq Ar command 47fb606ebaSAlexander Motin.Op lun 48130f4520SKenneth D. Merry.Op generic args 49130f4520SKenneth D. Merry.Op command args 50130f4520SKenneth D. Merry.Nm 51130f4520SKenneth D. Merry.Ic tur 52fb606ebaSAlexander Motin.Aq lun 53130f4520SKenneth D. Merry.Op general options 54130f4520SKenneth D. Merry.Nm 55130f4520SKenneth D. Merry.Ic inquiry 56fb606ebaSAlexander Motin.Aq lun 57130f4520SKenneth D. Merry.Op general options 58130f4520SKenneth D. Merry.Nm 59130f4520SKenneth D. Merry.Ic reqsense 60fb606ebaSAlexander Motin.Aq lun 61130f4520SKenneth D. Merry.Op general options 62130f4520SKenneth D. Merry.Nm 63130f4520SKenneth D. Merry.Ic reportluns 64fb606ebaSAlexander Motin.Aq lun 65130f4520SKenneth D. Merry.Op general options 66130f4520SKenneth D. Merry.Nm 67130f4520SKenneth D. Merry.Ic read 68fb606ebaSAlexander Motin.Aq lun 69130f4520SKenneth D. Merry.Op general options 70130f4520SKenneth D. Merry.Aq Fl l Ar lba 71130f4520SKenneth D. Merry.Aq Fl d Ar datalen 72130f4520SKenneth D. Merry.Aq Fl f Ar file|- 73130f4520SKenneth D. Merry.Aq Fl b Ar blocksize_bytes 74130f4520SKenneth D. Merry.Op Fl c Ar cdbsize 75130f4520SKenneth D. Merry.Op Fl N 76130f4520SKenneth D. Merry.Nm 77130f4520SKenneth D. Merry.Ic write 78fb606ebaSAlexander Motin.Aq lun 79130f4520SKenneth D. Merry.Op general options 80130f4520SKenneth D. Merry.Aq Fl l Ar lba 81130f4520SKenneth D. Merry.Aq Fl d Ar datalen 82130f4520SKenneth D. Merry.Aq Fl f Ar file|- 83130f4520SKenneth D. Merry.Aq Fl b Ar blocksize_bytes 84130f4520SKenneth D. Merry.Op Fl c Ar cdbsize 85130f4520SKenneth D. Merry.Op Fl N 86130f4520SKenneth D. Merry.Nm 87130f4520SKenneth D. Merry.Ic readcap 88fb606ebaSAlexander Motin.Aq lun 89130f4520SKenneth D. Merry.Op general options 90130f4520SKenneth D. Merry.Op Fl c Ar cdbsize 91130f4520SKenneth D. Merry.Nm 92130f4520SKenneth D. Merry.Ic modesense 93fb606ebaSAlexander Motin.Aq lun 94130f4520SKenneth D. Merry.Aq Fl m Ar page | Fl l 95130f4520SKenneth D. Merry.Op Fl P Ar pc 96130f4520SKenneth D. Merry.Op Fl d 97130f4520SKenneth D. Merry.Op Fl S Ar subpage 98130f4520SKenneth D. Merry.Op Fl c Ar size 99130f4520SKenneth D. Merry.Nm 100130f4520SKenneth D. Merry.Ic start 101fb606ebaSAlexander Motin.Aq lun 102130f4520SKenneth D. Merry.Op general options 103130f4520SKenneth D. Merry.Op Fl i 104130f4520SKenneth D. Merry.Op Fl o 105130f4520SKenneth D. Merry.Nm 106130f4520SKenneth D. Merry.Ic stop 107fb606ebaSAlexander Motin.Aq lun 108130f4520SKenneth D. Merry.Op general options 109130f4520SKenneth D. Merry.Op Fl i 110130f4520SKenneth D. Merry.Op Fl o 111130f4520SKenneth D. Merry.Nm 112130f4520SKenneth D. Merry.Ic synccache 113fb606ebaSAlexander Motin.Aq lun 114130f4520SKenneth D. Merry.Op general options 115130f4520SKenneth D. Merry.Op Fl l Ar lba 116130f4520SKenneth D. Merry.Op Fl b Ar blockcount 117130f4520SKenneth D. Merry.Op Fl r 118130f4520SKenneth D. Merry.Op Fl i 119130f4520SKenneth D. Merry.Op Fl c Ar cdbsize 120130f4520SKenneth D. Merry.Nm 121130f4520SKenneth D. Merry.Ic lunlist 122130f4520SKenneth D. Merry.Nm 123130f4520SKenneth D. Merry.Ic delay 124fb606ebaSAlexander Motin.Aq lun 125130f4520SKenneth D. Merry.Aq Fl l Ar datamove|done 126130f4520SKenneth D. Merry.Aq Fl t Ar secs 127130f4520SKenneth D. Merry.Op Fl T Ar oneshot|cont 128130f4520SKenneth D. Merry.Nm 129130f4520SKenneth D. Merry.Ic inject 130130f4520SKenneth D. Merry.Aq Fl i Ar action 131130f4520SKenneth D. Merry.Aq Fl p Ar pattern 132130f4520SKenneth D. Merry.Op Fl r Ar lba,len 133130f4520SKenneth D. Merry.Op Fl s Ar len fmt Op Ar args 134130f4520SKenneth D. Merry.Op Fl c 135130f4520SKenneth D. Merry.Op Fl d Ar delete_id 136130f4520SKenneth D. Merry.Nm 137130f4520SKenneth D. Merry.Ic create 138130f4520SKenneth D. Merry.Aq Fl b Ar backend 139130f4520SKenneth D. Merry.Op Fl B Ar blocksize 140130f4520SKenneth D. Merry.Op Fl d Ar device_id 141130f4520SKenneth D. Merry.Op Fl l Ar lun_id 142130f4520SKenneth D. Merry.Op Fl o Ar name=value 143130f4520SKenneth D. Merry.Op Fl s Ar size_bytes 144130f4520SKenneth D. Merry.Op Fl S Ar serial_num 145130f4520SKenneth D. Merry.Op Fl t Ar device_type 146130f4520SKenneth D. Merry.Nm 147130f4520SKenneth D. Merry.Ic remove 148130f4520SKenneth D. Merry.Aq Fl b Ar backend 149130f4520SKenneth D. Merry.Aq Fl l Ar lun_id 150130f4520SKenneth D. Merry.Op Fl o Ar name=value 151130f4520SKenneth D. Merry.Nm 15281177295SEdward Tomasz Napierala.Ic modify 15381177295SEdward Tomasz Napierala.Aq Fl b Ar backend 15481177295SEdward Tomasz Napierala.Aq Fl l Ar lun_id 155a3977beaSAlexander Motin.Op Fl o Ar name=value 15681177295SEdward Tomasz Napierala.Aq Fl s Ar size_bytes 15781177295SEdward Tomasz Napierala.Nm 158130f4520SKenneth D. Merry.Ic devlist 159130f4520SKenneth D. Merry.Op Fl b Ar backend 160130f4520SKenneth D. Merry.Op Fl v 161130f4520SKenneth D. Merry.Op Fl x 162130f4520SKenneth D. Merry.Nm 163130f4520SKenneth D. Merry.Ic port 1648951f055SMarcelo Araujo.Op Fl c 16560107d23SAlan Somers.Op Fl d Ar driver 166130f4520SKenneth D. Merry.Op Fl o Ar on|off 167130f4520SKenneth D. Merry.Op Fl w Ar wwpn 168130f4520SKenneth D. Merry.Op Fl W Ar wwnn 169afecc74cSAlan Somers.Op Fl O Ar name=value 170130f4520SKenneth D. Merry.Op Fl p Ar targ_port 171f12d378fSJohn Baldwin.Op Fl r 172130f4520SKenneth D. Merry.Op Fl t Ar fe_type 173130f4520SKenneth D. Merry.Nm 174555e99a3SAlexander Motin.Ic portlist 175555e99a3SAlexander Motin.Op Fl f Ar frontend 176555e99a3SAlexander Motin.Op Fl i 177920c6cbaSAlexander Motin.Op Fl l 178555e99a3SAlexander Motin.Op Fl p Ar targ_port 179555e99a3SAlexander Motin.Op Fl q 180555e99a3SAlexander Motin.Op Fl v 181555e99a3SAlexander Motin.Op Fl x 182555e99a3SAlexander Motin.Nm 183920c6cbaSAlexander Motin.Ic lunmap 184920c6cbaSAlexander Motin.Aq Fl p Ar targ_port 185920c6cbaSAlexander Motin.Op Fl l Ar pLUN 186920c6cbaSAlexander Motin.Op Fl L Ar cLUN 187920c6cbaSAlexander Motin.Nm 188130f4520SKenneth D. Merry.Ic dumpooa 189130f4520SKenneth D. Merry.Nm 190130f4520SKenneth D. Merry.Ic dumpstructs 191130f4520SKenneth D. Merry.Nm 192009ea47eSEdward Tomasz Napierala.Ic islist 193009ea47eSEdward Tomasz Napierala.Op Fl v 194009ea47eSEdward Tomasz Napierala.Op Fl x 195009ea47eSEdward Tomasz Napierala.Nm 196009ea47eSEdward Tomasz Napierala.Ic islogout 197abec6193SEdward Tomasz Napierala.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal 198009ea47eSEdward Tomasz Napierala.Nm 199009ea47eSEdward Tomasz Napierala.Ic isterminate 200abec6193SEdward Tomasz Napierala.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal 201009ea47eSEdward Tomasz Napierala.Nm 2024f9fa31cSJohn Baldwin.Ic nvlist 2034f9fa31cSJohn Baldwin.Op Fl v 2044f9fa31cSJohn Baldwin.Op Fl x 2054f9fa31cSJohn Baldwin.Nm 20617c907ddSJohn Baldwin.Ic nvterminate 20717c907ddSJohn Baldwin.Aq Fl a | Fl c Ar controller-id | Fl h Ar name 20817c907ddSJohn Baldwin.Nm 209130f4520SKenneth D. Merry.Ic help 210130f4520SKenneth D. Merry.Sh DESCRIPTION 211130f4520SKenneth D. MerryThe 212130f4520SKenneth D. Merry.Nm 213130f4520SKenneth D. Merryutility is designed to provide a way to access and control the CAM Target 214130f4520SKenneth D. MerryLayer (CTL). 215130f4520SKenneth D. MerryIt provides a way to send 216130f4520SKenneth D. Merry.Tn SCSI 217130f4520SKenneth D. Merrycommands to the CTL layer, and also provides 218130f4520SKenneth D. Merrysome meta-commands that utilize 219130f4520SKenneth D. Merry.Tn SCSI 220130f4520SKenneth D. Merrycommands. 221130f4520SKenneth D. Merry(For instance, the 222130f4520SKenneth D. Merry.Ic lunlist 223130f4520SKenneth D. Merrycommand is implemented using the 224130f4520SKenneth D. Merry.Tn SCSI 225130f4520SKenneth D. MerryREPORT LUNS and INQUIRY commands.) 226130f4520SKenneth D. Merry.Pp 227130f4520SKenneth D. MerryThe 228130f4520SKenneth D. Merry.Nm 229130f4520SKenneth D. Merryutility has a number of primary functions, many of which require a device 230130f4520SKenneth D. Merryidentifier. 231130f4520SKenneth D. MerryThe device identifier takes the following form: 232130f4520SKenneth D. Merry.Bl -tag -width 14n 233fb606ebaSAlexander Motin.It lun 234fb606ebaSAlexander MotinSpecify the LUN number to operate on. 235130f4520SKenneth D. Merry.El 236130f4520SKenneth D. MerryMany of the primary functions of the 237130f4520SKenneth D. Merry.Nm 238130f4520SKenneth D. Merryutility take the following optional arguments: 239130f4520SKenneth D. Merry.Bl -tag -width 10n 240130f4520SKenneth D. Merry.It Fl C Ar retries 241130f4520SKenneth D. MerrySpecify the number of times to retry a command in the event of failure. 242130f4520SKenneth D. Merry.It Fl D Ar device 2436d6d6c36SGordon BerglingSpecify the device to open. 2446d6d6c36SGordon BerglingThis allows opening a device other than the default device, 245130f4520SKenneth D. Merry.Pa /dev/cam/ctl , 246130f4520SKenneth D. Merryto be opened for sending commands. 247130f4520SKenneth D. Merry.It Fl I Ar id 248130f4520SKenneth D. MerrySpecify the initiator number to use. 249130f4520SKenneth D. MerryBy default, 250130f4520SKenneth D. Merry.Nm 251130f4520SKenneth D. Merrywill use 7 as the initiator number. 252130f4520SKenneth D. Merry.El 253130f4520SKenneth D. Merry.Pp 254130f4520SKenneth D. MerryPrimary commands: 255130f4520SKenneth D. Merry.Bl -tag -width 11n 256130f4520SKenneth D. Merry.It Ic tur 257130f4520SKenneth D. MerrySend the 258130f4520SKenneth D. Merry.Tn SCSI 259130f4520SKenneth D. MerryTEST UNIT READY command to the device and report whether or not it is 260130f4520SKenneth D. Merryready. 261130f4520SKenneth D. Merry.It Ic inquiry 262130f4520SKenneth D. MerrySend the 263130f4520SKenneth D. Merry.Tn SCSI 264130f4520SKenneth D. MerryINQUIRY command to the device and display some of the returned inquiry 265130f4520SKenneth D. Merrydata. 266130f4520SKenneth D. Merry.It Ic reqsense 267130f4520SKenneth D. MerrySend the 268130f4520SKenneth D. Merry.Tn SCSI 269130f4520SKenneth D. MerryREQUEST SENSE command to the device and display the returned sense 270130f4520SKenneth D. Merryinformation. 271130f4520SKenneth D. Merry.It Ic reportluns 272130f4520SKenneth D. MerrySend the 273130f4520SKenneth D. Merry.Tn SCSI 274130f4520SKenneth D. MerryREPORT LUNS command to the device and display supported LUNs. 275130f4520SKenneth D. Merry.It Ic read 276130f4520SKenneth D. MerrySend a 277130f4520SKenneth D. Merry.Tn SCSI 278130f4520SKenneth D. MerryREAD command to the device, and write the requested data to a file or 279130f4520SKenneth D. Merrystdout. 280130f4520SKenneth D. Merry.Bl -tag -width 12n 281130f4520SKenneth D. Merry.It Fl l Ar lba 2826d6d6c36SGordon BerglingSpecify the starting Logical Block Address for the READ. 2836d6d6c36SGordon BerglingThis can be specified in decimal, octal (starting with 0), 2846d6d6c36SGordon Berglinghexadecimal (starting with 0x) or any other base supported by 285130f4520SKenneth D. Merry.Xr strtoull 3 . 286130f4520SKenneth D. Merry.It Fl d Ar datalen 287130f4520SKenneth D. MerrySpecify the length, in 512 byte blocks, of the READ request. 288130f4520SKenneth D. Merry.It Fl f Ar file 2896d6d6c36SGordon BerglingSpecify the destination for the data read by the READ command. 2906d6d6c36SGordon BerglingEither a filename or 291130f4520SKenneth D. Merry.Sq - 292130f4520SKenneth D. Merryfor stdout may be specified. 293130f4520SKenneth D. Merry.It Fl c Ar cdbsize 294130f4520SKenneth D. MerrySpecify the minimum 295130f4520SKenneth D. Merry.Tn SCSI 2966d6d6c36SGordon BerglingCDB (Command Data Block) size to be used for the READ request. 2976d6d6c36SGordon BerglingAllowable values are 6, 10, 12 and 16. 2986d6d6c36SGordon BerglingDepending upon the LBA and amount of data requested, a larger CDB 2996d6d6c36SGordon Berglingsize may be used to satisfy the request. (e.g., for LBAs above 0xffffffff, 3006d6d6c36SGordon BerglingREAD(16) must be used to satisfy the request.) 301130f4520SKenneth D. Merry.It Fl b Ar blocksize 302130f4520SKenneth D. MerrySpecify the blocksize of the underlying 303130f4520SKenneth D. Merry.Tn SCSI 304130f4520SKenneth D. Merrydevice, so the transfer length 3056d6d6c36SGordon Berglingcan be calculated accurately. 3066d6d6c36SGordon BerglingThe blocksize can be obtained via the 307130f4520SKenneth D. Merry.Tn SCSI 308130f4520SKenneth D. MerryREAD CAPACITY command. 309130f4520SKenneth D. Merry.It Fl N 310130f4520SKenneth D. MerryDo not copy data to 311130f4520SKenneth D. Merry.Nm 312130f4520SKenneth D. Merryfrom the kernel when doing a read, just execute the command without copying 313130f4520SKenneth D. Merrydata. 314130f4520SKenneth D. MerryThis is to be used for performance testing. 315130f4520SKenneth D. Merry.El 316130f4520SKenneth D. Merry.It Ic write 317130f4520SKenneth D. MerryRead data from a file or stdin, and write the data to the device using the 318130f4520SKenneth D. Merry.Tn SCSI 319130f4520SKenneth D. MerryWRITE command. 320130f4520SKenneth D. Merry.Bl -tag -width 12n 321130f4520SKenneth D. Merry.It Fl l Ar lba 3226d6d6c36SGordon BerglingSpecify the starting Logical Block Address for the WRITE. 3236d6d6c36SGordon BerglingThis can be specified in decimal, octal (starting with 0), hexadecimal 3246d6d6c36SGordon Bergling(starting with 0x) or any other base supported by 325130f4520SKenneth D. Merry.Xr strtoull 3 . 326130f4520SKenneth D. Merry.It Fl d Ar atalen 327130f4520SKenneth D. MerrySpecify the length, in 512 byte blocks, of the WRITE request. 328130f4520SKenneth D. Merry.It Fl f Ar file 3296d6d6c36SGordon BerglingSpecify the source for the data to be written by the WRITE command. 3306d6d6c36SGordon BerglingEither a filename or 331130f4520SKenneth D. Merry.Sq - 332130f4520SKenneth D. Merryfor stdin may be specified. 333130f4520SKenneth D. Merry.It Fl c Ar cdbsize 334130f4520SKenneth D. MerrySpecify the minimum 335130f4520SKenneth D. Merry.Tn SCSI 3366d6d6c36SGordon BerglingCDB (Command Data Block) size to be used for the READ request. 3376d6d6c36SGordon BerglingAllowable values are 6, 10, 12 and 16. 3386d6d6c36SGordon BerglingDepending upon the LBA and amount of data requested, a larger CDB size 3396d6d6c36SGordon Berglingmay be used to satisfy the request. (e.g., for LBAs above 0xffffffff, READ(16) 3406d6d6c36SGordon Berglingmust be used to satisfy the request.) 341130f4520SKenneth D. Merry.It Fl b Ar blocksize 342130f4520SKenneth D. MerrySpecify the blocksize of the underlying 343130f4520SKenneth D. Merry.Tn SCSI 344130f4520SKenneth D. Merrydevice, so the transfer length 3456d6d6c36SGordon Berglingcan be calculated accurately. 3466d6d6c36SGordon BerglingThe blocksize can be obtained via the 347130f4520SKenneth D. Merry.Tn SCSI 348130f4520SKenneth D. MerryREAD CAPACITY command. 349130f4520SKenneth D. Merry.It Fl N 350130f4520SKenneth D. MerryDo not copy data to 351130f4520SKenneth D. Merry.Nm 352130f4520SKenneth D. Merryto the kernel when doing a write, just execute the command without copying 353130f4520SKenneth D. Merrydata. 354130f4520SKenneth D. MerryThis is to be used for performance testing. 355130f4520SKenneth D. Merry.El 356130f4520SKenneth D. Merry.It Ic readcap 357130f4520SKenneth D. MerrySend the 358130f4520SKenneth D. Merry.Tn SCSI 359130f4520SKenneth D. MerryREAD CAPACITY command to the device and display the device size and device 3606d6d6c36SGordon Berglingblock size. 3616d6d6c36SGordon BerglingBy default, READ CAPACITY(10) is used. 3626d6d6c36SGordon BerglingIf the device returns a maximum LBA of 0xffffffff, however, 363130f4520SKenneth D. Merry.Nm 364130f4520SKenneth D. Merrywill automatically issue a READ CAPACITY(16), which is implemented as a 3656d6d6c36SGordon Berglingservice action of the SERVICE ACTION IN(16) opcode. 3666d6d6c36SGordon BerglingThe user can specify the minimum CDB size with the 367130f4520SKenneth D. Merry.Fl c 3686d6d6c36SGordon Berglingargument. 3696d6d6c36SGordon BerglingValid values for the 370130f4520SKenneth D. Merry.Fl c 3716d6d6c36SGordon Berglingoption are 10 and 16. 3726d6d6c36SGordon BerglingIf a 10 byte CDB is specified, the request will be automatically reissued 3736d6d6c36SGordon Berglingwith a 16 byte CDB if the maximum LBA returned is 0xffffffff. 374130f4520SKenneth D. Merry.It Ic modesense 375130f4520SKenneth D. MerrySend a 376130f4520SKenneth D. Merry.Tn SCSI 377130f4520SKenneth D. MerryMODE SENSE command to the device, and display the requested mode page(s) or 378130f4520SKenneth D. Merrypage list. 379130f4520SKenneth D. Merry.Bl -tag -width 10n 380130f4520SKenneth D. Merry.It Fl m Ar page 3816d6d6c36SGordon BerglingSpecify the mode page to display. 3826d6d6c36SGordon BerglingThis option and the 383130f4520SKenneth D. Merry.Fl l 3846d6d6c36SGordon Berglingoption are mutually exclusive. 3856d6d6c36SGordon BerglingOne of the two must be specified, though. 386130f4520SKenneth D. MerryMode page numbers may be specified in decimal or hexadecimal. 387130f4520SKenneth D. Merry.It Fl l 388130f4520SKenneth D. MerryRequest that the list of mode pages supported by the device be returned. 389130f4520SKenneth D. MerryThis option and the 390130f4520SKenneth D. Merry.Fl m 3916d6d6c36SGordon Berglingoption are mutually exclusive. 3926d6d6c36SGordon BerglingOne of the two must be specified, though. 393130f4520SKenneth D. Merry.It Fl P Ar pc 3946d6d6c36SGordon BerglingSpecify the mode page control value. 3956d6d6c36SGordon BerglingPossible values are: 396130f4520SKenneth D. Merry.Bl -tag -width 2n -compact 397130f4520SKenneth D. Merry.It 0 398130f4520SKenneth D. MerryCurrent values. 399130f4520SKenneth D. Merry.It 1 400130f4520SKenneth D. MerryChangeable value bitmask. 401130f4520SKenneth D. Merry.It 2 402130f4520SKenneth D. MerryDefault values. 403130f4520SKenneth D. Merry.It 3 404130f4520SKenneth D. MerrySaved values. 405130f4520SKenneth D. Merry.El 406130f4520SKenneth D. Merry.It Fl d 407130f4520SKenneth D. MerryDisable block descriptors when sending the mode sense request. 408130f4520SKenneth D. Merry.It Fl S Ar subpage 409130f4520SKenneth D. MerrySpecify the subpage used with the mode sense request. 410130f4520SKenneth D. Merry.It Fl c Ar cdbsize 4116d6d6c36SGordon BerglingSpecify the CDB size used for the mode sense request. 4126d6d6c36SGordon BerglingSupported values are 6 and 10. 413130f4520SKenneth D. Merry.El 414130f4520SKenneth D. Merry.It Ic start 415130f4520SKenneth D. MerrySend the 416130f4520SKenneth D. Merry.Tn SCSI 417130f4520SKenneth D. MerrySTART STOP UNIT command to the specified LUN with the start 418130f4520SKenneth D. Merrybit set. 419130f4520SKenneth D. Merry.Bl -tag -width 4n 420130f4520SKenneth D. Merry.It Fl i 4216d6d6c36SGordon BerglingSet the immediate bit in the CDB. 4226d6d6c36SGordon BerglingNote that CTL does not support the immediate bit, so this is primarily 4236d6d6c36SGordon Berglinguseful for making sure that CTL returns the proper error. 424130f4520SKenneth D. Merry.El 425130f4520SKenneth D. Merry.It Ic stop 426130f4520SKenneth D. MerrySend the 427130f4520SKenneth D. Merry.Tn SCSI 428130f4520SKenneth D. MerrySTART STOP UNIT command to the specified LUN with the start 4296d6d6c36SGordon Berglingbit cleared. 4306d6d6c36SGordon BerglingWe use an ordered tag to stop the LUN, so we can guarantee that all pending 4316d6d6c36SGordon BerglingI/O executes before it is stopped. 4326d6d6c36SGordon Bergling(CTL guarantees this anyway, but 433130f4520SKenneth D. Merry.Nm 434130f4520SKenneth D. Merrysends an ordered tag for completeness.) 435130f4520SKenneth D. Merry.Bl -tag -width 4n 436130f4520SKenneth D. Merry.It Fl i 4376d6d6c36SGordon BerglingSet the immediate bit in the CDB. 4386d6d6c36SGordon BerglingNote that CTL does not support the immediate bit, so this is primarily 4396d6d6c36SGordon Berglinguseful for making sure that CTL returns the proper error. 440130f4520SKenneth D. Merry.El 441130f4520SKenneth D. Merry.It Ic synccache 442130f4520SKenneth D. MerrySend the 443130f4520SKenneth D. Merry.Tn SCSI 4446d6d6c36SGordon BerglingSYNCHRONIZE CACHE command to the device. 4456d6d6c36SGordon BerglingBy default, SYNCHRONIZE CACHE(10) is used. 4466d6d6c36SGordon BerglingIf the specified starting LBA is greater than 0xffffffff or the length is 4476d6d6c36SGordon Berglinggreater than 0xffff, though, SYNCHRONIZE CACHE(16) will be used. 4486d6d6c36SGordon BerglingThe 16 byte command will also be used if the user specifies a 16 byte CDB with the 449130f4520SKenneth D. Merry.Fl c 450130f4520SKenneth D. Merryargument. 451130f4520SKenneth D. Merry.Bl -tag -width 14n 452130f4520SKenneth D. Merry.It Fl l Ar lba 4536d6d6c36SGordon BerglingSpecify the starting LBA of the cache region to synchronize. 4546d6d6c36SGordon BerglingThis option is a no-op for CTL. 4556d6d6c36SGordon BerglingIf you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. 456130f4520SKenneth D. Merry.It Fl b Ar blockcount 4576d6d6c36SGordon BerglingSpecify the length of the cache region to synchronize. 4586d6d6c36SGordon BerglingThis option is a no-op for CTL. 4596d6d6c36SGordon BerglingIf you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. 460130f4520SKenneth D. Merry.It Fl r 4616d6d6c36SGordon BerglingSpecify relative addressing for the starting LBA. 4626d6d6c36SGordon BerglingCTL does not support relative addressing, since it only works for linked commands, 4636d6d6c36SGordon Berglingand CTL does not support linked commands. 464130f4520SKenneth D. Merry.It Fl i 46577381bd8SSergey KandaurovTell the target to return status immediately after issuing the SYNCHRONIZE CACHE 4666d6d6c36SGordon Berglingcommand rather than waiting for the cache to finish syncing. 4676d6d6c36SGordon BerglingCTL does not support this bit. 468130f4520SKenneth D. Merry.It Fl c Ar cdbsize 4696d6d6c36SGordon BerglingSpecify the minimum CDB size. 4706d6d6c36SGordon BerglingValid values are 10 and 16 bytes. 471130f4520SKenneth D. Merry.El 472130f4520SKenneth D. Merry.It Ic lunlist 473130f4520SKenneth D. MerryList all LUNs registered with CTL. 474130f4520SKenneth D. MerryBecause this command uses the ioctl port, it will only work when the FETDs 475130f4520SKenneth D. Merry(Front End Target Drivers) are enabled. 476130f4520SKenneth D. MerryThis command is the equivalent of doing a REPORT LUNS on one LUN and then 477344c81a1SWarren Blockan INQUIRY on each LUN in the system. 478130f4520SKenneth D. Merry.It Ic delay 4796d6d6c36SGordon BerglingDelay commands at the given location. 4806d6d6c36SGordon BerglingThere are two places where commands may be delayed currently: before data is transferred 481130f4520SKenneth D. Merry.Pq Dq datamove 482130f4520SKenneth D. Merryand just prior to sending status to the host 483130f4520SKenneth D. Merry.Pq Dq done . 484130f4520SKenneth D. MerryOne of the two must be supplied as an argument to the 485130f4520SKenneth D. Merry.Fl l 4866d6d6c36SGordon Berglingoption. 4876d6d6c36SGordon BerglingThe 488130f4520SKenneth D. Merry.Fl t 489130f4520SKenneth D. Merryoption must also be specified. 490130f4520SKenneth D. Merry.Bl -tag -width 12n 491130f4520SKenneth D. Merry.It Fl l Ar delayloc 492130f4520SKenneth D. MerryDelay command(s) at the specified location. 493130f4520SKenneth D. MerryThis can either be at the data movement stage (datamove) or prior to 494130f4520SKenneth D. Merrycommand completion (done). 495130f4520SKenneth D. Merry.It Fl t Ar delaytime 4966d6d6c36SGordon BerglingDelay command(s) for the specified number of seconds. 4976d6d6c36SGordon BerglingThis must be specified. 4986d6d6c36SGordon BerglingIf set to 0, it will clear out any previously set delay for this particular 4996d6d6c36SGordon Berglinglocation (datamove or done). 500130f4520SKenneth D. Merry.It Fl T Ar delaytype 501130f4520SKenneth D. MerrySpecify the delay type. 502130f4520SKenneth D. MerryBy default, the 503130f4520SKenneth D. Merry.Ic delay 504130f4520SKenneth D. Merryoption will delay the next command sent to the given LUN. 505130f4520SKenneth D. MerryWith the 506130f4520SKenneth D. Merry.Fl T Ar cont 507130f4520SKenneth D. Merryoption, every command will be delayed by the specified period of time. 508130f4520SKenneth D. MerryWith the 509130f4520SKenneth D. Merry.Fl T Ar oneshot 510130f4520SKenneth D. Merrythe next command sent to the given LUN will be delayed and all subsequent 511130f4520SKenneth D. Merrycommands will be completed normally. 512130f4520SKenneth D. MerryThis is the default. 513130f4520SKenneth D. Merry.El 514130f4520SKenneth D. Merry.It Ic inject 515130f4520SKenneth D. MerryInject the specified type of error for the LUN specified, when a command 516130f4520SKenneth D. Merrythat matches the given pattern is seen. 517130f4520SKenneth D. MerryThe sense data returned is in either fixed or descriptor format, depending 518130f4520SKenneth D. Merryupon the status of the D_SENSE bit in the control mode page (page 0xa) for 519130f4520SKenneth D. Merrythe LUN. 520130f4520SKenneth D. Merry.Pp 521130f4520SKenneth D. MerryErrors are only injected for commands that have not already failed for 522130f4520SKenneth D. Merryother reasons. 523130f4520SKenneth D. MerryBy default, only the first command matching the pattern specified is 524130f4520SKenneth D. Merryreturned with the supplied error. 525130f4520SKenneth D. Merry.Pp 526130f4520SKenneth D. MerryIf the 527130f4520SKenneth D. Merry.Fl c 528130f4520SKenneth D. Merryflag is specified, all commands matching the pattern will be returned with 529130f4520SKenneth D. Merrythe specified error until the error injection command is deleted with 530130f4520SKenneth D. Merry.Fl d 531130f4520SKenneth D. Merryflag. 532130f4520SKenneth D. Merry.Bl -tag -width 17n 533130f4520SKenneth D. Merry.It Fl i Ar action 534130f4520SKenneth D. MerrySpecify the error to return: 535130f4520SKenneth D. Merry.Bl -tag -width 10n 536130f4520SKenneth D. Merry.It aborted 537130f4520SKenneth D. MerryReturn the next matching command on the specified LUN with the sense key 538130f4520SKenneth D. MerryABORTED COMMAND (0x0b), and the ASC/ASCQ 0x45,0x00 ("Select or reselect 539130f4520SKenneth D. Merryfailure"). 540130f4520SKenneth D. Merry.It mediumerr 541130f4520SKenneth D. MerryReturn the next matching command on the specified LUN with the sense key 542130f4520SKenneth D. MerryMEDIUM ERROR (0x03) and the ASC/ASCQ 0x11,0x00 ("Unrecovered read error") for 543130f4520SKenneth D. Merryreads, or ASC/ASCQ 0x0c,0x02 ("Write error - auto reallocation failed") 544130f4520SKenneth D. Merryfor write errors. 545130f4520SKenneth D. Merry.It ua 546130f4520SKenneth D. MerryReturn the next matching command on the specified LUN with the sense key 547130f4520SKenneth D. MerryUNIT ATTENTION (0x06) and the ASC/ASCQ 0x29,0x00 ("POWER ON, RESET, OR BUS 548130f4520SKenneth D. MerryDEVICE RESET OCCURRED"). 549130f4520SKenneth D. Merry.It custom 550130f4520SKenneth D. MerryReturn the next matching command on the specified LUN with the supplied 551130f4520SKenneth D. Merrysense data. 552130f4520SKenneth D. MerryThe 553130f4520SKenneth D. Merry.Fl s 554130f4520SKenneth D. Merryargument must be specified. 555130f4520SKenneth D. Merry.El 556130f4520SKenneth D. Merry.It Fl p Ar pattern 557130f4520SKenneth D. MerrySpecify which commands should be returned with the given error. 558130f4520SKenneth D. Merry.Bl -tag -width 10n 559130f4520SKenneth D. Merry.It read 560130f4520SKenneth D. MerryThe error should apply to READ(6), READ(10), READ(12), READ(16), etc. 561130f4520SKenneth D. Merry.It write 562130f4520SKenneth D. MerryThe error should apply to WRITE(6), WRITE(10), WRITE(12), WRITE(16), WRITE 563130f4520SKenneth D. MerryAND VERIFY(10), etc. 564130f4520SKenneth D. Merry.It rw 565130f4520SKenneth D. MerryThe error should apply to both read and write type commands. 566130f4520SKenneth D. Merry.It readcap 567130f4520SKenneth D. MerryThe error should apply to READ CAPACITY(10) and READ CAPACITY(16) commands. 568130f4520SKenneth D. Merry.It tur 569130f4520SKenneth D. MerryThe error should apply to TEST UNIT READY commands. 570130f4520SKenneth D. Merry.It any 571130f4520SKenneth D. MerryThe error should apply to any command. 572130f4520SKenneth D. Merry.El 573130f4520SKenneth D. Merry.It Fl r Ar lba,len 574130f4520SKenneth D. MerrySpecify the starting lba and length of the range of LBAs which should 575130f4520SKenneth D. Merrytrigger an error. 576130f4520SKenneth D. MerryThis option is only applies when read and/or write patterns are specified. 577130f4520SKenneth D. MerryIf used with other command types, the error will never be triggered. 578130f4520SKenneth D. Merry.It Fl s Ar len fmt Op Ar args 579130f4520SKenneth D. MerrySpecify the sense data that is to be returned for custom actions. 580130f4520SKenneth D. MerryIf the format is 581130f4520SKenneth D. Merry.Sq - , 582130f4520SKenneth D. Merrylen bytes of sense data will be read from standard input and written to the 583130f4520SKenneth D. Merrysense buffer. 584130f4520SKenneth D. MerryIf len is longer than 252 bytes (the maximum allowable 585130f4520SKenneth D. Merry.Tn SCSI 586130f4520SKenneth D. Merrysense data length), it will be truncated to that length. 587130f4520SKenneth D. MerryThe sense data format is described in 588d7ab4963SEdward Tomasz Napierala.Xr cam_cdbparse 3 . 589130f4520SKenneth D. Merry.It Fl c 590130f4520SKenneth D. MerryThe error injection should be persistent, instead of happening once. 591130f4520SKenneth D. MerryPersistent errors must be deleted with the 592130f4520SKenneth D. Merry.Fl d 593130f4520SKenneth D. Merryargument. 594130f4520SKenneth D. Merry.It Fl d Ar delete_id 595130f4520SKenneth D. MerryDelete the specified error injection serial number. 596130f4520SKenneth D. MerryThe serial number is returned when the error is injected. 597130f4520SKenneth D. Merry.El 598130f4520SKenneth D. Merry.It Ic port 599130f4520SKenneth D. MerryPerform one of several CTL frontend port operations. 600bb95fbf6SAlan SomersEither create a new frontend port 60160107d23SAlan Somers.Pq Fl c , 60260107d23SAlan Somersdestroy a frontend port 60360107d23SAlan Somers.Pq Fl r , 604130f4520SKenneth D. Merryturn one or more frontends on 605130f4520SKenneth D. Merryor off 606130f4520SKenneth D. Merry.Pq Fl o Ar on|off , 607130f4520SKenneth D. Merryor set the World Wide Node Name 608130f4520SKenneth D. Merry.Pq Fl w Ar wwnn 609130f4520SKenneth D. Merryor World Wide Port Name 610130f4520SKenneth D. Merry.Pq Fl W Ar wwpn 611130f4520SKenneth D. Merryfor a given port. 612130f4520SKenneth D. MerryOne of 61360107d23SAlan Somers.Fl c , 61460107d23SAlan Somers.Fl r , 615130f4520SKenneth D. Merry.Fl o , 616130f4520SKenneth D. Merryor 617130f4520SKenneth D. Merry.Fl w 618130f4520SKenneth D. Merryor 619130f4520SKenneth D. Merry.Fl W 620130f4520SKenneth D. Merrymust be specified. 621130f4520SKenneth D. MerryThe WWNN and WWPN may both be specified at the same time, but cannot be 622130f4520SKenneth D. Merrycombined with enabling/disabling or listing ports. 623130f4520SKenneth D. Merry.Bl -tag -width 12n 6248951f055SMarcelo Araujo.It Fl c 625afecc74cSAlan SomersCreate new frontend port. 62660107d23SAlan Somers.It Fl d Ar driver 62760107d23SAlan SomersSpecify the name of the frontend driver used by the 62860107d23SAlan Somers.Pq Fl c 62960107d23SAlan Somersor 63060107d23SAlan Somers.Pq Fl r 63160107d23SAlan Somerssubcommands. 63260107d23SAlan SomersValid driver names include 63360107d23SAlan Somers.Dq ioctl , 63460107d23SAlan Somers.Dq iscsi , 63560107d23SAlan Somersand 63660107d23SAlan Somers.Dq nvmf , 63760107d23SAlan Somersbut more can be added by external kernel modules. 638130f4520SKenneth D. Merry.It Fl o Ar on|off 6398951f055SMarcelo AraujoTurn the specified CTL frontend ports on or off. 640130f4520SKenneth D. MerryIf no port number or port type is specified, all ports are turned on or 641130f4520SKenneth D. Merryoff. 6428951f055SMarcelo Araujo.It Fl O Ar pp|vp 6438951f055SMarcelo AraujoSpecify generic options on the ioctl frontend port. 644afecc74cSAlan SomersThe list of recognized options is driver-dependent. 645afecc74cSAlan SomersThe 646afecc74cSAlan Somers.Dq ioctl 647afecc74cSAlan Somersdriver recognizes 648afecc74cSAlan Somers.Dq pp 649afecc74cSAlan Somersand 650afecc74cSAlan Somers.Dq vp . 651afecc74cSAlan SomersThe 652afecc74cSAlan Somers.Dq iscsi 653afecc74cSAlan Somersdriver recongizes 654afecc74cSAlan Somers.Dq cfiscsi_portal_group_tag , 655afecc74cSAlan Somers.Dq cfiscsi_target , 656afecc74cSAlan Somersand 657afecc74cSAlan Somers.Dq cfiscsi_target_alias . 658afecc74cSAlan SomersThe 659afecc74cSAlan Somers.Dq nvmf 660afecc74cSAlan Somersdriver recognizes 661afecc74cSAlan Somers.Dq subnqn , 662afecc74cSAlan Somers.Dq portid , 663afecc74cSAlan Somers.Dq max_io_qsize , 664afecc74cSAlan Somers.Dq enable_timeout , 665afecc74cSAlan Somers.Dq ioccsz , 666afecc74cSAlan Somers.Dq nn , 667afecc74cSAlan Somersand 668afecc74cSAlan Somers.Dq serial . 669130f4520SKenneth D. Merry.It Fl p Ar targ_port 670130f4520SKenneth D. MerrySpecify the frontend port number. 671130f4520SKenneth D. MerryThe port numbers can be found in the frontend port list. 6728951f055SMarcelo Araujo.It Fl r 673edbd489dSAlan SomersRemove a port. 674130f4520SKenneth D. Merry.It Fl t Ar fe_type 67560107d23SAlan SomersSpecify the frontend type used by the 67660107d23SAlan Somers.Pq Fl o , 67760107d23SAlan Somers.Pq Fl w , 67860107d23SAlan Somersand 67960107d23SAlan Somers.Pq Fl W 68060107d23SAlan Somerssubcommands. 681130f4520SKenneth D. MerryCurrently defined port types are 682130f4520SKenneth D. Merry.Dq fc 683130f4520SKenneth D. Merry(Fibre Channel), 684130f4520SKenneth D. Merry.Dq scsi 685130f4520SKenneth D. Merry(Parallel SCSI), 686130f4520SKenneth D. Merry.Dq ioctl 687130f4520SKenneth D. Merry(CTL ioctl interface), 688130f4520SKenneth D. Merryand 689130f4520SKenneth D. Merry.Dq internal 690130f4520SKenneth D. Merry(CTL CAM SIM). 691130f4520SKenneth D. Merry.It Fl w Ar wwnn 692130f4520SKenneth D. MerrySet the World Wide Node Name for the given port. 693130f4520SKenneth D. MerryThe 69460107d23SAlan Somers.Fl p 695130f4520SKenneth D. Merryargument must be specified, since this is only possible to implement on a 696130f4520SKenneth D. Merrysingle port. 697130f4520SKenneth D. MerryAs a general rule, the WWNN should be the same across all ports on the 698130f4520SKenneth D. Merrysystem. 699130f4520SKenneth D. Merry.It Fl W Ar wwpn 700344c81a1SWarren BlockSet the World Wide Port Name for the given port. 701130f4520SKenneth D. MerryThe 70260107d23SAlan Somers.Fl p 703130f4520SKenneth D. Merryargument must be specified, since this is only possible to implement on a 704130f4520SKenneth D. Merrysingle port. 705130f4520SKenneth D. MerryAs a general rule, the WWPN must be different for every port in the system. 706130f4520SKenneth D. Merry.El 707555e99a3SAlexander Motin.It Ic portlist 708555e99a3SAlexander MotinList CTL frontend ports. 709555e99a3SAlexander Motin.Bl -tag -width 12n 710555e99a3SAlexander Motin.It Fl f Ar frontend 711555e99a3SAlexander MotinSpecify the frontend type. 712555e99a3SAlexander Motin.It Fl i 713*8206fcc5SJohn BaldwinReport target and connected initiator names. 714920c6cbaSAlexander Motin.It Fl l 715920c6cbaSAlexander MotinReport LUN mapping. 716555e99a3SAlexander Motin.It Fl p Ar targ_port 717555e99a3SAlexander MotinSpecify the frontend port number. 718555e99a3SAlexander Motin.It Fl q 719555e99a3SAlexander MotinOmit the header in the port list output. 720555e99a3SAlexander Motin.It Fl v 721555e99a3SAlexander MotinEnable verbose output (report all port options). 722555e99a3SAlexander Motin.It Fl x 723555e99a3SAlexander MotinOutput the port list in XML format. 724555e99a3SAlexander Motin.El 725920c6cbaSAlexander Motin.It Ic lunmap 726920c6cbaSAlexander MotinChange LUN mapping for specified port. 727920c6cbaSAlexander MotinIf both 728920c6cbaSAlexander Motin.Ar pLUN 729920c6cbaSAlexander Motinand 730920c6cbaSAlexander Motin.Ar cLUN 731920c6cbaSAlexander Motinare specified -- LUN will be mapped. 732920c6cbaSAlexander MotinIf 733920c6cbaSAlexander Motin.Ar pLUN 734920c6cbaSAlexander Motinis specified, but 735920c6cbaSAlexander Motin.Ar cLUN 736920c6cbaSAlexander Motinis not -- LUN will be unmapped. 737920c6cbaSAlexander MotinIf neither 738920c6cbaSAlexander Motin.Ar pLUN 739920c6cbaSAlexander Motinnor 740920c6cbaSAlexander Motin.Ar cLUN 741920c6cbaSAlexander Motinare specified -- LUN mapping will be disabled, exposing all CTL LUNs. 742920c6cbaSAlexander Motin.Bl -tag -width 12n 743920c6cbaSAlexander Motin.It Fl p Ar targ_port 744920c6cbaSAlexander MotinSpecify the frontend port number. 745920c6cbaSAlexander Motin.It Fl l Ar pLUN 746920c6cbaSAlexander MotinLUN number visible by specified port. 747920c6cbaSAlexander Motin.It Fl L Ar cLUN 748920c6cbaSAlexander MotinCTL LUN number. 749920c6cbaSAlexander Motin.El 750130f4520SKenneth D. Merry.It Ic dumpooa 751130f4520SKenneth D. MerryDump the OOA (Order Of Arrival) queue for each LUN registered with CTL. 752130f4520SKenneth D. Merry.It Ic dumpstructs 753130f4520SKenneth D. MerryDump the CTL structures to the console. 754130f4520SKenneth D. Merry.It Ic create 755130f4520SKenneth D. MerryCreate a new LUN. 756130f4520SKenneth D. MerryThe backend must be specified, and depending upon the backend requested, 757130f4520SKenneth D. Merrysome of the other options may be required. 758130f4520SKenneth D. MerryIf the LUN is created successfully, the LUN configuration will be 759130f4520SKenneth D. Merrydisplayed. 760130f4520SKenneth D. MerryIf LUN creation fails, a message will be displayed describing the failure. 761130f4520SKenneth D. Merry.Bl -tag -width 14n 762130f4520SKenneth D. Merry.It Fl b Ar backend 763130f4520SKenneth D. MerryThe 764130f4520SKenneth D. Merry.Fl b 765130f4520SKenneth D. Merryflag is required. 766130f4520SKenneth D. MerryThis specifies the name backend to use when creating the LUN. 767130f4520SKenneth D. MerryExamples are 768130f4520SKenneth D. Merry.Dq ramdisk 769130f4520SKenneth D. Merryand 770130f4520SKenneth D. Merry.Dq block . 771130f4520SKenneth D. Merry.It Fl B Ar blocksize 772130f4520SKenneth D. MerrySpecify the blocksize of the backend in bytes. 773130f4520SKenneth D. Merry.It Fl d Ar device_id 774130f4520SKenneth D. MerrySpecify the LUN-associated string to use in the 775130f4520SKenneth D. Merry.Tn SCSI 776130f4520SKenneth D. MerryINQUIRY VPD page 0x83 data. 777130f4520SKenneth D. Merry.It Fl l Ar lun_id 778130f4520SKenneth D. MerryRequest that a particular LUN number be assigned. 779130f4520SKenneth D. MerryIf the requested LUN number is not available, the request will fail. 780130f4520SKenneth D. Merry.It Fl o Ar name=value 781130f4520SKenneth D. MerrySpecify a backend-specific name/value pair. 782130f4520SKenneth D. MerryMultiple 783130f4520SKenneth D. Merry.Fl o 784130f4520SKenneth D. Merryarguments may be specified. 785130f4520SKenneth D. MerryRefer to the backend documentation for arguments that may be used. 786130f4520SKenneth D. Merry.It Fl s Ar size_bytes 787130f4520SKenneth D. MerrySpecify the size of the LUN in bytes. 788130f4520SKenneth D. MerrySome backends may allow setting the size (e.g. the ramdisk backend) and for 789130f4520SKenneth D. Merryothers the size may be implicit (e.g. the block backend). 790130f4520SKenneth D. Merry.It Fl S Ar serial_num 791130f4520SKenneth D. MerrySpecify the serial number to be used in the 792130f4520SKenneth D. Merry.Tn SCSI 793130f4520SKenneth D. MerryINQUIRY VPD page 0x80 data. 794130f4520SKenneth D. Merry.It Fl t Ar device_type 795130f4520SKenneth D. MerrySpecify the numeric SCSI device type to use when creating the LUN. 796130f4520SKenneth D. MerryIf this flag is not used, the type of LUN created is backend-specific. 797130f4520SKenneth D. MerryNot all LUN types are supported. 79891be33dcSAlexander MotinCurrently CTL supports Direct Access (type 0), Processor (type 3) 79991be33dcSAlexander Motinand CD/DVD (type 5) LUNs. 800130f4520SKenneth D. MerryThe backend requested may or may not support all of the LUN types that CTL 801130f4520SKenneth D. Merrysupports. 802130f4520SKenneth D. Merry.El 803130f4520SKenneth D. Merry.It Ic remove 804130f4520SKenneth D. MerryRemove a LUN. 805130f4520SKenneth D. MerryThe backend must be specified, and the LUN number must also be specified. 806130f4520SKenneth D. MerryBackend-specific options may also be specified with the 807130f4520SKenneth D. Merry.Fl o 808130f4520SKenneth D. Merryflag. 809130f4520SKenneth D. Merry.Bl -tag -width 14n 810130f4520SKenneth D. Merry.It Fl b Ar backend 811130f4520SKenneth D. MerrySpecify the backend that owns the LUN to be removed. 812130f4520SKenneth D. MerryExamples are 813130f4520SKenneth D. Merry.Dq ramdisk 814130f4520SKenneth D. Merryand 815130f4520SKenneth D. Merry.Dq block . 816130f4520SKenneth D. Merry.It Fl l Ar lun_id 817130f4520SKenneth D. MerrySpecify the LUN number to remove. 818130f4520SKenneth D. Merry.It Fl o Ar name=value 819130f4520SKenneth D. MerrySpecify a backend-specific name/value pair. 820130f4520SKenneth D. MerryMultiple 821130f4520SKenneth D. Merry.Fl o 822130f4520SKenneth D. Merryarguments may be specified. 823130f4520SKenneth D. MerryRefer to the backend documentation for arguments that may be used. 824130f4520SKenneth D. Merry.El 82581177295SEdward Tomasz Napierala.It Ic modify 82681177295SEdward Tomasz NapieralaModify a LUN size. 82781177295SEdward Tomasz NapieralaThe backend, the LUN number, and the size must be specified. 82881177295SEdward Tomasz Napierala.Bl -tag -width 14n 82981177295SEdward Tomasz Napierala.It Fl b Ar backend 8304718651cSBenedict ReuschlingSpecify the backend that owns the LUN to be modified. 83181177295SEdward Tomasz NapieralaExamples are 83281177295SEdward Tomasz Napierala.Dq ramdisk 83381177295SEdward Tomasz Napieralaand 83481177295SEdward Tomasz Napierala.Dq block . 83581177295SEdward Tomasz Napierala.It Fl l Ar lun_id 8364718651cSBenedict ReuschlingSpecify the LUN number to modify. 837a3977beaSAlexander Motin.It Fl o Ar name=value 838a3977beaSAlexander MotinSpecify a backend-specific name/value pair. 839a3977beaSAlexander MotinMultiple 840a3977beaSAlexander Motin.Fl o 841a3977beaSAlexander Motinarguments may be specified. 842a3977beaSAlexander MotinRefer to the backend documentation for arguments that may be used. 84381177295SEdward Tomasz Napierala.It Fl s Ar size_bytes 84481177295SEdward Tomasz NapieralaSpecify the size of the LUN in bytes. 84581177295SEdward Tomasz NapieralaFor the 84681177295SEdward Tomasz Napierala.Dq block 84781177295SEdward Tomasz Napieralabackend, an 84881177295SEdward Tomasz Napierala.Dq auto 84981177295SEdward Tomasz Napieralakeyword may be passed instead; this will make CTL use the size of backing 85081177295SEdward Tomasz Napieralafile or device. 85181177295SEdward Tomasz Napierala.El 852130f4520SKenneth D. Merry.It Ic devlist 853130f4520SKenneth D. MerryGet a list of all configured LUNs. 854130f4520SKenneth D. MerryThis also includes the LUN size and blocksize, serial number and device ID. 855130f4520SKenneth D. Merry.Bl -tag -width 11n 856130f4520SKenneth D. Merry.It Fl b Ar backend 857130f4520SKenneth D. MerrySpecify the backend. 858130f4520SKenneth D. MerryThis restricts the LUN list to the named backend. 859130f4520SKenneth D. MerryExamples are 860130f4520SKenneth D. Merry.Dq ramdisk 861130f4520SKenneth D. Merryand 862130f4520SKenneth D. Merry.Dq block . 863130f4520SKenneth D. Merry.It Fl v 864130f4520SKenneth D. MerryBe verbose. 865130f4520SKenneth D. MerryThis will also display any backend-specific LUN attributes in addition to 866130f4520SKenneth D. Merrythe standard per-LUN information. 867130f4520SKenneth D. Merry.It Fl x 868130f4520SKenneth D. MerryDump the raw XML. 869130f4520SKenneth D. MerryThe LUN list information from the kernel comes in XML format, and this 870130f4520SKenneth D. Merryoption allows the display of the raw XML data. 871130f4520SKenneth D. MerryThis option and the 872130f4520SKenneth D. Merry.Fl v 873130f4520SKenneth D. Merryand 874130f4520SKenneth D. Merry.Fl b 875130f4520SKenneth D. Merryoptions are mutually exclusive. 876130f4520SKenneth D. MerryIf you specify 877130f4520SKenneth D. Merry.Fl x , 878130f4520SKenneth D. Merrythe entire LUN database is displayed in XML format. 879130f4520SKenneth D. Merry.El 880009ea47eSEdward Tomasz Napierala.It Ic islist 88123902fd2SEdward Tomasz NapieralaGet a list of currently running iSCSI sessions. 882009ea47eSEdward Tomasz NapieralaThis includes initiator and target names and the unique connection IDs. 883009ea47eSEdward Tomasz Napierala.Bl -tag -width 11n 884009ea47eSEdward Tomasz Napierala.It Fl v 885009ea47eSEdward Tomasz NapieralaVerbose mode. 886009ea47eSEdward Tomasz Napierala.It Fl x 887009ea47eSEdward Tomasz NapieralaDump the raw XML. 88823902fd2SEdward Tomasz NapieralaThe sessions list information from the kernel comes in XML format, and this 889009ea47eSEdward Tomasz Napieralaoption allows the display of the raw XML data. 890009ea47eSEdward Tomasz Napierala.El 891009ea47eSEdward Tomasz Napierala.It Ic islogout 89223902fd2SEdward Tomasz NapieralaAsk the initiator to log out iSCSI sessions matching criteria. 893009ea47eSEdward Tomasz Napierala.Bl -tag -width 11n 894009ea47eSEdward Tomasz Napierala.It Fl a 89523902fd2SEdward Tomasz NapieralaLog out all sessions. 896009ea47eSEdward Tomasz Napierala.It Fl c 897009ea47eSEdward Tomasz NapieralaSpecify connection ID. 898009ea47eSEdward Tomasz Napierala.It Fl i 899009ea47eSEdward Tomasz NapieralaSpecify initiator name. 900abec6193SEdward Tomasz Napierala.It Fl p 901abec6193SEdward Tomasz NapieralaSpecify initiator portal (hostname or IP address). 902009ea47eSEdward Tomasz Napierala.El 903009ea47eSEdward Tomasz Napierala.It Ic isterminate 90423902fd2SEdward Tomasz NapieralaForcibly terminate iSCSI sessions matching criteria. 905009ea47eSEdward Tomasz Napierala.Bl -tag -width 11n 906009ea47eSEdward Tomasz Napierala.It Fl a 90723902fd2SEdward Tomasz NapieralaTerminate all sessions. 908009ea47eSEdward Tomasz Napierala.It Fl c 909009ea47eSEdward Tomasz NapieralaSpecify connection ID. 910009ea47eSEdward Tomasz Napierala.It Fl i 911009ea47eSEdward Tomasz NapieralaSpecify initiator name. 912abec6193SEdward Tomasz Napierala.It Fl p 913abec6193SEdward Tomasz NapieralaSpecify initiator portal (hostname or IP address). 914009ea47eSEdward Tomasz Napierala.El 9154f9fa31cSJohn Baldwin.It Ic nvlist 9164f9fa31cSJohn BaldwinGet a list of currently running NVMeoF associations. 9174f9fa31cSJohn BaldwinThis includes host and controller names and the unique controller IDs. 9184f9fa31cSJohn Baldwin.Bl -tag -width 11n 9194f9fa31cSJohn Baldwin.It Fl v 9204f9fa31cSJohn BaldwinVerbose mode. 9214f9fa31cSJohn Baldwin.It Fl x 9224f9fa31cSJohn BaldwinDump the raw XML. 9234f9fa31cSJohn BaldwinThe sessions list information from the kernel comes in XML format, and this 9244f9fa31cSJohn Baldwinoption allows the display of the raw XML data. 9254f9fa31cSJohn Baldwin.El 92617c907ddSJohn Baldwin.It Ic nvterminate 92717c907ddSJohn BaldwinForcibly terminate NVMeoF associations matching criteria. 92817c907ddSJohn Baldwin.Bl -tag -width 11n 92917c907ddSJohn Baldwin.It Fl a 93017c907ddSJohn BaldwinTerminate all associations. 93117c907ddSJohn Baldwin.It Fl c 93217c907ddSJohn BaldwinSpecify controller ID. 93317c907ddSJohn Baldwin.It Fl h 93417c907ddSJohn BaldwinSpecify host name. 93517c907ddSJohn Baldwin.El 936130f4520SKenneth D. Merry.It Ic help 937130f4520SKenneth D. MerryDisplay 938130f4520SKenneth D. Merry.Nm 939130f4520SKenneth D. Merryusage information. 940130f4520SKenneth D. Merry.El 941ca7a5557SAlexander Motin.Sh OPTIONS 942ca7a5557SAlexander MotinNumber of additional configuration options may be specified for LUNs. 943ca7a5557SAlexander MotinSome options are global, others are backend-specific. 944ca7a5557SAlexander Motin.Pp 945ca7a5557SAlexander MotinGlobal options: 946a7f17b07SJoel Dahl.Bl -tag -width 12n 947ca7a5557SAlexander Motin.It Va vendor 948ca7a5557SAlexander MotinSpecifies LUN vendor string up to 8 chars. 949ca7a5557SAlexander Motin.It Va product 950ca7a5557SAlexander MotinSpecifies LUN product string up to 16 chars. 951ca7a5557SAlexander Motin.It Va revision 952ca7a5557SAlexander MotinSpecifies LUN revision string up to 4 chars. 953027e5269SAlexander Motin.It Va scsiname 954027e5269SAlexander MotinSpecifies LUN SCSI name string. 955409a3c13SAlexander Motin.It Va eui 95677381bd8SSergey KandaurovSpecifies LUN EUI-64 identifier. 957409a3c13SAlexander Motin.It Va naa 958409a3c13SAlexander MotinSpecifies LUN NAA identifier. 959f383d6efSAlexander Motin.It Va uuid 960f383d6efSAlexander MotinSpecifies LUN locally assigned RFC 4122 UUID identifier. 961f383d6efSAlexander MotinEUI, NAA or UUID identifier should be set to UNIQUE value to allow 962984a2ea9SAlexander MotinEXTENDED COPY command access the LUN. 963984a2ea9SAlexander MotinNon-unique LUN identifiers may lead to data corruption. 964f383d6efSAlexander MotinSome initiators may not support later introduced UUID identifiers. 9658bdf81e4SAlexander Motin.It Va ident_info 9668bdf81e4SAlexander MotinSpecified LUN identification information (string or 0x + hex). 9678bdf81e4SAlexander Motin.It Va text_ident_info 9688bdf81e4SAlexander MotinSpecified LUN text identification information (UTF-8 string). 969d36c6176SAlexander Motin.It Va ha_role 970d36c6176SAlexander MotinSetting to "primary" or "secondary" overrides default role of the node 971d36c6176SAlexander Motinin HA cluster, set by kern.cam.ctl.ha_role sysctl. 972984a2ea9SAlexander Motin.It Va insecure_tpc 973984a2ea9SAlexander MotinSetting to "on" allows EXTENDED COPY command sent to this LUN access 974984a2ea9SAlexander Motinother LUNs on this host, not accessible otherwise. 975984a2ea9SAlexander MotinThis allows to offload copying between different iSCSI targets residing 976984a2ea9SAlexander Motinon the same host in trusted environments. 9778e6441d8SAlexander Motin.It Va readcache 9788e6441d8SAlexander MotinSet to "off", disables read caching for the LUN, if supported by the backend. 9795396f4d2SAlexander Motin.It Va readonly 9805396f4d2SAlexander MotinSet to "on", blocks all media write operations to the LUN, reporting it 9815396f4d2SAlexander Motinas write protected. 98291be33dcSAlexander Motin.It Va removable 98391be33dcSAlexander MotinSet to "on", makes LUN removable. 984ab55ae25SAlexander Motin.It Va reordering 985ab55ae25SAlexander MotinSet to "unrestricted", allows target to process commands with SIMPLE task 9866d6d6c36SGordon Berglingattribute in arbitrary order. 9876d6d6c36SGordon BerglingAny data integrity exposures related to command sequence order shall be 9886d6d6c36SGordon Berglingexplicitly handled by the application client through the selection of 9896d6d6c36SGordon Berglingappropriate commands and task attributes. 9906d6d6c36SGordon BerglingThe default value is "restricted". 9916d6d6c36SGordon BerglingIt improves data integrity, but may introduce some additional delays. 992bfbfc4a3SAlexander Motin.It Va serseq 993ac503c19SAlexander MotinSet to "on" to fully serialize consecutive reads/writes. 994ac503c19SAlexander MotinSet to "read" to fully serialize consecutive reads. 995ac503c19SAlexander MotinSet to "soft" to slightly serialize consecutive reads. 996bfbfc4a3SAlexander MotinSet to "off" to allow them be issued in parallel. 997bfbfc4a3SAlexander MotinParallel issue of consecutive operations may confuse logic of the 998bfbfc4a3SAlexander Motinbacking file system, hurting performance; but it may improve performance 999bfbfc4a3SAlexander Motinof backing stores without prefetch/write-back. 10001ce31703SAlexander Motin.It Va pblocksize 10011ce31703SAlexander Motin.It Va pblockoffset 100234961f40SAlexander MotinSpecify physical block size and offset of the device. 10031ce31703SAlexander Motin.It Va ublocksize 10041ce31703SAlexander Motin.It Va ublockoffset 100534961f40SAlexander MotinSpecify UNMAP block size and offset of the device. 100634961f40SAlexander Motin.It Va rpm 10076f67ce91SAlexander MotinSpecifies medium rotation rate of the device: 0 -- not reported, 10086f67ce91SAlexander Motin1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. 10096f67ce91SAlexander Motin.It Va formfactor 10106f67ce91SAlexander MotinSpecifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", 10116f67ce91SAlexander Motin2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". 1012ae8828baSAlexander Motin.It Va temperature 1013ae8828baSAlexander Motin.It Va reftemperature 1014ae8828baSAlexander MotinSpecify current and reference (maximum) temperatures of the device. 10154928a0c2SAlexander Motin.It Va provisioning_type 10164928a0c2SAlexander MotinWhen UNMAP support is enabled, this option specifies provisioning type: 10174928a0c2SAlexander Motin"resource", "thin" or "unknown". 10184928a0c2SAlexander MotinDefault value is "thin". 10194928a0c2SAlexander MotinLogical units without UNMAP support are reported as fully provisioned. 1020ca7a5557SAlexander Motin.It Va unmap 10214928a0c2SAlexander MotinSetting to "on" or "off" controls UNMAP support for the logical unit. 10224928a0c2SAlexander MotinDefault value is "on" if supported by the backend. 102315fd2e24SAlexander Motin.It Va unmap_max_lba 102415fd2e24SAlexander Motin.It Va unmap_max_descr 102515fd2e24SAlexander MotinSpecify maximum allowed number of LBAs and block descriptors per UNMAP 102615fd2e24SAlexander Motincommand to report in Block Limits VPD page. 102715fd2e24SAlexander Motin.It Va write_same_max_lba 102815fd2e24SAlexander MotinSpecify maximum allowed number of LBAs per WRITE SAME command to report 102915fd2e24SAlexander Motinin Block Limits VPD page. 1030c3e7ba3eSAlexander Motin.It Va avail-threshold 1031c3e7ba3eSAlexander Motin.It Va used-threshold 1032c3e7ba3eSAlexander Motin.It Va pool-avail-threshold 1033c3e7ba3eSAlexander Motin.It Va pool-used-threshold 1034001de973SAlexander MotinSet per-LUN/-pool thin provisioning soft thresholds. 1035c3e7ba3eSAlexander MotinLUN will establish UNIT ATTENTION condition if its or pool available space 1036c3e7ba3eSAlexander Motinget below configured avail values, or its or pool used space get above 1037c3e7ba3eSAlexander Motinconfigured used values. 1038001de973SAlexander MotinPool thresholds are working only for ZVOL-backed LUNs. 10398e6441d8SAlexander Motin.It Va writecache 10408e6441d8SAlexander MotinSet to "off", disables write caching for the LUN, if supported by the backend. 1041ca7a5557SAlexander Motin.El 1042ca7a5557SAlexander Motin.Pp 1043ca7a5557SAlexander MotinOptions specific for block backend: 1044a7f17b07SJoel Dahl.Bl -tag -width 12n 1045ca7a5557SAlexander Motin.It Va file 1046ca7a5557SAlexander MotinSpecifies file or device name to use for backing store. 1047ca7a5557SAlexander Motin.It Va num_threads 1048ca7a5557SAlexander MotinSpecifies number of backend threads to use for this LUN. 1049ca7a5557SAlexander Motin.El 1050e7037673SAlexander Motin.Pp 1051e7037673SAlexander MotinOptions specific for ramdisk backend: 1052e7037673SAlexander Motin.Bl -tag -width 12n 1053e7037673SAlexander Motin.It Va capacity 1054e7037673SAlexander MotinSpecifies capacity of backing store (maximum RAM for data). 1055e7037673SAlexander MotinThe default value is zero, that disables backing store completely, 1056e7037673SAlexander Motinmaking all writes go to nowhere, while all reads return zeroes. 1057e7037673SAlexander Motin.El 1058130f4520SKenneth D. Merry.Sh EXAMPLES 1059130f4520SKenneth D. Merry.Pp 1060130f4520SKenneth D. MerrySend a 1061130f4520SKenneth D. Merry.Tn SCSI 1062130f4520SKenneth D. MerryTEST UNIT READY command to LUN 1. 1063130f4520SKenneth D. Merry.Pp 10648951f055SMarcelo Araujo.Dl ctladm tur 1 1065130f4520SKenneth D. Merry.Pp 1066130f4520SKenneth D. MerryDisplay the list of mode pages supported by LUN 1. 1067130f4520SKenneth D. Merry.Pp 10688951f055SMarcelo Araujo.Dl ctladm modesense 1 -l 1069130f4520SKenneth D. Merry.Pp 1070130f4520SKenneth D. MerryDisplay the saved version of the Control mode page (page 10) on LUN 0. 1071130f4520SKenneth D. MerryDisable fetching block descriptors, and use a 10 byte MODE SENSE command 1072130f4520SKenneth D. Merryinstead of the default 6 byte command. 10738951f055SMarcelo Araujo.Pp 10748951f055SMarcelo Araujo.Dl ctladm modesense 0 -m 10 -P 3 -d -c 10 1075130f4520SKenneth D. Merry.Pp 1076130f4520SKenneth D. MerryRead the first 512 byte block from LUN 2 and dump it to the file 1077130f4520SKenneth D. Merry.Bd -literal 10788951f055SMarcelo Araujo.Dl ctladm read 2 -l 0 -d 1 -b 512 -f - > foo 1079130f4520SKenneth D. Merry.Ed 1080130f4520SKenneth D. Merry.Pp 1081130f4520SKenneth D. MerryRead 10240 bytes from the file 1082130f4520SKenneth D. Merry.Pa /tmp/bar 1083fb606ebaSAlexander Motinand write it to LUN 3. 1084130f4520SKenneth D. Merrystarting at LBA 0xff432140. 1085130f4520SKenneth D. Merry.Pp 10868951f055SMarcelo Araujo.Bd -literal 10878951f055SMarcelo Araujo.Dl ctladm write 3 -l 0xff432140 -d 20 -b 512 -f /tmp/bar 10888951f055SMarcelo Araujo.Ed 1089130f4520SKenneth D. Merry.Pp 1090130f4520SKenneth D. MerryCreate a LUN with the 1091130f4520SKenneth D. Merry.Dq fake 1092130f4520SKenneth D. Merryramdisk as a backing store. 1093e7037673SAlexander MotinThe LUN will claim to have a size of approximately 10 terabytes, 1094e7037673SAlexander Motinwhile having no real data store (all written data are lost). 1095e7037673SAlexander Motin.Pp 10968951f055SMarcelo Araujo.Dl ctladm create -b ramdisk -s 10485760000000000 1097e7037673SAlexander Motin.Pp 1098e7037673SAlexander MotinCreate a thin provisioned LUN with a ramdisk as a backing store. 1099e7037673SAlexander MotinThe LUN will have maximal backing store capacity of 10 gigabytes, 1100e7037673SAlexander Motinwhile reporting size of 10 terabytes, 1101130f4520SKenneth D. Merry.Pp 11028951f055SMarcelo Araujo.Dl ctladm create -b ramdisk -s 10T -o capacity=10G 1103130f4520SKenneth D. Merry.Pp 110464cecc7aSEdward Tomasz NapieralaCreate a LUN using the block backend, specify the ZFS volume 110564cecc7aSEdward Tomasz Napierala.Pa tank/example 1106130f4520SKenneth D. Merryas the backing store, and specify the 1107130f4520SKenneth D. Merry.Tn SCSI 1108344c81a1SWarren BlockVPD page 0x80 and 0x83 serial number 1109344c81a1SWarren Block.Fl ( S ) 1110344c81a1SWarren Blockand device ID 1111344c81a1SWarren Block.Fl ( d ) . 111264cecc7aSEdward Tomasz NapieralaThe size of the LUN will be derived from the size of the ZVOL. 1113130f4520SKenneth D. Merry.Pp 111464cecc7aSEdward Tomasz Napierala.Dl ctladm create -b block -o file=/dev/zvol/tank/example -S MYSERIAL321 -d MYDEVID123 11158951f055SMarcelo Araujo.Pp 11168951f055SMarcelo AraujoUse to specify generic options on ioctl frontend port, now it is 11178951f055SMarcelo Araujoonly possible to set pp and/or vp port number. 11188951f055SMarcelo Araujo.Pp 11198951f055SMarcelo Araujo.Dl ctladm port -c -O pp=11 -O vp=12 11208951f055SMarcelo Araujo.Pp 11218951f055SMarcelo AraujoRemove specified targ_port. 11228951f055SMarcelo Araujo.Pp 11238951f055SMarcelo Araujo.Dl ctladm port -r -p 4 11248951f055SMarcelo Araujo.Pp 1125130f4520SKenneth D. Merry.Pp 1126130f4520SKenneth D. MerryRemove LUN 12, which is handled by the block backend, from the system. 1127130f4520SKenneth D. Merry.Pp 11288951f055SMarcelo Araujo.Dl ctladm remove -b block -l 12 1129130f4520SKenneth D. Merry.Pp 1130130f4520SKenneth D. MerryList configured LUNs in the system, along with their backend and serial 1131130f4520SKenneth D. Merrynumber. 1132130f4520SKenneth D. MerryThis works when the Front End Target Drivers are enabled or disabled. 1133130f4520SKenneth D. Merry.Pp 11348951f055SMarcelo Araujo.Dl ctladm devlist 1135130f4520SKenneth D. Merry.Pp 1136130f4520SKenneth D. MerryList all LUNs in the system, along with their inquiry data and device type. 1137130f4520SKenneth D. MerryThis only works when the FETDs are enabled, since the commands go through the 1138130f4520SKenneth D. Merryioctl port. 1139130f4520SKenneth D. Merry.Pp 11408951f055SMarcelo Araujo.Dl ctladm lunlist 1141130f4520SKenneth D. Merry.Pp 1142130f4520SKenneth D. MerryInject a medium error on LUN 6 for every read that covers the first 512 1143130f4520SKenneth D. Merryblocks of the LUN. 11448951f055SMarcelo Araujo.Pp 11458951f055SMarcelo Araujo.Dl ctladm inject 6 -i mediumerr -p read -r 0,512 -c 1146130f4520SKenneth D. Merry.Pp 1147130f4520SKenneth D. MerryInject a custom error on LUN 6 for the next TEST UNIT READY command only. 1148130f4520SKenneth D. MerryThis will result in a sense key of NOT READY (0x02), and an ASC/ASCQ of 1149130f4520SKenneth D. Merry0x04,0x02 ("Logical unit not ready, initializing command required"). 11508951f055SMarcelo Araujo.Pp 11518951f055SMarcelo Araujo.Bd -literal -offset indent 11528951f055SMarcelo Araujoctladm inject 6 -i custom -p tur -s 18 "f0 0 02 s12 04 02" 11538951f055SMarcelo Araujo.Ed 1154130f4520SKenneth D. Merry.Sh SEE ALSO 1155130f4520SKenneth D. Merry.Xr cam 3 , 1156130f4520SKenneth D. Merry.Xr cam_cdbparse 3 , 1157130f4520SKenneth D. Merry.Xr cam 4 , 115832562145SEdward Tomasz Napierala.Xr ctl 4 , 1159130f4520SKenneth D. Merry.Xr xpt 4 , 1160009ea47eSEdward Tomasz Napierala.Xr camcontrol 8 , 1161b853c718SEdward Tomasz Napierala.Xr ctld 8 , 1162b853c718SEdward Tomasz Napierala.Xr ctlstat 8 1163130f4520SKenneth D. Merry.Sh HISTORY 1164130f4520SKenneth D. MerryThe 1165130f4520SKenneth D. Merry.Nm 1166130f4520SKenneth D. Merryutility was originally written during the Winter/Spring of 2003 as an 1167130f4520SKenneth D. Merryinterface to CTL. 1168130f4520SKenneth D. Merry.Sh AUTHORS 116901c2b8acSBaptiste Daroussin.An Ken Merry Aq Mt ken@FreeBSD.org 1170