2 .\" Copyright (c) 1998, 1999, 2000, 2002, 2005, 2006, 2007 Kenneth D. Merry.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. The name of the author may not be used to endorse or promote products
14 .\" derived from this software without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd CAM control program
50 .Op Fl u Ar unit_number
73 .Op Fl r Ar reporttype
102 .Aq all | bus Ns Op :target:lun
105 .Aq all | bus Ns Op :target:lun
121 .Aq Fl m Ar page | Fl l
129 .Aq Fl a Ar cmd Op args
130 .Aq Fl c Ar cmd Op args
133 .Op Fl i Ar len Ar fmt
135 .Op Fl o Ar len Ar fmt Op args
142 .Aq Fl r Ar len Ar fmt Op args
143 .Aq Fl R Ar len Ar fmt Op args
155 .Op Fl o Ar operation
159 .Op Fl T Ar pp_timeout
160 .Op Fl a Ar enable|disable
161 .Op Fl A Ar enable|disable
162 .Op Fl s Ar enable|disable
163 .Op Fl S Ar enable|disable
184 .Aq all|off|bus Ns Op :target Ns Op :lun
197 .Op Fl D Ar enable|disable
202 .Op Fl T Ar enable|disable
204 .Op Fl W Ar bus_width
218 .Aq Fl a Ar overwrite | block | crypto | exitfailure
268 .Op Fl l Ar high|maximum
272 .Op Fl U Ar user|master
283 .Op Fl s Ar max_sectors
290 .Aq Fl i Ar action | Fl o Ar action
296 .Op Fl R Ar rel_tgt_port
305 .Aq Fl r Ar action | Fl w Ar attrib
308 .Op Fl e Ar elem_addr
309 .Op Fl F Ar form1,form2
311 .Op Fl s Ar start_addr
312 .Op Fl T Ar elem_type
319 .Op Fl s Ar service_action
327 utility is designed to provide a way for users to access and control the
334 can cause a loss of data and/or system crashes if used improperly.
336 expert users are encouraged to exercise caution when using this command.
337 Novice users should stay away from this utility.
341 utility has a number of primary functions, many of which support an optional
343 A device identifier can take one of three forms:
346 Specify a device name and unit number combination, like "da5" or "cd3".
348 Specify a bus number and target id.
349 The bus number can be determined from
351 .Dq camcontrol devlist .
352 The lun defaults to 0.
354 Specify the bus, target and lun for a device.
358 The device identifier, if it is specified,
360 come immediately after the function name, and before any generic or
361 function-specific arguments.
366 arguments described below will override any device name or unit number
367 specified beforehand.
374 override a specified bus:target or bus:target:lun, however.
378 primary functions support these generic arguments:
381 SCSI command retry count.
382 In order for this to work, error recovery
386 Instruct the kernel to perform generic SCSI error recovery for the given
388 This is needed in order for the retry count
391 Other than retrying commands, the generic error recovery in
392 the code will generally attempt to spin up drives that are not spinning.
393 It may take some other actions, depending upon the sense code returned from
396 Specify the device type to operate on, e.g.\& "da", "cd".
398 SCSI command timeout in seconds.
399 This overrides the default timeout for
401 .It Fl u Ar unit_number
402 Specify the device unit number, e.g.\& "1", "5".
404 Be verbose, print out sense information for failed SCSI commands.
407 Primary command functions:
408 .Bl -tag -width periphlist
410 List all physical devices (logical units) attached to the CAM subsystem.
411 This also includes a list of peripheral drivers attached to each device.
414 argument, SCSI bus number, adapter name and unit numbers are printed as
416 On the other hand, with the
418 argument, only the bus adapter, and unit information will be printed, and
419 device information will be omitted.
421 List all peripheral drivers attached to a given physical device (logical
424 Send the SCSI test unit ready (0x00) command to the given device.
427 utility will report whether the device is ready or not.
429 Send a SCSI inquiry command (0x12) to a device.
432 will print out the standard inquiry data, device serial number, and
433 transfer rate information.
434 The user can specify that only certain types of
435 inquiry data be printed:
438 Get the standard inquiry data.
440 Print out the serial number.
441 If this flag is the only one specified,
443 will not print out "Serial Number" before the value returned by the drive.
444 This is to aid in script writing.
446 Print out transfer rate information.
449 Send a ATA identify command (0xec) to a device.
451 Send the SCSI REPORT LUNS (0xA0) command to the given device.
454 will print out the list of logical units (LUNs) supported by the target device.
455 There are a couple of options to modify the output:
458 Just print out a count of LUNs, not the actual LUN numbers.
460 Just print out the LUNs, and do not print out the count.
461 .It Fl r Ar reporttype
462 Specify the type of report to request from the target:
463 .Bl -tag -width 012345678
465 Return the default report.
469 Most targets will support this report if they support the REPORT LUNS
472 Return only well known LUNs.
474 Return all available LUNs.
479 will try to print out LUN numbers in a reasonable format.
480 It can understand the peripheral, flat, LUN and extended LUN formats.
482 Send the SCSI READ CAPACITY command to the given device and display
484 If the device is larger than 2TB, the SCSI READ CAPACITY (16) service
485 action will be sent to obtain the full size of the device.
488 will print out the last logical block of the device, and the blocksize of
490 To modify the output format, use the following options:
493 Just print out the blocksize, not the last block or device size.
494 This cannot be used with
499 Print out the device size in human readable (base 2, 1K == 1024) format.
502 and cannot be used with
507 Print out the device size in human readable (base 10, 1K == 1000) format.
509 Print out the number of blocks in the device instead of the last logical
512 Quiet, print out the numbers only (separated by a comma if
518 Print out the last logical block or the size of the device only, and omit
522 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
525 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
528 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
529 start bit set and the load/eject bit set.
531 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
532 start bit cleared and the load/eject bit set.
534 Tell the kernel to scan all busses in the system (with the
536 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
537 (XPT_SCAN_LUN) for new devices or devices that have gone away.
539 may specify a scan of all busses, a single bus, or a lun.
541 on a target is not supported.
543 Tell the kernel to reset all busses in the system (with the
545 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
546 reset for that bus, or to reset the given bus:target:lun
547 (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
548 connecting to that device.
549 Note that this can have a destructive impact
554 READ DEFECT DATA (10) command (0x37) or the
556 READ DEFECT DATA (12) command (0xB7) to the given device, and
557 print out any combination of: the total number of defects, the primary
558 defect list (PLIST), and the grown defect list (GLIST).
561 Specify the requested format of the defect list.
562 The format argument is
564 Most drives support the physical sector format.
566 support the logical block format.
567 Many drives, if they do not support the
568 requested format, return the data in an alternate format, along with sense
569 information indicating that the requested data format is not supported.
573 attempts to detect this, and print out whatever format the drive returns.
574 If the drive uses a non-standard sense code to report that it does not
575 support the requested format,
577 will probably see the error as a failure to complete the request.
579 The format options are:
582 Print out the list as logical blocks.
583 This is limited to 32-bit block sizes, and isn't supported by many modern
586 Print out the list as logical blocks.
587 This option uses a 64-bit block size.
589 Print out the list in bytes from index format.
591 Print out the list in extended bytes from index format.
592 The extended format allows for ranges of blocks to be printed.
594 Print out the list in physical sector format.
595 Most drives support this format.
597 Print out the list in extended physical sector format.
598 The extended format allows for ranges of blocks to be printed.
601 Print out the grown defect list.
602 This is a list of bad blocks that have
603 been remapped since the disk left the factory.
605 Print out the primary defect list.
606 This is the list of defects that were present in the factory.
608 When printing status information with
610 only print the number of defects.
612 Just print the number of defects, not the list of defects.
614 Specify the starting offset into the defect list.
615 This implies using the
617 READ DEFECT DATA (12) command, as the 10 byte version of the command
618 doesn't support the address descriptor index field.
619 Not all drives support the 12 byte command, and some drives that support
620 the 12 byte command don't support the address descriptor index field.
622 Print out defects in hexadecimal (base 16) form instead of base 10 form.
631 will print out the number of defects given in the READ DEFECT DATA header
632 returned from the drive.
633 Some drives will report 0 defects if neither the primary or grown defect
636 Allows the user to display and optionally edit a SCSI mode page.
638 page formats are located in
639 .Pa /usr/share/misc/scsi_modes .
640 This can be overridden by specifying a different file in the
642 environment variable.
645 command takes several arguments:
648 Disable block descriptors for mode sense.
650 Displays mode page data in binary format.
652 This flag allows the user to edit values in the mode page.
654 either edit mode page values with the text editor pointed to by his
656 environment variable, or supply mode page values via standard input, using
659 uses to display mode page values.
660 The editor will be invoked if
662 detects that standard input is terminal.
664 Lists all available mode pages.
665 .It Fl m Ar mode_page
666 This specifies the number of the mode page the user would like to view
668 This argument is mandatory unless
672 This allows the user to specify the page control field.
674 .Bl -tag -width xxx -compact
686 Allows the user to send an arbitrary ATA or SCSI CDB to any device.
689 function requires the
691 argument to specify SCSI CDB or the
693 argument to specify ATA Command Block registers values.
694 Other arguments are optional, depending on
696 The command and data specification syntax is documented
699 NOTE: If the CDB specified causes data to be transferred to or from the
700 SCSI device in question, you MUST specify either
705 .It Fl a Ar cmd Op args
706 This specifies the content of 12 ATA Command Block registers (command,
707 features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
708 lba_high_exp, features_exp, sector_count, sector_count_exp).
709 .It Fl c Ar cmd Op args
710 This specifies the SCSI CDB.
711 SCSI CDBs may be 6, 10, 12 or 16 bytes.
713 Specifies DMA protocol to be used for ATA command.
715 Specifies FPDMA (NCQ) protocol to be used for ATA command.
716 .It Fl i Ar len Ar fmt
717 This specifies the amount of data to read, and how it should be displayed.
721 bytes of data will be read from the device and written to standard output.
722 .It Fl o Ar len Ar fmt Op args
723 This specifies the amount of data to be written to a device, and the data
724 that is to be written.
728 bytes of data will be read from standard input and written to the device.
730 This specifies that 11 result ATA Command Block registers should be displayed
731 (status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
732 lba_high_exp, sector_count, sector_count_exp), and how.
735 11 result registers will be written to standard output in hex.
738 Allows the user to send an arbitrary Serial
739 Management Protocol (SMP) command to a device.
742 function requires the
744 argument to specify the SMP request to be sent, and the
746 argument to specify the format of the SMP response.
747 The syntax for the SMP request and response arguments is documented in
750 Note that SAS adapters that support SMP passthrough (at least the currently
751 known adapters) do not accept CRC bytes from the user in the request and do
752 not pass CRC bytes back to the user in the response.
753 Therefore users should not include the CRC bytes in the length of the
754 request and not expect CRC bytes to be returned in the response.
756 .It Fl r Ar len Ar fmt Op args
757 This specifies the size of the SMP request, without the CRC bytes, and the
762 bytes of data will be read from standard input and written as the SMP
764 .It Fl R Ar len Ar fmt Op args
765 This specifies the size of the buffer allocated for the SMP response, and
766 the SMP response format.
770 bytes of data will be allocated for the response and the response will be
771 written to standard output.
774 Allows the user to send the Serial Management Protocol (SMP) Report General
777 will display the data returned by the Report General command.
778 If the SMP target supports the long response format, the additional data
779 will be requested and displayed automatically.
782 Request the long response format only.
783 Not all SMP targets support the long response format.
786 to skip sending the initial report general request without the long bit set
787 and only issue a report general request with the long bit set.
790 Allows the user to issue the Serial Management Protocol (SMP) PHY Control
792 This function should be used with some caution, as it can render devices
793 inaccessible, and could potentially cause data corruption as well.
796 argument is required to specify the PHY to operate on.
799 Specify the PHY to operate on.
800 This argument is required.
802 Request the long request/response format.
803 Not all SMP targets support the long response format.
804 For the PHY Control command, this currently only affects whether the
805 request length is set to a value other than 0.
806 .It Fl o Ar operation
807 Specify a PHY control operation.
810 operation may be specified.
811 The operation may be specified numerically (in decimal, hexadecimal, or octal)
812 or one of the following operation names may be specified:
816 It is not necessary to specify this argument.
818 Send the LINK RESET command to the phy.
820 Send the HARD RESET command to the phy.
822 Send the DISABLE command to the phy.
823 Note that the LINK RESET or HARD RESET commands should re-enable the phy.
825 Send the CLEAR ERROR LOG command.
826 This clears the error log counters for the specified phy.
828 Send the CLEAR AFFILIATION command.
829 This clears the affiliation from the STP initiator port with the same SAS
830 address as the SMP initiator that requests the clear operation.
832 Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
833 This will cause a SATA port selector to use the given phy as its active phy
834 and make the other phy inactive.
836 Send the CLEAR STP I_T NEXUS LOSS command to the PHY.
838 Send the SET ATTACHED DEVICE NAME command to the PHY.
841 argument to specify the device name.
844 Specify the attached device name.
845 This option is needed with the
848 The name is a 64-bit number, and can be specified in decimal, hexadecimal
851 Set the minimum physical link rate for the phy.
852 This is a numeric argument.
853 Currently known link rates are:
856 Do not change current value.
865 Other values may be specified for newer physical link rates.
867 Set the maximum physical link rate for the phy.
868 This is a numeric argument.
871 argument description for known link rate arguments.
872 .It Fl T Ar pp_timeout
873 Set the partial pathway timeout value, in microseconds.
878 specification for more information on this field.
879 .It Fl a Ar enable|disable
880 Enable or disable SATA slumber phy power conditions.
881 .It Fl A Ar enable|disable
882 Enable or disable SATA partial power conditions.
883 .It Fl s Ar enable|disable
884 Enable or disable SAS slumber phy power conditions.
885 .It Fl S Ar enable|disable
886 Enable or disable SAS partial phy power conditions.
889 List phys attached to a SAS expander, the address of the end device
890 attached to the phy, and the inquiry data for that device and peripheral
891 devices attached to that device.
892 The inquiry data and peripheral devices are displayed if available.
895 Turn on the long response format for the underlying SMP commands used for
898 Only print out phys that are attached to a device in the CAM EDT (Existing
902 Send the SMP Report Manufacturer Information command to the device and
903 display the response.
906 Turn on the long response format for the underlying SMP commands used for
910 Turn on CAM debugging printfs in the kernel.
911 This requires options CAMDEBUG
912 in your kernel config file.
913 WARNING: enabling debugging printfs currently
914 causes an EXTREME number of kernel printfs.
915 You may have difficulty
916 turning off the debugging printfs once they start, since the kernel will be
917 busy printing messages and unable to service other requests quickly.
920 function takes a number of arguments:
923 Enable CAM_DEBUG_INFO printfs.
925 Enable CAM_DEBUG_PERIPH printfs.
927 Enable CAM_DEBUG_TRACE printfs.
929 Enable CAM_DEBUG_SUBTRACE printfs.
931 Enable CAM_DEBUG_XPT printfs.
933 Enable CAM_DEBUG_CDB printfs.
934 This will cause the kernel to print out the
935 SCSI CDBs sent to the specified device(s).
937 Enable CAM_DEBUG_PROBE printfs.
939 Enable debugging for all devices.
941 Turn off debugging for all devices
942 .It bus Ns Op :target Ns Op :lun
943 Turn on debugging for the given bus, target or lun.
945 and lun are not specified, they are wildcarded.
946 (i.e., just specifying a
947 bus turns on debugging printfs for all devices on that bus.)
950 Show or set the number of "tagged openings" or simultaneous transactions
951 we attempt to queue to a particular device.
954 command, with no command-specific arguments (i.e., only generic arguments)
955 prints out the "soft" maximum number of transactions that can be queued to
956 the device in question.
957 For more detailed information, use the
959 argument described below.
962 Set the number of tags for the given device.
963 This must be between the
964 minimum and maximum number set in the kernel quirk table.
966 most devices that support tagged queueing is a minimum of 2 and a maximum
968 The minimum and maximum values for a given device may be
969 determined by using the
976 subcommand is described below.
978 Be quiet, and do not report the number of tags.
979 This is generally used when
980 setting the number of tags.
982 The verbose flag has special functionality for the
987 to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
990 This is the amount of capacity for transactions queued to a given device.
992 This is the number of transactions currently queued to a device.
994 This is the kernel queue space for transactions.
995 This count usually mirrors
996 dev_openings except during error recovery operations when
997 the device queue is frozen (device is not allowed to receive
998 commands), the number of dev_openings is reduced, or transaction
1001 This is the number of transactions waiting in the kernel queue for capacity
1003 This number is usually zero unless error recovery is in
1006 The held count is the number of CCBs held by peripheral drivers that have
1007 either just been completed or are about to be released to the transport
1008 layer for service by a device.
1009 Held CCBs reserve capacity on a given
1012 This is the current "hard" minimum number of transactions that can be
1013 queued to a device at once.
1016 value above cannot go below this number.
1017 The default value for
1019 is 2, although it may be set higher or lower for various devices.
1021 This is the "hard" maximum number of transactions that can be queued to a
1025 value cannot go above this number.
1026 The default value for
1028 is 255, although it may be set higher or lower for various devices.
1032 Show or negotiate various communication parameters.
1033 Some controllers may
1034 not support setting or changing some of these values.
1036 Adaptec 174x controllers do not support changing a device's sync rate or
1041 will not attempt to set the parameter if the controller indicates that it
1042 does not support setting the parameter.
1043 To find out what the controller
1051 command is described below.
1052 Also, some controller drivers do not support
1053 setting negotiation parameters, even if the underlying controller supports
1054 negotiation changes.
1055 Some controllers, such as the Advansys wide
1056 controllers, support enabling and disabling synchronous negotiation for
1057 a device, but do not support setting the synchronous negotiation rate.
1060 Attempt to make the negotiation settings take effect immediately by sending
1061 a Test Unit Ready command to the device.
1063 Show or set current negotiation settings.
1064 This is the default.
1065 .It Fl D Ar enable|disable
1066 Enable or disable disconnection.
1070 Set the command delay offset.
1072 Be quiet, do not print anything.
1073 This is generally useful when you want to
1074 set a parameter, but do not want any status information.
1075 .It Fl R Ar syncrate
1076 Change the synchronization rate for a device.
1077 The sync rate is a floating
1078 point value specified in MHz.
1081 is a legal value, as is
1083 .It Fl T Ar enable|disable
1084 Enable or disable tagged queueing for a device.
1086 Show or set user negotiation settings.
1087 The default is to show or set
1088 current negotiation settings.
1090 The verbose switch has special meaning for the
1095 to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
1097 .It Fl W Ar bus_width
1098 Specify the bus width to negotiate with a device.
1101 The only useful values to specify are 8, 16, and 32
1103 The controller must support the bus width in question in order for
1104 the setting to take effect.
1107 In general, sync rate and offset settings will not take effect for a
1108 device until a command has been sent to the device.
1111 switch above will automatically send a Test Unit Ready to the device so
1112 negotiation parameters will take effect.
1116 FORMAT UNIT command to the named device.
1118 .Em WARNING! WARNING! WARNING!
1120 Low level formatting a disk will destroy ALL data on the disk.
1122 extreme caution when issuing this command.
1123 Many users low-level format
1124 disks that do not really need to be low-level formatted.
1126 relatively few scenarios that call for low-level formatting a disk.
1128 low-level formatting a disk is to initialize the disk after changing
1129 its physical sector size.
1130 Another reason for low-level formatting a disk
1131 is to revive the disk if you are getting "medium format corrupted" errors
1132 from the disk in response to read and write requests.
1134 Some disks take longer than others to format.
1135 Users should specify a
1136 timeout long enough to allow the format to complete.
1138 timeout is 3 hours, which should be long enough for most disks.
1140 disks will complete a format operation in a very short period of time
1141 (on the order of 5 minutes or less).
1142 This is often because the drive
1143 does not really support the FORMAT UNIT command -- it just accepts the
1144 command, waits a few minutes and then returns it.
1148 subcommand takes several arguments that modify its default behavior.
1153 arguments can be useful for scripts.
1156 Be quiet, do not print any status messages.
1157 This option will not disable
1158 the questions, however.
1159 To disable questions, use the
1166 This will report status on a format that is already running on the drive.
1168 Issue a non-immediate format command.
1171 issues the FORMAT UNIT command with the immediate bit set.
1173 device to immediately return the format command, before the format has
1179 sense information from the device every second to determine how far along
1180 in the format process it is.
1183 argument is specified,
1185 will issue a non-immediate format command, and will be unable to print any
1186 information to let the user know what percentage of the disk has been
1189 Do not ask any questions.
1192 will ask the user if he/she really wants to format the disk in question,
1193 and also if the default format command timeout is acceptable.
1195 will not be asked about the timeout if a timeout is specified on the
1201 SANITIZE command to the named device.
1203 .Em WARNING! WARNING! WARNING!
1205 ALL data in the cache and on the disk will be destroyed or made inaccessible.
1206 Recovery of the data is not possible.
1207 Use extreme caution when issuing this command.
1211 subcommand takes several arguments that modify its default behavior.
1216 arguments can be useful for scripts.
1218 .It Fl a Ar operation
1219 Specify the sanitize operation to perform.
1222 Perform an overwrite operation by writing a user supplied
1223 data pattern to the device one or more times.
1224 The pattern is given by the
1227 The number of times is given by the
1231 Perform a block erase operation.
1232 All the device's blocks are set to a vendor defined
1233 value, typically zero.
1235 Perform a cryptographic erase operation.
1236 The encryption keys are changed to prevent the decryption
1239 Exits a previously failed sanitize operation.
1240 A failed sanitize operation can only be exited if it was
1241 run in the unrestricted completion mode, as provided by the
1246 The number of passes when performing an
1249 Valid values are between 1 and 31.
1254 operation, the pattern is inverted between consecutive passes.
1256 Path to the file containing the pattern to use when
1260 The pattern is repeated as needed to fill each block.
1262 Be quiet, do not print any status messages.
1263 This option will not disable
1264 the questions, however.
1265 To disable questions, use the
1269 Perform the sanitize in the unrestricted completion mode.
1270 If the operation fails, it can later be exited with the
1277 This will report status on a sanitize that is already running on the drive.
1279 Issue a non-immediate sanitize command.
1282 issues the SANITIZE command with the immediate bit set.
1284 device to immediately return the sanitize command, before
1285 the sanitize has actually completed.
1290 sense information from the device every second to determine how far along
1291 in the sanitize process it is.
1294 argument is specified,
1296 will issue a non-immediate sanitize command, and will be unable to print any
1297 information to let the user know what percentage of the disk has been
1300 Do not ask any questions.
1303 will ask the user if he/she really wants to sanitize the disk in question,
1304 and also if the default sanitize command timeout is acceptable.
1306 will not be asked about the timeout if a timeout is specified on the
1310 Put ATA device into IDLE state.
1313 specifies automatic standby timer value in seconds.
1314 Value 0 disables timer.
1316 Put ATA device into STANDBY state.
1319 specifies automatic standby timer value in seconds.
1320 Value 0 disables timer.
1322 Put ATA device into SLEEP state.
1323 Note that the only way get device out of
1324 this state may be reset.
1326 It optional parameter
1328 specified, enables and sets advanced power management level, where
1329 1 -- minimum power, 127 -- maximum performance with standby,
1330 128 -- minimum power without standby, 254 -- maximum performance.
1331 If not specified -- APM is disabled.
1333 It optional parameter
1335 specified, enables and sets automatic acoustic management level, where
1336 1 -- minimum noise, 254 -- maximum performance.
1337 If not specified -- AAM is disabled.
1339 Update or report security settings, using an ATA identify command (0xec).
1342 will print out the security support and associated settings of the device.
1345 command takes several arguments:
1349 Disable device security using the given password for the selected user according
1350 to the devices configured security level.
1353 Erase the device using the given password for the selected user.
1355 .Em WARNING! WARNING! WARNING!
1357 Issuing a secure erase will
1359 user data on the device and may take several hours to complete.
1361 When this command is used against an SSD drive all its cells will be marked as
1362 empty, restoring it to factory default write performance.
1363 For SSD's this action
1364 usually takes just a few seconds.
1367 Freeze the security configuration of the specified device.
1369 After command completion any other commands that update the device lock mode
1370 shall be command aborted.
1371 Frozen mode is disabled by power-off or hardware reset.
1374 Enhanced erase the device using the given password for the selected user.
1376 .Em WARNING! WARNING! WARNING!
1378 Issuing an enhanced secure erase will
1380 user data on the device and may take several hours to complete.
1382 An enhanced erase writes predetermined data patterns to all user data areas,
1383 all previously written user data shall be overwritten, including sectors that
1384 are no longer in use due to reallocation.
1387 Unlock the device using the given password for the selected user according to
1388 the devices configured security level.
1389 .It Fl l Ar high|maximum
1391 Specifies which security level to set when issuing a
1394 The security level determines device behavior when the master
1395 password is used to unlock the device.
1396 When the security level is set to high
1397 the device requires the unlock command and the master password to unlock.
1398 When the security level is set to maximum the device requires a secure erase
1399 with the master password to unlock.
1401 This option must be used in conjunction with one of the security action commands.
1407 Be quiet, do not print any status messages.
1408 This option will not disable the questions, however.
1409 To disable questions, use the
1414 Password the device (enable security) using the given password for the selected
1416 This option can be combined with other options such as
1419 A master password may be set in a addition to the user password. The purpose of
1420 the master password is to allow an administrator to establish a password that
1421 is kept secret from the user, and which may be used to unlock the device if the
1422 user password is lost.
1425 Setting the master password does not enable device security.
1427 If the master password is set and the drive supports a Master Revision Code
1428 feature the Master Password Revision Code will be decremented.
1431 Overrides the default timeout, specified in seconds, used for both
1435 this is useful if your system has problems processing long timeouts correctly.
1437 Usually the timeout is calculated from the information stored on the drive if
1438 present, otherwise it defaults to 2 hours.
1439 .It Fl U Ar user|master
1441 Specifies which user to set / use for the running action command, valid values
1442 are user or master and defaults to master if not set.
1444 This option must be used in conjunction with one of the security action commands.
1450 Confirm yes to dangerous options such as
1452 without prompting for confirmation.
1455 If the password specified for any action commands does not match the configured
1456 password for the specified user the command will fail.
1458 The password in all cases is limited to 32 characters, longer passwords will
1461 Update or report Host Protected Area details.
1464 will print out the HPA support and associated settings of the device.
1467 command takes several optional arguments:
1471 Freeze the HPA configuration of the specified device.
1473 After command completion any other commands that update the HPA configuration
1474 shall be command aborted.
1475 Frozen mode is disabled by power-off or hardware reset.
1478 Lock the HPA configuration of the device until a successful call to unlock or
1479 the next power-on reset occurs.
1482 Make the HPA max sectors persist across power-on reset or a hardware reset.
1483 This must be used in combination with
1484 .Fl s Ar max_sectors
1488 Set the HPA configuration password required for unlock calls.
1491 Be quiet, do not print any status messages.
1492 This option will not disable the questions.
1493 To disable questions, use the
1496 .It Fl s Ar max_sectors
1498 Configures the maximum user accessible sectors of the device.
1499 This will change the number of sectors the device reports.
1501 .Em WARNING! WARNING! WARNING!
1503 Changing the max sectors of a device using this option will make the data on
1504 the device beyond the specified value inaccessible.
1507 .Fl s Ar max_sectors
1508 call can be made without a power-on reset or a hardware reset of the device.
1511 Unlock the HPA configuration of the specified device using the given password.
1512 If the password specified does not match the password configured via
1514 the command will fail.
1516 After 5 failed unlock calls, due to password miss-match, the device will refuse
1517 additional unlock calls until after a power-on reset.
1520 Confirm yes to dangerous options such as
1522 without prompting for confirmation
1525 The password for all HPA commands is limited to 32 characters, longer passwords
1528 Program firmware of the named
1530 or ATA device using the image file provided.
1534 device and it provides a recommended timeout for the WRITE BUFFER command
1537 opcodes subcommand), that timeout will be used for the firmware download.
1538 The drive-recommended timeout value may be overridden on the command line
1543 Current list of supported vendors for SCSI/SAS drives:
1546 Tested with 4TB SAS drives, model number HUS724040ALS640.
1550 Tested with LTO-5 (ULTRIUM-HH5) and LTO-6 (ULTRIUM-HH6) tape drives.
1551 There is a separate table entry for hard drives, because the update method
1552 for hard drives is different than the method for tape drives.
1557 Tested with SM1625 SSDs.
1559 Tested with Constellation ES (ST32000444SS), ES.2 (ST33000651SS) and
1560 ES.3 (ST1000NM0023) drives.
1562 Tested with 400GB Optimus SSDs (TXA2D20400GA6001).
1565 .Em WARNING! WARNING! WARNING!
1567 Little testing has been done to make sure that different device models from
1568 each vendor work correctly with the fwdownload command.
1569 A vendor name appearing in the supported list means only that firmware of at
1570 least one device type from that vendor has successfully been programmed with
1571 the fwdownload command.
1572 Extra caution should be taken when using this command since there is no
1573 guarantee it will not break a device from the listed vendors.
1574 Ensure that you have a recent backup of the data on the device before
1575 performing a firmware update.
1579 protocol devices will not be programmed, since there is little chance of
1580 the firmware download succeeding.
1583 will currently attempt a firmware download to any
1587 device, since the standard
1589 DOWNLOAD MICROCODE command may work.
1590 Firmware downloads to
1594 devices are supported for devices connected
1599 controllers, and devices connected to SAS controllers
1604 translation capability.
1610 PASS-THROUGH command to send the
1612 DOWNLOAD MICROCODE command to the drive.
1617 translation implementations don't work fully when translating
1619 WRITE BUFFER commands to
1621 DOWNLOAD MICROCODE commands, but do support
1623 passthrough well enough to do a firmware download.
1625 .It Fl f Ar fw_image
1626 Path to the firmware image file to be downloaded to the specified device.
1628 Do not print informational messages, only print errors.
1629 This option should be used with the
1631 option to suppress all output.
1633 Run in simulation mode.
1634 Device checks are run and the confirmation dialog is shown, but no firmware
1635 download will occur.
1641 errors in the event of a failure.
1643 In simulation mode, print out the
1648 register values that would be used for the firmware download command.
1650 Do not ask for confirmation.
1653 Persistent reservation support.
1654 Persistent reservations are a way to reserve a particular
1656 LUN for use by one or more
1661 option is specified,
1665 PERSISTENT RESERVE IN
1666 command using the requested service action.
1669 option is specified,
1673 PERSISTENT RESERVE OUT
1674 command using the requested service action.
1675 One of those two options is required.
1677 Persistent reservations are complex, and fully explaining them is outside
1678 the scope of this manual.
1681 and download the latest SPC spec for a full explanation of persistent
1685 Specify the service action for the PERSISTENT RESERVE IN command.
1686 Supported service actions:
1689 Report the current persistent reservation generation (PRgeneration) and any
1691 .It read_reservation
1692 Report the persistent reservation, if any.
1693 .It report_capabilities
1694 Report the persistent reservation capabilities of the LUN.
1695 .It read_full_status
1696 Report the full status of persistent reservations on the LUN.
1699 Specify the service action for the PERSISTENT RESERVE OUT command.
1700 For service actions like register that are components of other service
1701 action names, the entire name must be specified.
1702 Otherwise, enough of the service action name must be specified to
1703 distinguish it from other possible service actions.
1704 Supported service actions:
1707 Register a reservation key with the LUN or unregister a reservation key.
1708 To register a key, specify the requested key as the Service Action
1710 To unregister a key, specify the previously registered key as the
1712 To change a key, specify the old key as the Reservation Key and the new
1713 key as the Service Action Reservation Key.
1715 This is similar to the register subcommand, except that the Reservation Key
1717 The Service Action Reservation Key will overwrite any previous key
1718 registered for the initiator.
1720 Create a reservation.
1721 A key must be registered with the LUN before the LUN can be reserved, and
1722 it must be specified as the Reservation Key.
1723 The type of reservation must also be specified.
1724 The scope defaults to LUN scope (LU_SCOPE), but may be changed.
1726 Release a reservation.
1727 The Reservation Key must be specified.
1729 Release a reservation and remove all keys from the device.
1730 The Reservation Key must be specified.
1732 Remove a reservation belonging to another initiator.
1733 The Reservation Key must be specified.
1734 The Service Action Reservation Key may be specified, depending on the
1735 operation being performed.
1737 Remove a reservation belonging to another initiator and abort all
1738 outstanding commands from that initiator.
1739 The Reservation Key must be specified.
1740 The Service Action Reservation Key may be specified, depending on the
1741 operation being performed.
1743 Register another initiator with the LUN, and establish a reservation on the
1744 LUN for that initiator.
1745 The Reservation Key and Service Action Reservation Key must be specified.
1747 Replace Lost Reservation information.
1750 Set the All Target Ports (ALL_TG_PT) bit.
1751 This requests that the key registration be applied to all target ports and
1752 not just the particular target port that receives the command.
1753 This only applies to the register and register_ignore actions.
1755 Specify a Transport ID.
1756 This only applies to the Register and Register and Move service actions for
1757 Persistent Reserve Out.
1758 Multiple Transport IDs may be specified with multiple
1761 With the Register service action, specifying one or more Transport IDs
1762 implicitly enables the
1764 option which turns on the SPEC_I_PT bit.
1765 Transport IDs generally have the format protocol,id.
1768 A SAS Transport ID consists of
1770 followed by a 64-bit SAS address.
1773 .Dl sas,0x1234567812345678
1775 A Fibre Channel Transport ID consists of
1777 followed by a 64-bit Fibre Channel World Wide Name.
1780 .Dl fcp,0x1234567812345678
1782 A Parallel SCSI address consists of
1784 followed by a SCSI target ID and a relative target port identifier.
1789 An IEEE 1394 (Firewire) Transport ID consists of
1791 followed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
1794 .Dl sbp,0x1234567812345678
1796 A SCSI over RDMA Transport ID consists of
1798 followed by a 128-bit RDMA initiator port identifier.
1799 The port identifier must be exactly 32 or 34 (if the leading 0x is
1800 included) hexadecimal digits.
1801 Only hexadecimal (base 16) numbers are supported.
1804 .Dl srp,0x12345678123456781234567812345678
1806 An iSCSI Transport ID consists an iSCSI name and optionally a separator and
1808 For example, if only the iSCSI name is specified:
1810 .Dl iqn.2012-06.com.example:target0
1812 If the iSCSI separator and initiator session ID are specified:
1814 .Dl iqn.2012-06.com.example:target0,i,0x123
1816 A SCSI over PCIe Transport ID consists of
1818 followed by a PCIe Routing ID.
1819 The Routing ID consists of a bus, device and function or in the alternate
1820 form, a bus and function.
1821 The bus must be in the range of 0 to 255 inclusive and the device must be
1822 in the range of 0 to 31 inclusive.
1823 The function must be in the range of 0 to 7 inclusive if the standard form
1824 is used, and in the range of 0 to 255 inclusive if the alternate form is
1826 For example, if a bus, device and function are specified for the standard
1831 If the alternate Routing ID form is used:
1836 Specify the Reservation Key.
1837 This may be in decimal, octal or hexadecimal format.
1838 The value is zero by default if not otherwise specified.
1839 The value must be between 0 and 2^64 - 1, inclusive.
1841 Specify the Service Action Reservation Key.
1842 This may be in decimal, octal or hexadecimal format.
1843 The value is zero by default if not otherwise specified.
1844 The value must be between 0 and 2^64 - 1, inclusive.
1846 Enable the Activate Persist Through Power Loss bit.
1847 This is only used for the register and register_ignore actions.
1848 This requests that the reservation persist across power loss events.
1850 Specify the scope of the reservation.
1851 The scope may be specified by name or by number.
1852 The scope is ignored for register, register_ignore and clear.
1853 If the desired scope isn't available by name, you may specify the number.
1857 This encompasses the entire LUN.
1859 Extent scope (0x01).
1861 Element scope (0x02).
1864 Specify the Relative Target Port.
1865 This only applies to the Register and Move service action of the Persistent
1866 Reserve Out command.
1868 Enable the SPEC_I_PT bit.
1869 This only applies to the Register service action of Persistent Reserve Out.
1870 You must also specify at least one Transport ID with
1872 if this option is set.
1873 If you specify a Transport ID, this option is automatically set.
1874 It is an error to specify this option for any service action other than
1877 Specify the reservation type.
1878 The reservation type may be specified by name or by number.
1879 If the desired reservation type isn't available by name, you may specify
1881 Supported reservation type names:
1886 Write Exclusive mode.
1887 May also be specified as
1888 .Dq write_exclusive .
1890 Read Exclusive mode.
1891 May also be specified as
1892 .Dq read_exclusive .
1894 Exclusive access mode.
1895 May also be specified as
1896 .Dq exclusive_access .
1898 Write Exclusive Registrants Only mode.
1899 May also be specified as
1900 .Dq write_exclusive_reg_only .
1902 Exclusive Access Registrants Only mode.
1903 May also be specified as
1904 .Dq exclusive_access_reg_only .
1906 Write Exclusive All Registrants mode.
1907 May also be specified as
1908 .Dq write_exclusive_all_regs .
1910 Exclusive Access All Registrants mode.
1911 May also be specified as
1912 .Dq exclusive_access_all_regs .
1915 Specify that the target should unregister the initiator that sent
1916 the Register and Move request.
1917 By default, the target will not unregister the initiator that sends the
1918 Register and Move request.
1919 This option only applies to the Register and Move service action of the
1920 Persistent Reserve Out command.
1925 READ or WRITE ATTRIBUTE commands.
1926 These commands are used to read and write attributes in Medium Auxiliary
1928 The most common place Medium Auxiliary Memory is found is small flash chips
1929 included tape cartriges.
1937 option must be specified.
1940 Specify the READ ATTRIBUTE service action.
1943 Issue the ATTRIBUTE VALUES service action.
1944 Read and decode the available attributes and their values.
1946 Issue the ATTRIBUTE LIST service action.
1947 List the attributes that are available to read and write.
1949 Issue the LOGICAL VOLUME LIST service action.
1950 List the available logical volumes in the MAM.
1952 Issue the PARTITION LIST service action.
1953 List the available partitions in the MAM.
1955 Issue the SUPPORTED ATTRIBUTES service action.
1956 List attributes that are supported for reading or writing.
1957 These attributes may or may not be currently present in the MAM.
1960 Specify an attribute to write to the MAM.
1961 This option is not yet implemented.
1963 Specify the attribute number to display.
1964 This option only works with the attr_values, attr_list and supp_attr
1968 Display cached attributes.
1969 If the device supports this flag, it allows displaying attributes for the
1970 last piece of media loaded in the drive.
1972 Specify the element address.
1973 This is used for specifying which element number in a medium changer to
1974 access when reading attributes.
1975 The element number could be for a picker, portal, slot or drive.
1976 .It Fl F Ar form1,form2
1977 Specify the output format for the attribute values (attr_val) display as a
1978 comma separated list of options.
1979 The default output is currently set to field_all,nonascii_trim,text_raw.
1980 Once this code is ported to FreeBSD 10, any text fields will be converted
1981 from their codeset to the user's native codeset with
1984 The text options are mutually exclusive; if you specify more than one, you
1985 will get unpredictable results.
1986 The nonascii options are also mutually exclusive.
1987 Most of the field options may be logically ORed together.
1990 Print text fields with non-ASCII characters escaped.
1992 Print text fields natively, with no codeset conversion.
1994 If any non-ASCII characters occur in fields that are supposed to be ASCII,
1995 escape the non-ASCII characters.
1997 If any non-ASCII characters occur in fields that are supposed to be ASCII,
1998 omit the non-ASCII characters.
2000 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2001 print them as they are.
2003 Print all of the prefix fields: description, attribute number, attribute
2004 size, and the attribute's readonly status.
2005 If field_all is specified, specifying any other field options will not have
2008 Print none of the prefix fields, and only print out the attribute value.
2009 If field_none is specified, specifying any other field options will result
2010 in those fields being printed.
2012 Print out the attribute description.
2014 Print out the attribute number.
2016 Print out the attribute size.
2018 Print out the attribute's readonly status.
2021 Specify the partition.
2022 When the media has multiple partitions, specifying different partition
2023 numbers allows seeing the values for each individual partition.
2024 .It Fl s Ar start_num
2025 Specify the starting attribute number.
2026 This requests that the target device return attribute information starting
2027 at the given number.
2028 .It Fl T Ar elem_type
2029 Specify the element type.
2030 For medium changer devices, this allows specifying the type the element
2031 referenced in the element address (
2042 Specify the number of the logical volume to operate on.
2043 If the media has multiple logical volumes, this will allow displaying
2044 or writing attributes on the given logical volume.
2046 Issue the REPORT SUPPORTED OPCODES service action of the
2050 Without arguments, this command will return a list of all
2052 commands supported by the device, including service actions of commands
2053 that support service actions.
2054 It will also include the
2056 CDB (Command Data Block) length for each command, and the description of
2057 each command if it is known.
2060 Request information on a specific opcode instead of the list of supported
2062 If supported, the target will return a CDB-like structure that indicates
2063 the opcode, service action (if any), and a mask of bits that are supported
2065 .It Fl s Ar service_action
2066 For commands that support a service action, specify the service action to
2069 If a service action is specified for a given opcode, and the device does
2070 not support the given service action, the device should not return a
2072 error, but rather indicate in the returned parameter data that the command
2074 By default, if a service action is specified for an opcode, and service
2075 actions are not supported for the opcode in question, the device will
2078 Include timeout values.
2079 This option works with the default display, which includes all commands
2080 supported by the device, and with the
2084 options, which request information on a specific command and service
2086 This requests that the device report Nominal and Recommended timeout values
2087 for the given command or commands.
2088 The timeout values are in seconds.
2089 The timeout descriptor also includes a command-specific
2092 Print out verbose usage information.
2097 variable allows the user to specify an alternate mode page format file.
2101 variable determines which text editor
2103 starts when editing mode pages.
2105 .Bl -tag -width /usr/share/misc/scsi_modes -compact
2106 .It Pa /usr/share/misc/scsi_modes
2107 is the SCSI mode format database.
2109 is the transport layer device.
2111 are the CAM application passthrough devices.
2114 .Dl camcontrol eject -n cd -u 1 -v
2116 Eject the CD from cd1, and print SCSI sense information if the command
2119 .Dl camcontrol tur da0
2121 Send the SCSI test unit ready command to da0.
2124 utility will report whether the disk is ready, but will not display sense
2125 information if the command fails since the
2127 switch was not specified.
2128 .Bd -literal -offset indent
2129 camcontrol tur da1 -E -C 4 -t 50 -v
2132 Send a test unit ready command to da1.
2133 Enable kernel error recovery.
2134 Specify a retry count of 4, and a timeout of 50 seconds.
2138 flag) if the command fails.
2139 Since error recovery is turned on, the
2140 disk will be spun up if it is not currently spinning.
2143 utility will report whether the disk is ready.
2144 .Bd -literal -offset indent
2145 camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
2146 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
2149 Issue a READ BUFFER command (0x3C) to cd1.
2150 Display the buffer size of cd1,
2151 and display the first 10 bytes from the cache on cd1.
2153 information if the command fails.
2154 .Bd -literal -offset indent
2155 camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
2156 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
2159 Issue a WRITE BUFFER (0x3B) command to cd1.
2160 Write out 10 bytes of data,
2161 not including the (reserved) 4 byte header.
2162 Print out sense information if
2164 Be very careful with this command, improper use may
2165 cause data corruption.
2166 .Bd -literal -offset indent
2167 camcontrol modepage da3 -m 1 -e -P 3
2170 Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
2171 settings on the drive.
2172 Mode page 1 contains a disk drive's auto read and
2173 write reallocation settings, among other things.
2175 .Dl camcontrol rescan all
2177 Rescan all SCSI busses in the system for devices that have been added,
2180 .Dl camcontrol rescan 0
2182 Rescan SCSI bus 0 for devices that have been added, removed or changed.
2184 .Dl camcontrol rescan 0:1:0
2186 Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
2189 .Dl camcontrol tags da5 -N 24
2191 Set the number of concurrent transactions for da5 to 24.
2192 .Bd -literal -offset indent
2193 camcontrol negotiate -n da -u 4 -T disable
2196 Disable tagged queueing for da4.
2197 .Bd -literal -offset indent
2198 camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
2201 Negotiate a sync rate of 20MHz and an offset of 15 with da3.
2203 Test Unit Ready command to make the settings take effect.
2204 .Bd -literal -offset indent
2205 camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
2208 Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs
2210 Display SMP errors if the command fails.
2211 .Bd -literal -offset indent
2212 camcontrol security ada0
2215 Report security support and settings for ada0
2216 .Bd -literal -offset indent
2217 camcontrol security ada0 -U user -s MyPass
2220 Enable security on device ada0 with the password MyPass
2221 .Bd -literal -offset indent
2222 camcontrol security ada0 -U user -e MyPass
2225 Secure erase ada0 which has had security enabled with user password MyPass
2227 .Em WARNING! WARNING! WARNING!
2231 data from the device, so backup your data before using!
2233 This command can be used against an SSD drive to restoring it to
2234 factory default write performance.
2235 .Bd -literal -offset indent
2239 Report HPA support and settings for ada0 (also reported via
2241 .Bd -literal -offset indent
2242 camcontrol hpa ada0 -s 10240
2245 Enables HPA on ada0 setting the maximum reported sectors to 10240.
2247 .Em WARNING! WARNING! WARNING!
2251 to all data on the device beyond this limit until HPA is disabled by setting
2252 HPA to native max sectors of the device, which can only be done after a
2253 power-on or hardware reset!
2256 use this on a device which has an active filesystem!
2257 .Bd -literal -offset indent
2258 camcontrol persist da0 -v -i read_keys
2261 This will read any persistent reservation keys registered with da0, and
2262 display any errors encountered when sending the PERSISTENT RESERVE IN
2265 .Bd -literal -offset indent
2266 camcontrol persist da0 -v -o register -a -K 0x12345678
2269 This will register the persistent reservation key 0x12345678 with da0,
2270 apply that registration to all ports on da0, and display any errors that
2271 occur when sending the PERSISTENT RESERVE OUT command.
2272 .Bd -literal -offset indent
2273 camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
2276 This will reserve da0 for the exlusive use of the initiator issuing the
2278 The scope of the reservation is the entire LUN.
2279 Any errors sending the PERSISTENT RESERVE OUT command will be displayed.
2280 .Bd -literal -offset indent
2281 camcontrol persist da0 -v -i read_full
2284 This will display the full status of all reservations on da0 and print out
2285 status if there are any errors.
2286 .Bd -literal -offset indent
2287 camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
2290 This will release a reservation on da0 of the type ex_ac
2292 The Reservation Key for this registration is 0x12345678.
2293 Any errors that occur will be displayed.
2294 .Bd -literal -offset indent
2295 camcontrol persist da0 -v -o register -K 0x12345678 -S \e
2296 -I sas,0x1234567812345678 -I sas,0x8765432187654321
2299 This will register the key 0x12345678 with da0, specifying that it applies
2300 to the SAS initiators with SAS addresses 0x1234567812345678 and
2302 .Bd -literal -offset indent
2303 camcontrol persist da0 -v -o register_move -k 0x87654321 \e
2304 -K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
2307 This will move the registration from the current initiator, whose
2308 Registration Key is 0x87654321, to the Fibre Channel initiator with the
2309 Fiber Channel World Wide Node Name 0x1234567812345678.
2310 A new registration key, 0x12345678, will be registered for the initiator
2311 with the Fibre Channel World Wide Node Name 0x1234567812345678, and the
2312 current initiator will be unregistered from the target.
2313 The reservation will be moved to relative target port 2 on the target
2315 The registration will persist across power losses.
2316 .Bd -literal -offset indent
2317 camcontrol attrib sa0 -v -i attr_values -p 1
2320 This will read and decode the attribute values from partition 1 on the tape
2321 in tape drive sa0, and will display any
2326 .Xr cam_cdbparse 3 ,
2333 utility first appeared in
2336 The mode page editing code and arbitrary SCSI command code are based upon
2341 library, written by Julian Elischer and Peter Dufault.
2344 program first appeared in
2346 and first appeared in
2351 .An Kenneth Merry Aq Mt ken@FreeBSD.org
2353 The code that parses the generic command line arguments does not know that
2354 some of the subcommands take multiple arguments.
2355 So if, for instance, you
2356 tried something like this:
2357 .Bd -literal -offset indent
2358 camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
2361 The sense information from the test unit ready command would not get
2362 printed out, since the first
2366 bails out when it sees the second argument to
2370 Fixing this behavior would take some gross code, or changes to the
2373 The best way to circumvent this problem is to always make sure
2376 arguments before any command-specific arguments.