ctladm.8 (440cec3faf778469b36b998bb52aab7fbc43eae3) | ctladm.8 (6d6d6c360322227ba838c53ed72d31937a425800) |
---|---|
1.\" 2.\" Copyright (c) 2003 Silicon Graphics International Corp. 3.\" Copyright (c) 2015-2020 Alexander Motin <mav@FreeBSD.org> 4.\" Copyright (c) 2018 Marcelo Araujo <araujo@FreeBSD.org> 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 219 unchanged lines hidden (view full) --- 228.El 229Many of the primary functions of the 230.Nm 231utility take the following optional arguments: 232.Bl -tag -width 10n 233.It Fl C Ar retries 234Specify the number of times to retry a command in the event of failure. 235.It Fl D Ar device | 1.\" 2.\" Copyright (c) 2003 Silicon Graphics International Corp. 3.\" Copyright (c) 2015-2020 Alexander Motin <mav@FreeBSD.org> 4.\" Copyright (c) 2018 Marcelo Araujo <araujo@FreeBSD.org> 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 219 unchanged lines hidden (view full) --- 228.El 229Many of the primary functions of the 230.Nm 231utility take the following optional arguments: 232.Bl -tag -width 10n 233.It Fl C Ar retries 234Specify the number of times to retry a command in the event of failure. 235.It Fl D Ar device |
236Specify the device to open. This allows opening a device other than the 237default device, | 236Specify the device to open. 237This allows opening a device other than the default device, |
238.Pa /dev/cam/ctl , 239to be opened for sending commands. 240.It Fl I Ar id 241Specify the initiator number to use. 242By default, 243.Nm 244will use 7 as the initiator number. 245.El --- 21 unchanged lines hidden (view full) --- 267REPORT LUNS command to the device and display supported LUNs. 268.It Ic read 269Send a 270.Tn SCSI 271READ command to the device, and write the requested data to a file or 272stdout. 273.Bl -tag -width 12n 274.It Fl l Ar lba | 238.Pa /dev/cam/ctl , 239to be opened for sending commands. 240.It Fl I Ar id 241Specify the initiator number to use. 242By default, 243.Nm 244will use 7 as the initiator number. 245.El --- 21 unchanged lines hidden (view full) --- 267REPORT LUNS command to the device and display supported LUNs. 268.It Ic read 269Send a 270.Tn SCSI 271READ command to the device, and write the requested data to a file or 272stdout. 273.Bl -tag -width 12n 274.It Fl l Ar lba |
275Specify the starting Logical Block Address for the READ. This can be 276specified in decimal, octal (starting with 0), hexadecimal (starting with 2770x) or any other base supported by | 275Specify the starting Logical Block Address for the READ. 276This can be specified in decimal, octal (starting with 0), 277hexadecimal (starting with 0x) or any other base supported by |
278.Xr strtoull 3 . 279.It Fl d Ar datalen 280Specify the length, in 512 byte blocks, of the READ request. 281.It Fl f Ar file | 278.Xr strtoull 3 . 279.It Fl d Ar datalen 280Specify the length, in 512 byte blocks, of the READ request. 281.It Fl f Ar file |
282Specify the destination for the data read by the READ command. Either a 283filename or | 282Specify the destination for the data read by the READ command. 283Either a filename or |
284.Sq - 285for stdout may be specified. 286.It Fl c Ar cdbsize 287Specify the minimum 288.Tn SCSI | 284.Sq - 285for stdout may be specified. 286.It Fl c Ar cdbsize 287Specify the minimum 288.Tn SCSI |
289CDB (Command Data Block) size to be used for the READ request. Allowable 290values are 6, 10, 12 and 16. Depending upon the LBA and amount of data 291requested, a larger CDB size may be used to satisfy the request. (e.g., 292for LBAs above 0xffffffff, READ(16) must be used to satisfy the request.) | 289CDB (Command Data Block) size to be used for the READ request. 290Allowable values are 6, 10, 12 and 16. 291Depending upon the LBA and amount of data requested, a larger CDB 292size may be used to satisfy the request. (e.g., for LBAs above 0xffffffff, 293READ(16) must be used to satisfy the request.) |
293.It Fl b Ar blocksize 294Specify the blocksize of the underlying 295.Tn SCSI 296device, so the transfer length | 294.It Fl b Ar blocksize 295Specify the blocksize of the underlying 296.Tn SCSI 297device, so the transfer length |
297can be calculated accurately. The blocksize can be obtained via the | 298can be calculated accurately. 299The blocksize can be obtained via the |
298.Tn SCSI 299READ CAPACITY command. 300.It Fl N 301Do not copy data to 302.Nm 303from the kernel when doing a read, just execute the command without copying 304data. 305This is to be used for performance testing. 306.El 307.It Ic write 308Read data from a file or stdin, and write the data to the device using the 309.Tn SCSI 310WRITE command. 311.Bl -tag -width 12n 312.It Fl l Ar lba | 300.Tn SCSI 301READ CAPACITY command. 302.It Fl N 303Do not copy data to 304.Nm 305from the kernel when doing a read, just execute the command without copying 306data. 307This is to be used for performance testing. 308.El 309.It Ic write 310Read data from a file or stdin, and write the data to the device using the 311.Tn SCSI 312WRITE command. 313.Bl -tag -width 12n 314.It Fl l Ar lba |
313Specify the starting Logical Block Address for the WRITE. This can be 314specified in decimal, octal (starting with 0), hexadecimal (starting with 3150x) or any other base supported by | 315Specify the starting Logical Block Address for the WRITE. 316This can be specified in decimal, octal (starting with 0), hexadecimal 317(starting with 0x) or any other base supported by |
316.Xr strtoull 3 . 317.It Fl d Ar atalen 318Specify the length, in 512 byte blocks, of the WRITE request. 319.It Fl f Ar file | 318.Xr strtoull 3 . 319.It Fl d Ar atalen 320Specify the length, in 512 byte blocks, of the WRITE request. 321.It Fl f Ar file |
320Specify the source for the data to be written by the WRITE command. Either a 321filename or | 322Specify the source for the data to be written by the WRITE command. 323Either a filename or |
322.Sq - 323for stdin may be specified. 324.It Fl c Ar cdbsize 325Specify the minimum 326.Tn SCSI | 324.Sq - 325for stdin may be specified. 326.It Fl c Ar cdbsize 327Specify the minimum 328.Tn SCSI |
327CDB (Command Data Block) size to be used for the READ request. Allowable 328values are 6, 10, 12 and 16. Depending upon the LBA and amount of data 329requested, a larger CDB size may be used to satisfy the request. (e.g., 330for LBAs above 0xffffffff, READ(16) must be used to satisfy the request.) | 329CDB (Command Data Block) size to be used for the READ request. 330Allowable values are 6, 10, 12 and 16. 331Depending upon the LBA and amount of data requested, a larger CDB size 332may be used to satisfy the request. (e.g., for LBAs above 0xffffffff, READ(16) 333must be used to satisfy the request.) |
331.It Fl b Ar blocksize 332Specify the blocksize of the underlying 333.Tn SCSI 334device, so the transfer length | 334.It Fl b Ar blocksize 335Specify the blocksize of the underlying 336.Tn SCSI 337device, so the transfer length |
335can be calculated accurately. The blocksize can be obtained via the | 338can be calculated accurately. 339The blocksize can be obtained via the |
336.Tn SCSI 337READ CAPACITY command. 338.It Fl N 339Do not copy data to 340.Nm 341to the kernel when doing a write, just execute the command without copying 342data. 343This is to be used for performance testing. 344.El 345.It Ic readcap 346Send the 347.Tn SCSI 348READ CAPACITY command to the device and display the device size and device | 340.Tn SCSI 341READ CAPACITY command. 342.It Fl N 343Do not copy data to 344.Nm 345to the kernel when doing a write, just execute the command without copying 346data. 347This is to be used for performance testing. 348.El 349.It Ic readcap 350Send the 351.Tn SCSI 352READ CAPACITY command to the device and display the device size and device |
349block size. By default, READ CAPACITY(10) is 350used. If the device returns a maximum LBA of 0xffffffff, however, | 353block size. 354By default, READ CAPACITY(10) is used. 355If the device returns a maximum LBA of 0xffffffff, however, |
351.Nm 352will automatically issue a READ CAPACITY(16), which is implemented as a | 356.Nm 357will automatically issue a READ CAPACITY(16), which is implemented as a |
353service action of the SERVICE ACTION IN(16) opcode. The user can specify 354the minimum CDB size with the | 358service action of the SERVICE ACTION IN(16) opcode. 359The user can specify the minimum CDB size with the |
355.Fl c | 360.Fl c |
356argument. Valid values for the | 361argument. 362Valid values for the |
357.Fl c | 363.Fl c |
358option are 10 and 16. If a 10 byte CDB is specified, the request will be 359automatically reissued with a 16 byte CDB if the maximum LBA returned is 3600xffffffff. | 364option are 10 and 16. 365If a 10 byte CDB is specified, the request will be automatically reissued 366with a 16 byte CDB if the maximum LBA returned is 0xffffffff. |
361.It Ic modesense 362Send a 363.Tn SCSI 364MODE SENSE command to the device, and display the requested mode page(s) or 365page list. 366.Bl -tag -width 10n 367.It Fl m Ar page | 367.It Ic modesense 368Send a 369.Tn SCSI 370MODE SENSE command to the device, and display the requested mode page(s) or 371page list. 372.Bl -tag -width 10n 373.It Fl m Ar page |
368Specify the mode page to display. This option and the | 374Specify the mode page to display. 375This option and the |
369.Fl l | 376.Fl l |
370option are mutually exclusive. One of the two must be specified, though. | 377option are mutually exclusive. 378One of the two must be specified, though. |
371Mode page numbers may be specified in decimal or hexadecimal. 372.It Fl l 373Request that the list of mode pages supported by the device be returned. 374This option and the 375.Fl m | 379Mode page numbers may be specified in decimal or hexadecimal. 380.It Fl l 381Request that the list of mode pages supported by the device be returned. 382This option and the 383.Fl m |
376option are mutually exclusive. One of the two must be specified, though. | 384option are mutually exclusive. 385One of the two must be specified, though. |
377.It Fl P Ar pc | 386.It Fl P Ar pc |
378Specify the mode page control value. Possible values are: | 387Specify the mode page control value. 388Possible values are: |
379.Bl -tag -width 2n -compact 380.It 0 381Current values. 382.It 1 383Changeable value bitmask. 384.It 2 385Default values. 386.It 3 387Saved values. 388.El 389.It Fl d 390Disable block descriptors when sending the mode sense request. 391.It Fl S Ar subpage 392Specify the subpage used with the mode sense request. 393.It Fl c Ar cdbsize | 389.Bl -tag -width 2n -compact 390.It 0 391Current values. 392.It 1 393Changeable value bitmask. 394.It 2 395Default values. 396.It 3 397Saved values. 398.El 399.It Fl d 400Disable block descriptors when sending the mode sense request. 401.It Fl S Ar subpage 402Specify the subpage used with the mode sense request. 403.It Fl c Ar cdbsize |
394Specify the CDB size used for the mode sense request. Supported values are 3956 and 10. | 404Specify the CDB size used for the mode sense request. 405Supported values are 6 and 10. |
396.El 397.It Ic start 398Send the 399.Tn SCSI 400START STOP UNIT command to the specified LUN with the start 401bit set. 402.Bl -tag -width 4n 403.It Fl i | 406.El 407.It Ic start 408Send the 409.Tn SCSI 410START STOP UNIT command to the specified LUN with the start 411bit set. 412.Bl -tag -width 4n 413.It Fl i |
404Set the immediate bit in the CDB. Note that CTL does not support the 405immediate bit, so this is primarily useful for making sure that CTL returns 406the proper error. | 414Set the immediate bit in the CDB. 415Note that CTL does not support the immediate bit, so this is primarily 416useful for making sure that CTL returns the proper error. |
407.El 408.It Ic stop 409Send the 410.Tn SCSI 411START STOP UNIT command to the specified LUN with the start | 417.El 418.It Ic stop 419Send the 420.Tn SCSI 421START STOP UNIT command to the specified LUN with the start |
412bit cleared. We use an ordered tag to stop the LUN, so we can guarantee 413that all pending I/O executes before it is stopped. (CTL guarantees this 414anyway, but | 422bit cleared. 423We use an ordered tag to stop the LUN, so we can guarantee that all pending 424I/O executes before it is stopped. 425(CTL guarantees this anyway, but |
415.Nm 416sends an ordered tag for completeness.) 417.Bl -tag -width 4n 418.It Fl i | 426.Nm 427sends an ordered tag for completeness.) 428.Bl -tag -width 4n 429.It Fl i |
419Set the immediate bit in the CDB. Note that CTL does not support the 420immediate bit, so this is primarily useful for making sure that CTL returns 421the proper error. | 430Set the immediate bit in the CDB. 431Note that CTL does not support the immediate bit, so this is primarily 432useful for making sure that CTL returns the proper error. |
422.El 423.It Ic synccache 424Send the 425.Tn SCSI | 433.El 434.It Ic synccache 435Send the 436.Tn SCSI |
426SYNCHRONIZE CACHE command to the device. By default, SYNCHRONIZE 427CACHE(10) is used. If the specified starting LBA is greater than 4280xffffffff or the length is greater than 0xffff, though, 429SYNCHRONIZE CACHE(16) will be used. The 16 byte command will also be used 430if the user specifies a 16 byte CDB with the | 437SYNCHRONIZE CACHE command to the device. 438By default, SYNCHRONIZE CACHE(10) is used. 439If the specified starting LBA is greater than 0xffffffff or the length is 440greater than 0xffff, though, SYNCHRONIZE CACHE(16) will be used. 441The 16 byte command will also be used if the user specifies a 16 byte CDB with the |
431.Fl c 432argument. 433.Bl -tag -width 14n 434.It Fl l Ar lba | 442.Fl c 443argument. 444.Bl -tag -width 14n 445.It Fl l Ar lba |
435Specify the starting LBA of the cache region to synchronize. This option is a 436no-op for CTL. If you send a SYNCHRONIZE CACHE command, it will sync the 437cache for the entire LUN. | 446Specify the starting LBA of the cache region to synchronize. 447This option is a no-op for CTL. 448If you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. |
438.It Fl b Ar blockcount | 449.It Fl b Ar blockcount |
439Specify the length of the cache region to synchronize. This option is a 440no-op for CTL. If you send a SYNCHRONIZE CACHE command, it will sync the 441cache for the entire LUN. | 450Specify the length of the cache region to synchronize. 451This option is a no-op for CTL. 452If you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. |
442.It Fl r | 453.It Fl r |
443Specify relative addressing for the starting LBA. CTL does not support 444relative addressing, since it only works for linked commands, and CTL 445does not support linked commands. | 454Specify relative addressing for the starting LBA. 455CTL does not support relative addressing, since it only works for linked commands, 456and CTL does not support linked commands. |
446.It Fl i 447Tell the target to return status immediately after issuing the SYNCHRONIZE CACHE | 457.It Fl i 458Tell the target to return status immediately after issuing the SYNCHRONIZE CACHE |
448command rather than waiting for the cache to finish syncing. CTL does not 449support this bit. | 459command rather than waiting for the cache to finish syncing. 460CTL does not support this bit. |
450.It Fl c Ar cdbsize | 461.It Fl c Ar cdbsize |
451Specify the minimum CDB size. Valid values are 10 and 16 bytes. | 462Specify the minimum CDB size. 463Valid values are 10 and 16 bytes. |
452.El 453.It Ic lunlist 454List all LUNs registered with CTL. 455Because this command uses the ioctl port, it will only work when the FETDs 456(Front End Target Drivers) are enabled. 457This command is the equivalent of doing a REPORT LUNS on one LUN and then 458an INQUIRY on each LUN in the system. 459.It Ic delay | 464.El 465.It Ic lunlist 466List all LUNs registered with CTL. 467Because this command uses the ioctl port, it will only work when the FETDs 468(Front End Target Drivers) are enabled. 469This command is the equivalent of doing a REPORT LUNS on one LUN and then 470an INQUIRY on each LUN in the system. 471.It Ic delay |
460Delay commands at the given location. There are two places where commands 461may be delayed currently: before data is transferred | 472Delay commands at the given location. 473There are two places where commands may be delayed currently: before data is transferred |
462.Pq Dq datamove 463and just prior to sending status to the host 464.Pq Dq done . 465One of the two must be supplied as an argument to the 466.Fl l | 474.Pq Dq datamove 475and just prior to sending status to the host 476.Pq Dq done . 477One of the two must be supplied as an argument to the 478.Fl l |
467option. The | 479option. 480The |
468.Fl t 469option must also be specified. 470.Bl -tag -width 12n 471.It Fl l Ar delayloc 472Delay command(s) at the specified location. 473This can either be at the data movement stage (datamove) or prior to 474command completion (done). 475.It Fl t Ar delaytime | 481.Fl t 482option must also be specified. 483.Bl -tag -width 12n 484.It Fl l Ar delayloc 485Delay command(s) at the specified location. 486This can either be at the data movement stage (datamove) or prior to 487command completion (done). 488.It Fl t Ar delaytime |
476Delay command(s) for the specified number of seconds. This must be 477specified. If set to 0, it will clear out any previously set delay for 478this particular location (datamove or done). | 489Delay command(s) for the specified number of seconds. 490This must be specified. 491If set to 0, it will clear out any previously set delay for this particular 492location (datamove or done). |
479.It Fl T Ar delaytype 480Specify the delay type. 481By default, the 482.Ic delay 483option will delay the next command sent to the given LUN. 484With the 485.Fl T Ar cont 486option, every command will be delayed by the specified period of time. --- 406 unchanged lines hidden (view full) --- 893Set to "off", disables read caching for the LUN, if supported by the backend. 894.It Va readonly 895Set to "on", blocks all media write operations to the LUN, reporting it 896as write protected. 897.It Va removable 898Set to "on", makes LUN removable. 899.It Va reordering 900Set to "unrestricted", allows target to process commands with SIMPLE task | 493.It Fl T Ar delaytype 494Specify the delay type. 495By default, the 496.Ic delay 497option will delay the next command sent to the given LUN. 498With the 499.Fl T Ar cont 500option, every command will be delayed by the specified period of time. --- 406 unchanged lines hidden (view full) --- 907Set to "off", disables read caching for the LUN, if supported by the backend. 908.It Va readonly 909Set to "on", blocks all media write operations to the LUN, reporting it 910as write protected. 911.It Va removable 912Set to "on", makes LUN removable. 913.It Va reordering 914Set to "unrestricted", allows target to process commands with SIMPLE task |
901attribute in arbitrary order. Any data integrity exposures related to 902command sequence order shall be explicitly handled by the application 903client through the selection of appropriate commands and task attributes. 904The default value is "restricted". It improves data integrity, but may 905introduce some additional delays. | 915attribute in arbitrary order. 916Any data integrity exposures related to command sequence order shall be 917explicitly handled by the application client through the selection of 918appropriate commands and task attributes. 919The default value is "restricted". 920It improves data integrity, but may introduce some additional delays. |
906.It Va serseq 907Set to "on" to serialize consecutive reads/writes. 908Set to "read" to serialize consecutive reads. 909Set to "off" to allow them be issued in parallel. 910Parallel issue of consecutive operations may confuse logic of the 911backing file system, hurting performance; but it may improve performance 912of backing stores without prefetch/write-back. 913.It Va pblocksize --- 175 unchanged lines hidden --- | 921.It Va serseq 922Set to "on" to serialize consecutive reads/writes. 923Set to "read" to serialize consecutive reads. 924Set to "off" to allow them be issued in parallel. 925Parallel issue of consecutive operations may confuse logic of the 926backing file system, hurting performance; but it may improve performance 927of backing stores without prefetch/write-back. 928.It Va pblocksize --- 175 unchanged lines hidden --- |