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
105 .Aq all | bus Ns Op :target:lun
108 .Aq all | bus Ns Op :target:lun
124 .Aq Fl m Ar page[,subpage] | Fl l
132 .Aq Fl a Ar cmd Op args
133 .Aq Fl c Ar cmd Op args
136 .Op Fl i Ar len Ar fmt
138 .Op Fl o Ar len Ar fmt Op args
145 .Aq Fl r Ar len Ar fmt Op args
146 .Aq Fl R Ar len Ar fmt Op args
158 .Op Fl o Ar operation
162 .Op Fl T Ar pp_timeout
163 .Op Fl a Ar enable|disable
164 .Op Fl A Ar enable|disable
165 .Op Fl s Ar enable|disable
166 .Op Fl S Ar enable|disable
187 .Aq all|off|bus Ns Op :target Ns Op :lun
200 .Op Fl D Ar enable|disable
205 .Op Fl T Ar enable|disable
207 .Op Fl W Ar bus_width
221 .Aq Fl a Ar overwrite | block | crypto | exitfailure
271 .Op Fl l Ar high|maximum
275 .Op Fl U Ar user|master
286 .Op Fl s Ar max_sectors
293 .Aq Fl i Ar action | Fl o Ar action
299 .Op Fl R Ar rel_tgt_port
308 .Aq Fl r Ar action | Fl w Ar attrib
311 .Op Fl e Ar elem_addr
312 .Op Fl F Ar form1,form2
314 .Op Fl s Ar start_addr
315 .Op Fl T Ar elem_type
322 .Op Fl s Ar service_action
331 .Op Fl P Ar print_opts
339 .Op Fl p Ar power_cond
341 .Op Fl r Ar restore_src
343 .Op Fl S Ar power_src
349 .Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac
355 utility is designed to provide a way for users to access and control the
362 can cause a loss of data and/or system crashes if used improperly.
364 expert users are encouraged to exercise caution when using this command.
365 Novice users should stay away from this utility.
369 utility has a number of primary functions, many of which support an optional
371 A device identifier can take one of three forms:
374 Specify a device name and unit number combination, like "da5" or "cd3".
376 Specify a bus number and target id.
377 The bus number can be determined from
379 .Dq camcontrol devlist .
380 The lun defaults to 0.
382 Specify the bus, target and lun for a device.
386 The device identifier, if it is specified,
388 come immediately after the function name, and before any generic or
389 function-specific arguments.
394 arguments described below will override any device name or unit number
395 specified beforehand.
402 override a specified bus:target or bus:target:lun, however.
406 primary functions support these generic arguments:
409 SCSI command retry count.
410 In order for this to work, error recovery
414 Instruct the kernel to perform generic SCSI error recovery for the given
416 This is needed in order for the retry count
419 Other than retrying commands, the generic error recovery in
420 the code will generally attempt to spin up drives that are not spinning.
421 It may take some other actions, depending upon the sense code returned from
424 Specify the device type to operate on, e.g.\& "da", "cd".
426 SCSI command timeout in seconds.
427 This overrides the default timeout for
429 .It Fl u Ar unit_number
430 Specify the device unit number, e.g.\& "1", "5".
432 Be verbose, print out sense information for failed SCSI commands.
435 Primary command functions:
436 .Bl -tag -width periphlist
438 List all physical devices (logical units) attached to the CAM subsystem.
439 This also includes a list of peripheral drivers attached to each device.
442 argument, SCSI bus number, adapter name and unit numbers are printed as
444 On the other hand, with the
446 argument, only the bus adapter, and unit information will be printed, and
447 device information will be omitted.
449 List all peripheral drivers attached to a given physical device (logical
452 Send the SCSI test unit ready (0x00) command to the given device.
455 utility will report whether the device is ready or not.
457 Send a SCSI inquiry command (0x12) to a device.
460 will print out the standard inquiry data, device serial number, and
461 transfer rate information.
462 The user can specify that only certain types of
463 inquiry data be printed:
466 Get the standard inquiry data.
468 Print out the serial number.
469 If this flag is the only one specified,
471 will not print out "Serial Number" before the value returned by the drive.
472 This is to aid in script writing.
474 Print out transfer rate information.
477 Send a ATA identify command (0xec) to a device.
479 Send the SCSI REPORT LUNS (0xA0) command to the given device.
482 will print out the list of logical units (LUNs) supported by the target device.
483 There are a couple of options to modify the output:
486 Just print out a count of LUNs, not the actual LUN numbers.
488 Just print out the LUNs, and do not print out the count.
489 .It Fl r Ar reporttype
490 Specify the type of report to request from the target:
491 .Bl -tag -width 012345678
493 Return the default report.
497 Most targets will support this report if they support the REPORT LUNS
500 Return only well known LUNs.
502 Return all available LUNs.
507 will try to print out LUN numbers in a reasonable format.
508 It can understand the peripheral, flat, LUN and extended LUN formats.
510 Send the SCSI READ CAPACITY command to the given device and display
512 If the device is larger than 2TB, the SCSI READ CAPACITY (16) service
513 action will be sent to obtain the full size of the device.
516 will print out the last logical block of the device, and the blocksize of
518 To modify the output format, use the following options:
521 Just print out the blocksize, not the last block or device size.
522 This cannot be used with
527 Print out the device size in human readable (base 2, 1K == 1024) format.
530 and cannot be used with
535 Print out the device size in human readable (base 10, 1K == 1000) format.
537 Print out the number of blocks in the device instead of the last logical
540 Quiet, print out the numbers only (separated by a comma if
546 Print out the last logical block or the size of the device only, and omit
550 Note that this command only displays the information, it does not update
551 the kernel data structures.
554 reprobe subcommand to do that.
556 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
559 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
562 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
563 start bit set and the load/eject bit set.
565 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
566 start bit cleared and the load/eject bit set.
568 Tell the kernel to scan all buses in the system (with the
570 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
571 (XPT_SCAN_LUN) for new devices or devices that have gone away.
573 may specify a scan of all buses, a single bus, or a lun.
575 on a target is not supported.
577 Tell the kernel to refresh the information about the device and
578 notify the upper layer,
580 This includes sending the SCSI READ CAPACITY command and updating
581 the disk size visible to the rest of the system.
583 Tell the kernel to reset all buses in the system (with the
585 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
586 reset for that bus, or to reset the given bus:target:lun
587 (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
588 connecting to that device.
589 Note that this can have a destructive impact
594 READ DEFECT DATA (10) command (0x37) or the
596 READ DEFECT DATA (12) command (0xB7) to the given device, and
597 print out any combination of: the total number of defects, the primary
598 defect list (PLIST), and the grown defect list (GLIST).
601 Specify the requested format of the defect list.
602 The format argument is
604 Most drives support the physical sector format.
606 support the logical block format.
607 Many drives, if they do not support the
608 requested format, return the data in an alternate format, along with sense
609 information indicating that the requested data format is not supported.
613 attempts to detect this, and print out whatever format the drive returns.
614 If the drive uses a non-standard sense code to report that it does not
615 support the requested format,
617 will probably see the error as a failure to complete the request.
619 The format options are:
622 Print out the list as logical blocks.
623 This is limited to 32-bit block sizes, and isn't supported by many modern
626 Print out the list as logical blocks.
627 This option uses a 64-bit block size.
629 Print out the list in bytes from index format.
631 Print out the list in extended bytes from index format.
632 The extended format allows for ranges of blocks to be printed.
634 Print out the list in physical sector format.
635 Most drives support this format.
637 Print out the list in extended physical sector format.
638 The extended format allows for ranges of blocks to be printed.
641 Print out the grown defect list.
642 This is a list of bad blocks that have
643 been remapped since the disk left the factory.
645 Print out the primary defect list.
646 This is the list of defects that were present in the factory.
648 When printing status information with
650 only print the number of defects.
652 Just print the number of defects, not the list of defects.
654 Specify the starting offset into the defect list.
655 This implies using the
657 READ DEFECT DATA (12) command, as the 10 byte version of the command
658 doesn't support the address descriptor index field.
659 Not all drives support the 12 byte command, and some drives that support
660 the 12 byte command don't support the address descriptor index field.
662 Print out defects in hexadecimal (base 16) form instead of base 10 form.
671 will print out the number of defects given in the READ DEFECT DATA header
672 returned from the drive.
673 Some drives will report 0 defects if neither the primary or grown defect
676 Allows the user to display and optionally edit a SCSI mode page.
678 page formats are located in
679 .Pa /usr/share/misc/scsi_modes .
680 This can be overridden by specifying a different file in the
682 environment variable.
685 command takes several arguments:
688 Disable block descriptors for mode sense.
690 Displays mode page data in binary format.
692 This flag allows the user to edit values in the mode page.
694 either edit mode page values with the text editor pointed to by his
696 environment variable, or supply mode page values via standard input, using
699 uses to display mode page values.
700 The editor will be invoked if
702 detects that standard input is terminal.
704 Lists all available mode pages.
705 If specified more then once, also lists subpages.
706 .It Fl m Ar page[,subpage]
707 This specifies the number of the mode page and optionally subpage the user
708 would like to view and/or edit.
709 This argument is mandatory unless
713 This allows the user to specify the page control field.
715 .Bl -tag -width xxx -compact
727 Allows the user to send an arbitrary ATA or SCSI CDB to any device.
730 function requires the
732 argument to specify SCSI CDB or the
734 argument to specify ATA Command Block registers values.
735 Other arguments are optional, depending on
737 The command and data specification syntax is documented
740 NOTE: If the CDB specified causes data to be transferred to or from the
741 SCSI device in question, you MUST specify either
746 .It Fl a Ar cmd Op args
747 This specifies the content of 12 ATA Command Block registers (command,
748 features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
749 lba_high_exp, features_exp, sector_count, sector_count_exp).
750 .It Fl c Ar cmd Op args
751 This specifies the SCSI CDB.
752 SCSI CDBs may be 6, 10, 12 or 16 bytes.
754 Specifies DMA protocol to be used for ATA command.
756 Specifies FPDMA (NCQ) protocol to be used for ATA command.
757 .It Fl i Ar len Ar fmt
758 This specifies the amount of data to read, and how it should be displayed.
762 bytes of data will be read from the device and written to standard output.
763 .It Fl o Ar len Ar fmt Op args
764 This specifies the amount of data to be written to a device, and the data
765 that is to be written.
769 bytes of data will be read from standard input and written to the device.
771 This specifies that 11 result ATA Command Block registers should be displayed
772 (status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
773 lba_high_exp, sector_count, sector_count_exp), and how.
776 11 result registers will be written to standard output in hex.
779 Allows the user to send an arbitrary Serial
780 Management Protocol (SMP) command to a device.
783 function requires the
785 argument to specify the SMP request to be sent, and the
787 argument to specify the format of the SMP response.
788 The syntax for the SMP request and response arguments is documented in
791 Note that SAS adapters that support SMP passthrough (at least the currently
792 known adapters) do not accept CRC bytes from the user in the request and do
793 not pass CRC bytes back to the user in the response.
794 Therefore users should not include the CRC bytes in the length of the
795 request and not expect CRC bytes to be returned in the response.
797 .It Fl r Ar len Ar fmt Op args
798 This specifies the size of the SMP request, without the CRC bytes, and the
803 bytes of data will be read from standard input and written as the SMP
805 .It Fl R Ar len Ar fmt Op args
806 This specifies the size of the buffer allocated for the SMP response, and
807 the SMP response format.
811 bytes of data will be allocated for the response and the response will be
812 written to standard output.
815 Allows the user to send the Serial Management Protocol (SMP) Report General
818 will display the data returned by the Report General command.
819 If the SMP target supports the long response format, the additional data
820 will be requested and displayed automatically.
823 Request the long response format only.
824 Not all SMP targets support the long response format.
827 to skip sending the initial report general request without the long bit set
828 and only issue a report general request with the long bit set.
831 Allows the user to issue the Serial Management Protocol (SMP) PHY Control
833 This function should be used with some caution, as it can render devices
834 inaccessible, and could potentially cause data corruption as well.
837 argument is required to specify the PHY to operate on.
840 Specify the PHY to operate on.
841 This argument is required.
843 Request the long request/response format.
844 Not all SMP targets support the long response format.
845 For the PHY Control command, this currently only affects whether the
846 request length is set to a value other than 0.
847 .It Fl o Ar operation
848 Specify a PHY control operation.
851 operation may be specified.
852 The operation may be specified numerically (in decimal, hexadecimal, or octal)
853 or one of the following operation names may be specified:
857 It is not necessary to specify this argument.
859 Send the LINK RESET command to the phy.
861 Send the HARD RESET command to the phy.
863 Send the DISABLE command to the phy.
864 Note that the LINK RESET or HARD RESET commands should re-enable the phy.
866 Send the CLEAR ERROR LOG command.
867 This clears the error log counters for the specified phy.
869 Send the CLEAR AFFILIATION command.
870 This clears the affiliation from the STP initiator port with the same SAS
871 address as the SMP initiator that requests the clear operation.
873 Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
874 This will cause a SATA port selector to use the given phy as its active phy
875 and make the other phy inactive.
877 Send the CLEAR STP I_T NEXUS LOSS command to the PHY.
879 Send the SET ATTACHED DEVICE NAME command to the PHY.
882 argument to specify the device name.
885 Specify the attached device name.
886 This option is needed with the
889 The name is a 64-bit number, and can be specified in decimal, hexadecimal
892 Set the minimum physical link rate for the phy.
893 This is a numeric argument.
894 Currently known link rates are:
897 Do not change current value.
906 Other values may be specified for newer physical link rates.
908 Set the maximum physical link rate for the phy.
909 This is a numeric argument.
912 argument description for known link rate arguments.
913 .It Fl T Ar pp_timeout
914 Set the partial pathway timeout value, in microseconds.
919 specification for more information on this field.
920 .It Fl a Ar enable|disable
921 Enable or disable SATA slumber phy power conditions.
922 .It Fl A Ar enable|disable
923 Enable or disable SATA partial power conditions.
924 .It Fl s Ar enable|disable
925 Enable or disable SAS slumber phy power conditions.
926 .It Fl S Ar enable|disable
927 Enable or disable SAS partial phy power conditions.
930 List phys attached to a SAS expander, the address of the end device
931 attached to the phy, and the inquiry data for that device and peripheral
932 devices attached to that device.
933 The inquiry data and peripheral devices are displayed if available.
936 Turn on the long response format for the underlying SMP commands used for
939 Only print out phys that are attached to a device in the CAM EDT (Existing
943 Send the SMP Report Manufacturer Information command to the device and
944 display the response.
947 Turn on the long response format for the underlying SMP commands used for
951 Turn on CAM debugging printfs in the kernel.
952 This requires options CAMDEBUG
953 in your kernel config file.
954 WARNING: enabling debugging printfs currently
955 causes an EXTREME number of kernel printfs.
956 You may have difficulty
957 turning off the debugging printfs once they start, since the kernel will be
958 busy printing messages and unable to service other requests quickly.
961 function takes a number of arguments:
964 Enable CAM_DEBUG_INFO printfs.
966 Enable CAM_DEBUG_PERIPH printfs.
968 Enable CAM_DEBUG_TRACE printfs.
970 Enable CAM_DEBUG_SUBTRACE printfs.
972 Enable CAM_DEBUG_XPT printfs.
974 Enable CAM_DEBUG_CDB printfs.
975 This will cause the kernel to print out the
976 SCSI CDBs sent to the specified device(s).
978 Enable CAM_DEBUG_PROBE printfs.
980 Enable debugging for all devices.
982 Turn off debugging for all devices
983 .It bus Ns Op :target Ns Op :lun
984 Turn on debugging for the given bus, target or lun.
986 and lun are not specified, they are wildcarded.
987 (i.e., just specifying a
988 bus turns on debugging printfs for all devices on that bus.)
991 Show or set the number of "tagged openings" or simultaneous transactions
992 we attempt to queue to a particular device.
995 command, with no command-specific arguments (i.e., only generic arguments)
996 prints out the "soft" maximum number of transactions that can be queued to
997 the device in question.
998 For more detailed information, use the
1000 argument described below.
1003 Set the number of tags for the given device.
1004 This must be between the
1005 minimum and maximum number set in the kernel quirk table.
1007 most devices that support tagged queueing is a minimum of 2 and a maximum
1009 The minimum and maximum values for a given device may be
1010 determined by using the
1017 subcommand is described below.
1019 Be quiet, and do not report the number of tags.
1020 This is generally used when
1021 setting the number of tags.
1023 The verbose flag has special functionality for the
1028 to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
1031 This is the amount of capacity for transactions queued to a given device.
1033 This is the number of transactions currently queued to a device.
1035 This is the kernel queue space for transactions.
1036 This count usually mirrors
1037 dev_openings except during error recovery operations when
1038 the device queue is frozen (device is not allowed to receive
1039 commands), the number of dev_openings is reduced, or transaction
1040 replay is occurring.
1042 This is the number of transactions waiting in the kernel queue for capacity
1044 This number is usually zero unless error recovery is in
1047 The held count is the number of CCBs held by peripheral drivers that have
1048 either just been completed or are about to be released to the transport
1049 layer for service by a device.
1050 Held CCBs reserve capacity on a given
1053 This is the current "hard" minimum number of transactions that can be
1054 queued to a device at once.
1057 value above cannot go below this number.
1058 The default value for
1060 is 2, although it may be set higher or lower for various devices.
1062 This is the "hard" maximum number of transactions that can be queued to a
1066 value cannot go above this number.
1067 The default value for
1069 is 255, although it may be set higher or lower for various devices.
1073 Show or negotiate various communication parameters.
1074 Some controllers may
1075 not support setting or changing some of these values.
1077 Adaptec 174x controllers do not support changing a device's sync rate or
1082 will not attempt to set the parameter if the controller indicates that it
1083 does not support setting the parameter.
1084 To find out what the controller
1092 command is described below.
1093 Also, some controller drivers do not support
1094 setting negotiation parameters, even if the underlying controller supports
1095 negotiation changes.
1096 Some controllers, such as the Advansys wide
1097 controllers, support enabling and disabling synchronous negotiation for
1098 a device, but do not support setting the synchronous negotiation rate.
1101 Attempt to make the negotiation settings take effect immediately by sending
1102 a Test Unit Ready command to the device.
1104 Show or set current negotiation settings.
1105 This is the default.
1106 .It Fl D Ar enable|disable
1107 Enable or disable disconnection.
1111 Set the command delay offset.
1113 Be quiet, do not print anything.
1114 This is generally useful when you want to
1115 set a parameter, but do not want any status information.
1116 .It Fl R Ar syncrate
1117 Change the synchronization rate for a device.
1118 The sync rate is a floating
1119 point value specified in MHz.
1122 is a legal value, as is
1124 .It Fl T Ar enable|disable
1125 Enable or disable tagged queueing for a device.
1127 Show or set user negotiation settings.
1128 The default is to show or set
1129 current negotiation settings.
1131 The verbose switch has special meaning for the
1136 to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
1138 .It Fl W Ar bus_width
1139 Specify the bus width to negotiate with a device.
1142 The only useful values to specify are 8, 16, and 32
1144 The controller must support the bus width in question in order for
1145 the setting to take effect.
1148 In general, sync rate and offset settings will not take effect for a
1149 device until a command has been sent to the device.
1152 switch above will automatically send a Test Unit Ready to the device so
1153 negotiation parameters will take effect.
1157 FORMAT UNIT command to the named device.
1159 .Em WARNING! WARNING! WARNING!
1161 Low level formatting a disk will destroy ALL data on the disk.
1163 extreme caution when issuing this command.
1164 Many users low-level format
1165 disks that do not really need to be low-level formatted.
1167 relatively few scenarios that call for low-level formatting a disk.
1169 low-level formatting a disk is to initialize the disk after changing
1170 its physical sector size.
1171 Another reason for low-level formatting a disk
1172 is to revive the disk if you are getting "medium format corrupted" errors
1173 from the disk in response to read and write requests.
1175 Some disks take longer than others to format.
1176 Users should specify a
1177 timeout long enough to allow the format to complete.
1179 timeout is 3 hours, which should be long enough for most disks.
1181 disks will complete a format operation in a very short period of time
1182 (on the order of 5 minutes or less).
1183 This is often because the drive
1184 does not really support the FORMAT UNIT command -- it just accepts the
1185 command, waits a few minutes and then returns it.
1189 subcommand takes several arguments that modify its default behavior.
1194 arguments can be useful for scripts.
1197 Be quiet, do not print any status messages.
1198 This option will not disable
1199 the questions, however.
1200 To disable questions, use the
1207 This will report status on a format that is already running on the drive.
1209 Issue a non-immediate format command.
1212 issues the FORMAT UNIT command with the immediate bit set.
1214 device to immediately return the format command, before the format has
1220 sense information from the device every second to determine how far along
1221 in the format process it is.
1224 argument is specified,
1226 will issue a non-immediate format command, and will be unable to print any
1227 information to let the user know what percentage of the disk has been
1230 Do not ask any questions.
1233 will ask the user if he/she really wants to format the disk in question,
1234 and also if the default format command timeout is acceptable.
1236 will not be asked about the timeout if a timeout is specified on the
1242 SANITIZE command to the named device.
1244 .Em WARNING! WARNING! WARNING!
1246 ALL data in the cache and on the disk will be destroyed or made inaccessible.
1247 Recovery of the data is not possible.
1248 Use extreme caution when issuing this command.
1252 subcommand takes several arguments that modify its default behavior.
1257 arguments can be useful for scripts.
1259 .It Fl a Ar operation
1260 Specify the sanitize operation to perform.
1263 Perform an overwrite operation by writing a user supplied
1264 data pattern to the device one or more times.
1265 The pattern is given by the
1268 The number of times is given by the
1272 Perform a block erase operation.
1273 All the device's blocks are set to a vendor defined
1274 value, typically zero.
1276 Perform a cryptographic erase operation.
1277 The encryption keys are changed to prevent the decryption
1280 Exits a previously failed sanitize operation.
1281 A failed sanitize operation can only be exited if it was
1282 run in the unrestricted completion mode, as provided by the
1287 The number of passes when performing an
1290 Valid values are between 1 and 31.
1295 operation, the pattern is inverted between consecutive passes.
1297 Path to the file containing the pattern to use when
1301 The pattern is repeated as needed to fill each block.
1303 Be quiet, do not print any status messages.
1304 This option will not disable
1305 the questions, however.
1306 To disable questions, use the
1310 Perform the sanitize in the unrestricted completion mode.
1311 If the operation fails, it can later be exited with the
1318 This will report status on a sanitize that is already running on the drive.
1320 Issue a non-immediate sanitize command.
1323 issues the SANITIZE command with the immediate bit set.
1325 device to immediately return the sanitize command, before
1326 the sanitize has actually completed.
1331 sense information from the device every second to determine how far along
1332 in the sanitize process it is.
1335 argument is specified,
1337 will issue a non-immediate sanitize command, and will be unable to print any
1338 information to let the user know what percentage of the disk has been
1341 Do not ask any questions.
1344 will ask the user if he/she really wants to sanitize the disk in question,
1345 and also if the default sanitize command timeout is acceptable.
1347 will not be asked about the timeout if a timeout is specified on the
1351 Put ATA device into IDLE state.
1354 specifies automatic standby timer value in seconds.
1355 Value 0 disables timer.
1357 Put ATA device into STANDBY state.
1360 specifies automatic standby timer value in seconds.
1361 Value 0 disables timer.
1363 Put ATA device into SLEEP state.
1364 Note that the only way get device out of
1365 this state may be reset.
1367 It optional parameter
1369 specified, enables and sets advanced power management level, where
1370 1 -- minimum power, 127 -- maximum performance with standby,
1371 128 -- minimum power without standby, 254 -- maximum performance.
1372 If not specified -- APM is disabled.
1374 It optional parameter
1376 specified, enables and sets automatic acoustic management level, where
1377 1 -- minimum noise, 254 -- maximum performance.
1378 If not specified -- AAM is disabled.
1380 Update or report security settings, using an ATA identify command (0xec).
1383 will print out the security support and associated settings of the device.
1386 command takes several arguments:
1390 Disable device security using the given password for the selected user according
1391 to the devices configured security level.
1394 Erase the device using the given password for the selected user.
1396 .Em WARNING! WARNING! WARNING!
1398 Issuing a secure erase will
1400 user data on the device and may take several hours to complete.
1402 When this command is used against an SSD drive all its cells will be marked as
1403 empty, restoring it to factory default write performance.
1404 For SSD's this action
1405 usually takes just a few seconds.
1408 Freeze the security configuration of the specified device.
1410 After command completion any other commands that update the device lock mode
1411 shall be command aborted.
1412 Frozen mode is disabled by power-off or hardware reset.
1415 Enhanced erase the device using the given password for the selected user.
1417 .Em WARNING! WARNING! WARNING!
1419 Issuing an enhanced secure erase will
1421 user data on the device and may take several hours to complete.
1423 An enhanced erase writes predetermined data patterns to all user data areas,
1424 all previously written user data shall be overwritten, including sectors that
1425 are no longer in use due to reallocation.
1428 Unlock the device using the given password for the selected user according to
1429 the devices configured security level.
1430 .It Fl l Ar high|maximum
1432 Specifies which security level to set when issuing a
1435 The security level determines device behavior when the master
1436 password is used to unlock the device.
1437 When the security level is set to high
1438 the device requires the unlock command and the master password to unlock.
1439 When the security level is set to maximum the device requires a secure erase
1440 with the master password to unlock.
1442 This option must be used in conjunction with one of the security action commands.
1448 Be quiet, do not print any status messages.
1449 This option will not disable the questions, however.
1450 To disable questions, use the
1455 Password the device (enable security) using the given password for the selected
1457 This option can be combined with other options such as
1460 A master password may be set in a addition to the user password. The purpose of
1461 the master password is to allow an administrator to establish a password that
1462 is kept secret from the user, and which may be used to unlock the device if the
1463 user password is lost.
1466 Setting the master password does not enable device security.
1468 If the master password is set and the drive supports a Master Revision Code
1469 feature the Master Password Revision Code will be decremented.
1472 Overrides the default timeout, specified in seconds, used for both
1476 this is useful if your system has problems processing long timeouts correctly.
1478 Usually the timeout is calculated from the information stored on the drive if
1479 present, otherwise it defaults to 2 hours.
1480 .It Fl U Ar user|master
1482 Specifies which user to set / use for the running action command, valid values
1483 are user or master and defaults to master if not set.
1485 This option must be used in conjunction with one of the security action commands.
1491 Confirm yes to dangerous options such as
1493 without prompting for confirmation.
1496 If the password specified for any action commands does not match the configured
1497 password for the specified user the command will fail.
1499 The password in all cases is limited to 32 characters, longer passwords will
1502 Update or report Host Protected Area details.
1505 will print out the HPA support and associated settings of the device.
1508 command takes several optional arguments:
1512 Freeze the HPA configuration of the specified device.
1514 After command completion any other commands that update the HPA configuration
1515 shall be command aborted.
1516 Frozen mode is disabled by power-off or hardware reset.
1519 Lock the HPA configuration of the device until a successful call to unlock or
1520 the next power-on reset occurs.
1523 Make the HPA max sectors persist across power-on reset or a hardware reset.
1524 This must be used in combination with
1525 .Fl s Ar max_sectors
1529 Set the HPA configuration password required for unlock calls.
1532 Be quiet, do not print any status messages.
1533 This option will not disable the questions.
1534 To disable questions, use the
1537 .It Fl s Ar max_sectors
1539 Configures the maximum user accessible sectors of the device.
1540 This will change the number of sectors the device reports.
1542 .Em WARNING! WARNING! WARNING!
1544 Changing the max sectors of a device using this option will make the data on
1545 the device beyond the specified value inaccessible.
1548 .Fl s Ar max_sectors
1549 call can be made without a power-on reset or a hardware reset of the device.
1552 Unlock the HPA configuration of the specified device using the given password.
1553 If the password specified does not match the password configured via
1555 the command will fail.
1557 After 5 failed unlock calls, due to password miss-match, the device will refuse
1558 additional unlock calls until after a power-on reset.
1561 Confirm yes to dangerous options such as
1563 without prompting for confirmation
1566 The password for all HPA commands is limited to 32 characters, longer passwords
1569 Program firmware of the named
1571 or ATA device using the image file provided.
1575 device and it provides a recommended timeout for the WRITE BUFFER command
1578 opcodes subcommand), that timeout will be used for the firmware download.
1579 The drive-recommended timeout value may be overridden on the command line
1584 Current list of supported vendors for SCSI/SAS drives:
1587 Tested with 4TB SAS drives, model number HUS724040ALS640.
1591 Tested with LTO-5 (ULTRIUM-HH5) and LTO-6 (ULTRIUM-HH6) tape drives.
1592 There is a separate table entry for hard drives, because the update method
1593 for hard drives is different than the method for tape drives.
1598 Tested with SM1625 SSDs.
1600 Tested with Constellation ES (ST32000444SS), ES.2 (ST33000651SS) and
1601 ES.3 (ST1000NM0023) drives.
1603 Tested with 400GB Optimus SSDs (TXA2D20400GA6001).
1606 .Em WARNING! WARNING! WARNING!
1608 Little testing has been done to make sure that different device models from
1609 each vendor work correctly with the fwdownload command.
1610 A vendor name appearing in the supported list means only that firmware of at
1611 least one device type from that vendor has successfully been programmed with
1612 the fwdownload command.
1613 Extra caution should be taken when using this command since there is no
1614 guarantee it will not break a device from the listed vendors.
1615 Ensure that you have a recent backup of the data on the device before
1616 performing a firmware update.
1620 protocol devices will not be programmed, since there is little chance of
1621 the firmware download succeeding.
1624 will currently attempt a firmware download to any
1628 device, since the standard
1630 DOWNLOAD MICROCODE command may work.
1631 Firmware downloads to
1635 devices are supported for devices connected
1640 controllers, and devices connected to SAS controllers
1645 translation capability.
1651 PASS-THROUGH command to send the
1653 DOWNLOAD MICROCODE command to the drive.
1658 translation implementations don't work fully when translating
1660 WRITE BUFFER commands to
1662 DOWNLOAD MICROCODE commands, but do support
1664 passthrough well enough to do a firmware download.
1666 .It Fl f Ar fw_image
1667 Path to the firmware image file to be downloaded to the specified device.
1669 Do not print informational messages, only print errors.
1670 This option should be used with the
1672 option to suppress all output.
1674 Run in simulation mode.
1675 Device checks are run and the confirmation dialog is shown, but no firmware
1676 download will occur.
1682 errors in the event of a failure.
1684 In simulation mode, print out the
1689 register values that would be used for the firmware download command.
1691 Do not ask for confirmation.
1694 Persistent reservation support.
1695 Persistent reservations are a way to reserve a particular
1697 LUN for use by one or more
1702 option is specified,
1706 PERSISTENT RESERVE IN
1707 command using the requested service action.
1710 option is specified,
1714 PERSISTENT RESERVE OUT
1715 command using the requested service action.
1716 One of those two options is required.
1718 Persistent reservations are complex, and fully explaining them is outside
1719 the scope of this manual.
1722 and download the latest SPC spec for a full explanation of persistent
1726 Specify the service action for the PERSISTENT RESERVE IN command.
1727 Supported service actions:
1730 Report the current persistent reservation generation (PRgeneration) and any
1732 .It read_reservation
1733 Report the persistent reservation, if any.
1734 .It report_capabilities
1735 Report the persistent reservation capabilities of the LUN.
1736 .It read_full_status
1737 Report the full status of persistent reservations on the LUN.
1740 Specify the service action for the PERSISTENT RESERVE OUT command.
1741 For service actions like register that are components of other service
1742 action names, the entire name must be specified.
1743 Otherwise, enough of the service action name must be specified to
1744 distinguish it from other possible service actions.
1745 Supported service actions:
1748 Register a reservation key with the LUN or unregister a reservation key.
1749 To register a key, specify the requested key as the Service Action
1751 To unregister a key, specify the previously registered key as the
1753 To change a key, specify the old key as the Reservation Key and the new
1754 key as the Service Action Reservation Key.
1756 This is similar to the register subcommand, except that the Reservation Key
1758 The Service Action Reservation Key will overwrite any previous key
1759 registered for the initiator.
1761 Create a reservation.
1762 A key must be registered with the LUN before the LUN can be reserved, and
1763 it must be specified as the Reservation Key.
1764 The type of reservation must also be specified.
1765 The scope defaults to LUN scope (LU_SCOPE), but may be changed.
1767 Release a reservation.
1768 The Reservation Key must be specified.
1770 Release a reservation and remove all keys from the device.
1771 The Reservation Key must be specified.
1773 Remove a reservation belonging to another initiator.
1774 The Reservation Key must be specified.
1775 The Service Action Reservation Key may be specified, depending on the
1776 operation being performed.
1778 Remove a reservation belonging to another initiator and abort all
1779 outstanding commands from that initiator.
1780 The Reservation Key must be specified.
1781 The Service Action Reservation Key may be specified, depending on the
1782 operation being performed.
1784 Register another initiator with the LUN, and establish a reservation on the
1785 LUN for that initiator.
1786 The Reservation Key and Service Action Reservation Key must be specified.
1788 Replace Lost Reservation information.
1791 Set the All Target Ports (ALL_TG_PT) bit.
1792 This requests that the key registration be applied to all target ports and
1793 not just the particular target port that receives the command.
1794 This only applies to the register and register_ignore actions.
1796 Specify a Transport ID.
1797 This only applies to the Register and Register and Move service actions for
1798 Persistent Reserve Out.
1799 Multiple Transport IDs may be specified with multiple
1802 With the Register service action, specifying one or more Transport IDs
1803 implicitly enables the
1805 option which turns on the SPEC_I_PT bit.
1806 Transport IDs generally have the format protocol,id.
1809 A SAS Transport ID consists of
1811 followed by a 64-bit SAS address.
1814 .Dl sas,0x1234567812345678
1816 A Fibre Channel Transport ID consists of
1818 followed by a 64-bit Fibre Channel World Wide Name.
1821 .Dl fcp,0x1234567812345678
1823 A Parallel SCSI address consists of
1825 followed by a SCSI target ID and a relative target port identifier.
1830 An IEEE 1394 (Firewire) Transport ID consists of
1832 followed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
1835 .Dl sbp,0x1234567812345678
1837 A SCSI over RDMA Transport ID consists of
1839 followed by a 128-bit RDMA initiator port identifier.
1840 The port identifier must be exactly 32 or 34 (if the leading 0x is
1841 included) hexadecimal digits.
1842 Only hexadecimal (base 16) numbers are supported.
1845 .Dl srp,0x12345678123456781234567812345678
1847 An iSCSI Transport ID consists an iSCSI name and optionally a separator and
1849 For example, if only the iSCSI name is specified:
1851 .Dl iqn.2012-06.com.example:target0
1853 If the iSCSI separator and initiator session ID are specified:
1855 .Dl iqn.2012-06.com.example:target0,i,0x123
1857 A SCSI over PCIe Transport ID consists of
1859 followed by a PCIe Routing ID.
1860 The Routing ID consists of a bus, device and function or in the alternate
1861 form, a bus and function.
1862 The bus must be in the range of 0 to 255 inclusive and the device must be
1863 in the range of 0 to 31 inclusive.
1864 The function must be in the range of 0 to 7 inclusive if the standard form
1865 is used, and in the range of 0 to 255 inclusive if the alternate form is
1867 For example, if a bus, device and function are specified for the standard
1872 If the alternate Routing ID form is used:
1877 Specify the Reservation Key.
1878 This may be in decimal, octal or hexadecimal format.
1879 The value is zero by default if not otherwise specified.
1880 The value must be between 0 and 2^64 - 1, inclusive.
1882 Specify the Service Action Reservation Key.
1883 This may be in decimal, octal or hexadecimal format.
1884 The value is zero by default if not otherwise specified.
1885 The value must be between 0 and 2^64 - 1, inclusive.
1887 Enable the Activate Persist Through Power Loss bit.
1888 This is only used for the register and register_ignore actions.
1889 This requests that the reservation persist across power loss events.
1891 Specify the scope of the reservation.
1892 The scope may be specified by name or by number.
1893 The scope is ignored for register, register_ignore and clear.
1894 If the desired scope isn't available by name, you may specify the number.
1898 This encompasses the entire LUN.
1900 Extent scope (0x01).
1902 Element scope (0x02).
1905 Specify the Relative Target Port.
1906 This only applies to the Register and Move service action of the Persistent
1907 Reserve Out command.
1909 Enable the SPEC_I_PT bit.
1910 This only applies to the Register service action of Persistent Reserve Out.
1911 You must also specify at least one Transport ID with
1913 if this option is set.
1914 If you specify a Transport ID, this option is automatically set.
1915 It is an error to specify this option for any service action other than
1918 Specify the reservation type.
1919 The reservation type may be specified by name or by number.
1920 If the desired reservation type isn't available by name, you may specify
1922 Supported reservation type names:
1927 Write Exclusive mode.
1928 May also be specified as
1929 .Dq write_exclusive .
1931 Read Exclusive mode.
1932 May also be specified as
1933 .Dq read_exclusive .
1935 Exclusive access mode.
1936 May also be specified as
1937 .Dq exclusive_access .
1939 Write Exclusive Registrants Only mode.
1940 May also be specified as
1941 .Dq write_exclusive_reg_only .
1943 Exclusive Access Registrants Only mode.
1944 May also be specified as
1945 .Dq exclusive_access_reg_only .
1947 Write Exclusive All Registrants mode.
1948 May also be specified as
1949 .Dq write_exclusive_all_regs .
1951 Exclusive Access All Registrants mode.
1952 May also be specified as
1953 .Dq exclusive_access_all_regs .
1956 Specify that the target should unregister the initiator that sent
1957 the Register and Move request.
1958 By default, the target will not unregister the initiator that sends the
1959 Register and Move request.
1960 This option only applies to the Register and Move service action of the
1961 Persistent Reserve Out command.
1966 READ or WRITE ATTRIBUTE commands.
1967 These commands are used to read and write attributes in Medium Auxiliary
1969 The most common place Medium Auxiliary Memory is found is small flash chips
1970 included tape cartriges.
1978 option must be specified.
1981 Specify the READ ATTRIBUTE service action.
1984 Issue the ATTRIBUTE VALUES service action.
1985 Read and decode the available attributes and their values.
1987 Issue the ATTRIBUTE LIST service action.
1988 List the attributes that are available to read and write.
1990 Issue the LOGICAL VOLUME LIST service action.
1991 List the available logical volumes in the MAM.
1993 Issue the PARTITION LIST service action.
1994 List the available partitions in the MAM.
1996 Issue the SUPPORTED ATTRIBUTES service action.
1997 List attributes that are supported for reading or writing.
1998 These attributes may or may not be currently present in the MAM.
2001 Specify an attribute to write to the MAM.
2002 This option is not yet implemented.
2004 Specify the attribute number to display.
2005 This option only works with the attr_values, attr_list and supp_attr
2009 Display cached attributes.
2010 If the device supports this flag, it allows displaying attributes for the
2011 last piece of media loaded in the drive.
2013 Specify the element address.
2014 This is used for specifying which element number in a medium changer to
2015 access when reading attributes.
2016 The element number could be for a picker, portal, slot or drive.
2017 .It Fl F Ar form1,form2
2018 Specify the output format for the attribute values (attr_val) display as a
2019 comma separated list of options.
2020 The default output is currently set to field_all,nonascii_trim,text_raw.
2021 Once this code is ported to FreeBSD 10, any text fields will be converted
2022 from their codeset to the user's native codeset with
2025 The text options are mutually exclusive; if you specify more than one, you
2026 will get unpredictable results.
2027 The nonascii options are also mutually exclusive.
2028 Most of the field options may be logically ORed together.
2031 Print text fields with non-ASCII characters escaped.
2033 Print text fields natively, with no codeset conversion.
2035 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2036 escape the non-ASCII characters.
2038 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2039 omit the non-ASCII characters.
2041 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2042 print them as they are.
2044 Print all of the prefix fields: description, attribute number, attribute
2045 size, and the attribute's readonly status.
2046 If field_all is specified, specifying any other field options will not have
2049 Print none of the prefix fields, and only print out the attribute value.
2050 If field_none is specified, specifying any other field options will result
2051 in those fields being printed.
2053 Print out the attribute description.
2055 Print out the attribute number.
2057 Print out the attribute size.
2059 Print out the attribute's readonly status.
2062 Specify the partition.
2063 When the media has multiple partitions, specifying different partition
2064 numbers allows seeing the values for each individual partition.
2065 .It Fl s Ar start_num
2066 Specify the starting attribute number.
2067 This requests that the target device return attribute information starting
2068 at the given number.
2069 .It Fl T Ar elem_type
2070 Specify the element type.
2071 For medium changer devices, this allows specifying the type the element
2072 referenced in the element address (
2082 Specify the number of the logical volume to operate on.
2083 If the media has multiple logical volumes, this will allow displaying
2084 or writing attributes on the given logical volume.
2087 Issue the REPORT SUPPORTED OPCODES service action of the
2091 Without arguments, this command will return a list of all
2093 commands supported by the device, including service actions of commands
2094 that support service actions.
2095 It will also include the
2097 CDB (Command Data Block) length for each command, and the description of
2098 each command if it is known.
2101 Request information on a specific opcode instead of the list of supported
2103 If supported, the target will return a CDB-like structure that indicates
2104 the opcode, service action (if any), and a mask of bits that are supported
2106 .It Fl s Ar service_action
2107 For commands that support a service action, specify the service action to
2110 If a service action is specified for a given opcode, and the device does
2111 not support the given service action, the device should not return a
2113 error, but rather indicate in the returned parameter data that the command
2115 By default, if a service action is specified for an opcode, and service
2116 actions are not supported for the opcode in question, the device will
2119 Include timeout values.
2120 This option works with the default display, which includes all commands
2121 supported by the device, and with the
2125 options, which request information on a specific command and service
2127 This requests that the device report Nominal and Recommended timeout values
2128 for the given command or commands.
2129 The timeout values are in seconds.
2130 The timeout descriptor also includes a command-specific
2137 Zoned Block devices.
2138 This allows managing devices that conform to the
2140 Zoned Block Commands (ZBC) and
2142 Zoned ATA Command Set (ZAC)
2144 Devices using these command sets are usually hard drives using Shingled
2145 Magnetic Recording (SMR).
2146 There are three types of SMR drives:
2149 Drive Managed drives look and act just like a standard random access block
2150 device, but underneath, the drive reads and writes the bulk of its capacity
2152 Sequential writes will yield better performance, but writing sequentially
2155 Host Aware drives expose the underlying zone layout via
2159 commands and allow the host to manage the zone conditions.
2160 The host is not required to manage the zones on the drive, though.
2161 Sequential writes will yield better performance in Sequential Write
2162 Preferred zones, but the host can write randomly in those zones.
2164 Host Managed drives expose the underlying zone layout via
2169 The host is required to access the zones according to the rules described
2171 Any commands that violate the rules will be returned with an error.
2174 SMR drives are divided into zones (typically in the range of 256MB each)
2175 that fall into three general categories:
2178 These are also known as Non Write Pointer zones.
2179 These zones can be randomly written without an unexpected performance penalty.
2180 .It Sequential Preferred
2181 These zones should be written sequentially starting at the write pointer
2183 They may be written randomly.
2184 Writes that do not conform to the zone layout may be significantly slower
2186 .It Sequential Required
2187 These zones must be written sequentially.
2188 If they are not written sequentially, starting at the write pointer, the
2194 Specify the zone subcommand:
2197 Issue the Report Zones command.
2198 All zones are returned by default.
2199 Specify report options with
2201 and printing options with
2203 Specify the starting LBA with
2207 is also accepted as a command argument.
2209 Explicitly open the zone specified by the starting LBA.
2211 Close the zone specified by starting LBA.
2213 Finish the zone specified by the starting LBA.
2215 Reset the write pointer for the zone specified by the starting LBA.
2218 For the Open, Close, Finish, and Reset Write Pointer operations, apply the
2219 operation to all zones on the drive.
2221 Specify the starting LBA.
2222 For the Report Zones command, this tells the drive to report starting with
2223 the zone that starts at the given LBA.
2224 For the other commands, this allows the user to identify the zone requested
2225 by its starting LBA.
2226 The LBA may be specified in decimal, hexadecimal or octal notation.
2228 For the Report Zones command, specify a subset of zones to report.
2232 This is the default.
2234 Report only empty zones.
2236 Report zones that are implicitly open.
2237 This means that the host has sent a write to the zone without explicitly
2240 Report zones that are explicitly open.
2242 Report zones that have been closed by the host.
2244 Report zones that are full.
2246 Report zones that are in the read only state.
2249 is also accepted as an argument.
2251 Report zones that are in the offline state.
2253 Report zones where the device recommends resetting write pointers.
2255 Report zones that have the Non Sequential Resources Active flag set.
2256 These are zones that are Sequential Write Preferred, but have been written
2259 Report Non Write Pointer zones, also known as Conventional zones.
2261 .It Fl P Ar print_opt
2262 Specify a printing option for Report Zones:
2265 Normal Report Zones output.
2266 This is the default.
2267 The summary and column headings are printed, fields are separated by spaces
2268 and the fields themselves may contain spaces.
2270 Just print the summary: the number of zones, the maximum LBA (LBA of the
2271 last logical block on the drive), and the value of the
2276 field describes whether the zones on the drive are all identical, all
2277 different, or whether they are the same except for the last zone, etc.
2279 Print the zones in a script friendly format.
2280 The summary and column headings are omitted, the fields are separated by
2281 commas, and the fields do not contain spaces.
2282 The fields contain underscores where spaces would normally be used.
2288 Extended Power Conditions (EPC) feature set commands.
2291 protocol drives, and will not work on
2300 translation layer (SAT).
2301 It may be helpful to read the ATA Command Set - 4 (ACS-4) description of
2302 the Extended Power Conditions feature set, available at t13.org, to
2303 understand the details of this particular
2308 Specify the epc subcommand
2311 Restore drive power condition settings.
2314 Specify the source for the restored power settings, either
2318 This argument is required.
2321 This only makes sense to specify when restoring from defaults.
2324 Go to the specified power condition.
2327 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2328 This argument is required.
2330 Specify delayed entry to the power condition.
2331 The drive, if it supports this, can enter the power condition after the
2334 Hold the power condition.
2335 If the drive supports this option, it will hold the power condition and
2336 reject all commands that would normally cause it to exit that power
2340 Set the timer value for a power condition and enable or disable the
2344 display described below to see what the current timer settings are for each
2345 Idle and Standby mode supported by the drive.
2348 Enable the power condition.
2355 Disable the power condition.
2362 Specify the timer in seconds.
2363 The user may specify a timer as a floating point number with a maximum
2364 supported resolution of tenths of a second.
2365 Drives may or may not support sub-second timer values.
2367 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2368 This argument is required.
2370 Save the timer and power condition enable/disable state.
2371 By default, if this option is not specified, only the current values for
2372 this power condition will be affected.
2375 Enable or disable a particular power condition.
2378 Enable the power condition.
2385 Disable the power condition.
2392 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2393 This argument is required.
2395 Save the power condition enable/disable state.
2396 By default, if this option is not specified, only the current values for
2397 this power condition will be affected.
2400 Enable the Extended Power Condition (EPC) feature set.
2402 Disable the Extended Power Condition (EPC) feature set.
2404 Specify the EPC power source.
2407 Specify the power source, either
2413 Get the current status of several parameters related to the Extended Power
2414 Condition (EPC) feature set, including whether APM and EPC are supported
2415 and enabled, whether Low Power Standby is supported, whether setting the
2416 EPC power source is supported, whether Low Power Standby is supported and
2417 the current power condition.
2420 Only report the current power condition.
2421 Some drives will exit their current power condition if a command other than
2424 CHECK POWER MODE command is received.
2425 If this flag is specified,
2429 CHECK POWER MODE command to the drive.
2434 Power Conditions log (Log Address 0x08).
2435 This shows the list of Idle and Standby power conditions the drive
2436 supports, and a number of parameters about each condition, including
2437 whether it is enabled and what the timer value is.
2441 Issue REPORT TIMESTAMP or SET TIMESTAMP
2443 commands. Either the
2447 option must be specified.
2450 Report the device's timestamp.
2451 If no more arguments are specified, the timestamp will be reported using
2452 the national representation of the date and time, followed by the time
2456 Specify the strftime format string, as documented in strftime(3), to be used
2457 to format the reported timestamp.
2459 Report the timestamp as milliseconds since the epoch.
2461 Report the timestamp using the national representation of the date and
2462 time, but override the system time zone and use UTC instead.
2467 Set the device's timestamp. Either the
2473 option must be specified.
2476 Specify the strptime format string, as documented in strptime(3).
2477 The time must also be specified with the
2481 Provide the time in the format specified with the
2485 Set the timestamp to the host system's time in UTC.
2489 Print out verbose usage information.
2494 variable allows the user to specify an alternate mode page format file.
2498 variable determines which text editor
2500 starts when editing mode pages.
2502 .Bl -tag -width /usr/share/misc/scsi_modes -compact
2503 .It Pa /usr/share/misc/scsi_modes
2504 is the SCSI mode format database.
2506 is the transport layer device.
2508 are the CAM application passthrough devices.
2511 .Dl camcontrol eject -n cd -u 1 -v
2513 Eject the CD from cd1, and print SCSI sense information if the command
2516 .Dl camcontrol tur da0
2518 Send the SCSI test unit ready command to da0.
2521 utility will report whether the disk is ready, but will not display sense
2522 information if the command fails since the
2524 switch was not specified.
2525 .Bd -literal -offset indent
2526 camcontrol tur da1 -E -C 4 -t 50 -v
2529 Send a test unit ready command to da1.
2530 Enable kernel error recovery.
2531 Specify a retry count of 4, and a timeout of 50 seconds.
2535 flag) if the command fails.
2536 Since error recovery is turned on, the
2537 disk will be spun up if it is not currently spinning.
2540 utility will report whether the disk is ready.
2541 .Bd -literal -offset indent
2542 camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
2543 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
2546 Issue a READ BUFFER command (0x3C) to cd1.
2547 Display the buffer size of cd1,
2548 and display the first 10 bytes from the cache on cd1.
2550 information if the command fails.
2551 .Bd -literal -offset indent
2552 camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
2553 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
2556 Issue a WRITE BUFFER (0x3B) command to cd1.
2557 Write out 10 bytes of data,
2558 not including the (reserved) 4 byte header.
2559 Print out sense information if
2561 Be very careful with this command, improper use may
2562 cause data corruption.
2563 .Bd -literal -offset indent
2564 camcontrol modepage da3 -m 1 -e -P 3
2567 Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
2568 settings on the drive.
2569 Mode page 1 contains a disk drive's auto read and
2570 write reallocation settings, among other things.
2572 .Dl camcontrol rescan all
2574 Rescan all SCSI buses in the system for devices that have been added,
2577 .Dl camcontrol rescan 0
2579 Rescan SCSI bus 0 for devices that have been added, removed or changed.
2581 .Dl camcontrol rescan 0:1:0
2583 Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
2586 .Dl camcontrol tags da5 -N 24
2588 Set the number of concurrent transactions for da5 to 24.
2589 .Bd -literal -offset indent
2590 camcontrol negotiate -n da -u 4 -T disable
2593 Disable tagged queueing for da4.
2594 .Bd -literal -offset indent
2595 camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
2598 Negotiate a sync rate of 20MHz and an offset of 15 with da3.
2600 Test Unit Ready command to make the settings take effect.
2601 .Bd -literal -offset indent
2602 camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
2605 Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs
2607 Display SMP errors if the command fails.
2608 .Bd -literal -offset indent
2609 camcontrol security ada0
2612 Report security support and settings for ada0
2613 .Bd -literal -offset indent
2614 camcontrol security ada0 -U user -s MyPass
2617 Enable security on device ada0 with the password MyPass
2618 .Bd -literal -offset indent
2619 camcontrol security ada0 -U user -e MyPass
2622 Secure erase ada0 which has had security enabled with user password MyPass
2624 .Em WARNING! WARNING! WARNING!
2628 data from the device, so backup your data before using!
2630 This command can be used against an SSD drive to restoring it to
2631 factory default write performance.
2632 .Bd -literal -offset indent
2636 Report HPA support and settings for ada0 (also reported via
2638 .Bd -literal -offset indent
2639 camcontrol hpa ada0 -s 10240
2642 Enables HPA on ada0 setting the maximum reported sectors to 10240.
2644 .Em WARNING! WARNING! WARNING!
2648 to all data on the device beyond this limit until HPA is disabled by setting
2649 HPA to native max sectors of the device, which can only be done after a
2650 power-on or hardware reset!
2653 use this on a device which has an active filesystem!
2654 .Bd -literal -offset indent
2655 camcontrol persist da0 -v -i read_keys
2658 This will read any persistent reservation keys registered with da0, and
2659 display any errors encountered when sending the PERSISTENT RESERVE IN
2662 .Bd -literal -offset indent
2663 camcontrol persist da0 -v -o register -a -K 0x12345678
2666 This will register the persistent reservation key 0x12345678 with da0,
2667 apply that registration to all ports on da0, and display any errors that
2668 occur when sending the PERSISTENT RESERVE OUT command.
2669 .Bd -literal -offset indent
2670 camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
2673 This will reserve da0 for the exlusive use of the initiator issuing the
2675 The scope of the reservation is the entire LUN.
2676 Any errors sending the PERSISTENT RESERVE OUT command will be displayed.
2677 .Bd -literal -offset indent
2678 camcontrol persist da0 -v -i read_full
2681 This will display the full status of all reservations on da0 and print out
2682 status if there are any errors.
2683 .Bd -literal -offset indent
2684 camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
2687 This will release a reservation on da0 of the type ex_ac
2689 The Reservation Key for this registration is 0x12345678.
2690 Any errors that occur will be displayed.
2691 .Bd -literal -offset indent
2692 camcontrol persist da0 -v -o register -K 0x12345678 -S \e
2693 -I sas,0x1234567812345678 -I sas,0x8765432187654321
2696 This will register the key 0x12345678 with da0, specifying that it applies
2697 to the SAS initiators with SAS addresses 0x1234567812345678 and
2699 .Bd -literal -offset indent
2700 camcontrol persist da0 -v -o register_move -k 0x87654321 \e
2701 -K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
2704 This will move the registration from the current initiator, whose
2705 Registration Key is 0x87654321, to the Fibre Channel initiator with the
2706 Fiber Channel World Wide Node Name 0x1234567812345678.
2707 A new registration key, 0x12345678, will be registered for the initiator
2708 with the Fibre Channel World Wide Node Name 0x1234567812345678, and the
2709 current initiator will be unregistered from the target.
2710 The reservation will be moved to relative target port 2 on the target
2712 The registration will persist across power losses.
2713 .Bd -literal -offset indent
2714 camcontrol attrib sa0 -v -i attr_values -p 1
2717 This will read and decode the attribute values from partition 1 on the tape
2718 in tape drive sa0, and will display any
2722 .Bd -literal -offset indent
2723 camcontrol zone da0 -v -c rz -P summary
2726 This will request the SMR zone list from disk da0, and print out a
2727 summary of the zone parameters, and display any
2733 .Bd -literal -offset indent
2734 camcontrol zone da0 -v -c rz -o reset
2737 This will request the list of SMR zones that should have their write
2738 pointer reset from the disk da0, and display any
2744 .Bd -literal -offset indent
2745 camcontrol zone da0 -v -c rwp -l 0x2c80000
2748 This will issue the Reset Write Pointer command to disk da0 for the zone
2749 that starts at LBA 0x2c80000 and display any
2755 .Bd -literal -offset indent
2756 camcontrol epc ada0 -c timer -T 60.1 -p Idle_a -e -s
2759 Set the timer for the Idle_a power condition on drive
2761 to 60.1 seconds, enable that particular power condition, and save the timer
2762 value and the enabled state of the power condition.
2764 .Bd -literal -offset indent
2765 camcontrol epc da4 -c goto -p Standby_z -H
2770 to go to the Standby_z power state (which is
2771 the drive's lowest power state) and hold in that state until it is
2772 explicitly released by another
2776 .Bd -literal -offset indent
2777 camcontrol epc da2 -c status -P
2780 Report only the power state of
2783 Some drives will power up in response to the commands sent by the
2791 CHECK POWER MODE command, which should not trigger a change in the drive's
2794 .Bd -literal -offset indent
2795 camcontrol epc ada0 -c list
2798 Display the ATA Power Conditions log (Log Address 0x08) for
2802 .Bd -literal -offset indent
2803 camcontrol timestamp sa0 -s -f "%A %c" \e
2804 -T "Wednesday Wed Oct 26 21:43:57 2016"
2807 Set the timestamp of drive
2811 format string followed by a time string
2812 that was created using this format string.
2815 .Xr cam_cdbparse 3 ,
2822 utility first appeared in
2825 The mode page editing code and arbitrary SCSI command code are based upon
2830 library, written by Julian Elischer and Peter Dufault.
2833 program first appeared in
2835 and first appeared in
2840 .An Kenneth Merry Aq Mt ken@FreeBSD.org
2842 The code that parses the generic command line arguments does not know that
2843 some of the subcommands take multiple arguments.
2844 So if, for instance, you
2845 tried something like this:
2846 .Bd -literal -offset indent
2847 camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
2850 The sense information from the test unit ready command would not get
2851 printed out, since the first
2855 bails out when it sees the second argument to
2859 Fixing this behavior would take some gross code, or changes to the
2862 The best way to circumvent this problem is to always make sure
2865 arguments before any command-specific arguments.