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
33 .Nd CAM control program
48 .Op Fl u Ar unit_number
71 .Op Fl r Ar reporttype
104 .Aq all | device id | bus Ns Op :target:lun
107 .Aq all | device id | bus Ns Op :target:lun
124 .Aq Fl m Ar page[,subpage] | Fl l
134 .Aq Fl a Ar cmd Op args
135 .Aq Fl c Ar cmd Op args
138 .Op Fl i Ar len Ar fmt
140 .Op Fl o Ar len Ar fmt Op args
147 .Aq Fl r Ar len Ar fmt Op args
148 .Aq Fl R Ar len Ar fmt Op args
160 .Op Fl o Ar operation
164 .Op Fl T Ar pp_timeout
165 .Op Fl a Ar enable|disable
166 .Op Fl A Ar enable|disable
167 .Op Fl s Ar enable|disable
168 .Op Fl S Ar enable|disable
189 .Aq all | off | device id | bus Ns Op :target Ns Op :lun
202 .Op Fl D Ar enable|disable
207 .Op Fl T Ar enable|disable
209 .Op Fl W Ar bus_width
223 .Aq Fl a Ar overwrite | block | crypto | exitfailure
277 .Op Fl l Ar high|maximum
281 .Op Fl U Ar user|master
292 .Op Fl s Ar max_sectors
301 .Op Fl s Ar max_sectors
306 .Aq Fl i Ar action | Fl o Ar action
312 .Op Fl R Ar rel_tgt_port
321 .Aq Fl r Ar action | Fl w Ar attrib
324 .Op Fl e Ar elem_addr
325 .Op Fl F Ar form1,form2
327 .Op Fl s Ar start_addr
328 .Op Fl T Ar elem_type
335 .Op Fl s Ar service_action
344 .Op Fl P Ar print_opts
352 .Op Fl p Ar power_cond
354 .Op Fl r Ar restore_src
356 .Op Fl S Ar power_src
362 .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
370 .Ao Fl l | Fl d | Fl r Ac
378 utility allows users to access and control the
380 CAM subsystem described in
386 can cause a loss of data and/or system crashes if used improperly.
388 expert users are encouraged to exercise caution when using this command.
389 Novice users should stay away from this utility.
393 utility has a number of primary functions, many of which support an optional
395 A device identifier can take one of three forms:
398 Specify a device name and unit number combination, like "da5" or "cd3".
400 Specify a bus number and target id.
401 The bus number can be determined from
403 .Dq camcontrol devlist .
404 The lun defaults to 0.
406 Specify the bus, target and lun for a device.
410 The device identifier, if it is specified,
412 come immediately after the function name, and before any generic or
413 function-specific arguments.
418 arguments described below will override any device name or unit number
419 specified beforehand.
426 override a specified bus:target or bus:target:lun, however.
430 primary functions support these generic arguments:
433 SCSI command retry count.
434 In order for this to work, error recovery
438 Instruct the kernel to perform generic SCSI error recovery for the given
440 This is needed in order for the retry count
443 Other than retrying commands, the generic error recovery in
444 the code will generally attempt to spin up drives that are not spinning.
445 It may take some other actions, depending upon the sense code returned from
448 Specify the device type to operate on, e.g.\& "da", "cd".
449 .It Fl Q Ar task_attr
451 task attribute for the command, if it is a
454 This may be ordered, simple, head, or aca.
455 In most cases this is not needed.
456 The default is simple, which works with all
459 The task attribute may also be specified numerically.
461 SCSI command timeout in seconds.
462 This overrides the default timeout for
464 .It Fl u Ar unit_number
465 Specify the device unit number, e.g.\& "1", "5".
467 Be verbose, print out sense information for failed SCSI commands.
470 Primary command functions:
471 .Bl -tag -width periphlist
473 List all physical devices (logical units) attached to the CAM subsystem.
474 This also includes a list of peripheral drivers attached to each device.
477 argument, SCSI bus number, adapter name and unit numbers are printed as
479 On the other hand, with the
481 argument, only the bus adapter, and unit information will be printed, and
482 device information will be omitted.
484 List all peripheral drivers attached to a given physical device (logical
487 Send the SCSI test unit ready (0x00) command to the given device.
490 utility will report whether the device is ready or not.
492 Send a SCSI inquiry command (0x12) to a device.
495 will print out the standard inquiry data, device serial number, and
496 transfer rate information.
497 The user can specify that only certain types of
498 inquiry data be printed:
501 Get the standard inquiry data.
503 Print out the serial number.
504 If this flag is the only one specified,
506 will not print out "Serial Number" before the value returned by the drive.
507 This is to aid in script writing.
509 Print out transfer rate information.
512 Send a ATA identify command (0xec) to a device.
514 Send the SCSI REPORT LUNS (0xA0) command to the given device.
517 will print out the list of logical units (LUNs) supported by the target device.
518 There are a couple of options to modify the output:
521 Just print out a count of LUNs, not the actual LUN numbers.
523 Just print out the LUNs, and do not print out the count.
524 .It Fl r Ar reporttype
525 Specify the type of report to request from the target:
526 .Bl -tag -width 012345678
528 Return the default report.
532 Most targets will support this report if they support the REPORT LUNS
535 Return only well known LUNs.
537 Return all available LUNs.
542 will try to print out LUN numbers in a reasonable format.
543 It can understand the peripheral, flat, LUN and extended LUN formats.
545 Send the SCSI READ CAPACITY command to the given device and display
547 If the device is larger than 2TB, the SCSI READ CAPACITY (16) service
548 action will be sent to obtain the full size of the device.
551 will print out the last logical block of the device, and the blocksize of
553 To modify the output format, use the following options:
556 Just print out the blocksize, not the last block or device size.
557 This cannot be used with
562 Print out the device size in human readable (base 2, 1K == 1024) format.
565 and cannot be used with
570 Print out the device size in human readable (base 10, 1K == 1000) format.
572 Skip sending the SCSI READ CAPACITY (10) command.
573 Send only the SCSI READ CAPACITY (16) service action and report
575 When the two do not match, a quirk is needed to resolve the ambiguity.
577 Print out the number of blocks in the device instead of the last logical
580 Quiet, print out the numbers only (separated by a comma if
586 Print out the last logical block or the size of the device only, and omit
590 Note that this command only displays the information, it does not update
591 the kernel data structures.
594 reprobe subcommand to do that.
596 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
599 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
602 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
603 start bit set and the load/eject bit set.
605 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
606 start bit cleared and the load/eject bit set.
608 Tell the kernel to scan all buses in the system (with the
610 argument), the given bus (XPT_SCAN_BUS), bus:target:lun or device
611 (XPT_SCAN_LUN) for new devices or devices that have gone away.
613 may specify a scan of all buses, a single bus, or a lun.
615 on a target is not supported.
617 If a device is specified by peripheral name and unit number, for instance
618 da4, it may only be rescanned if that device currently exists in the CAM EDT
619 (Existing Device Table).
620 If the device is no longer there (see
623 you must use the bus:target:lun form to rescan it.
625 Tell the kernel to refresh the information about the device and
626 notify the upper layer,
628 This includes sending the SCSI READ CAPACITY command and updating
629 the disk size visible to the rest of the system.
631 Tell the kernel to reset all buses in the system (with the
633 argument), the given bus (XPT_RESET_BUS) by issuing a SCSI bus
634 reset for that bus, or to reset the given bus:target:lun or device
635 (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
636 connecting to that device.
637 Note that this can have a destructive impact
642 READ DEFECT DATA (10) command (0x37) or the
644 READ DEFECT DATA (12) command (0xB7) to the given device, and
645 print out any combination of: the total number of defects, the primary
646 defect list (PLIST), and the grown defect list (GLIST).
649 Specify the requested format of the defect list.
650 The format argument is
652 Most drives support the physical sector format.
654 support the logical block format.
655 Many drives, if they do not support the
656 requested format, return the data in an alternate format, along with sense
657 information indicating that the requested data format is not supported.
661 attempts to detect this, and print out whatever format the drive returns.
662 If the drive uses a non-standard sense code to report that it does not
663 support the requested format,
665 will probably see the error as a failure to complete the request.
667 The format options are:
670 Print out the list as logical blocks.
671 This is limited to 32-bit block sizes, and isn't supported by many modern
674 Print out the list as logical blocks.
675 This option uses a 64-bit block size.
677 Print out the list in bytes from index format.
679 Print out the list in extended bytes from index format.
680 The extended format allows for ranges of blocks to be printed.
682 Print out the list in physical sector format.
683 Most drives support this format.
685 Print out the list in extended physical sector format.
686 The extended format allows for ranges of blocks to be printed.
689 Print out the grown defect list.
690 This is a list of bad blocks that have
691 been remapped since the disk left the factory.
693 Print out the primary defect list.
694 This is the list of defects that were present in the factory.
696 When printing status information with
698 only print the number of defects.
700 Just print the number of defects, not the list of defects.
702 Specify the starting offset into the defect list.
703 This implies using the
705 READ DEFECT DATA (12) command, as the 10 byte version of the command
706 doesn't support the address descriptor index field.
707 Not all drives support the 12 byte command, and some drives that support
708 the 12 byte command don't support the address descriptor index field.
710 Print out defects in hexadecimal (base 16) form instead of base 10 form.
719 will print out the number of defects given in the READ DEFECT DATA header
720 returned from the drive.
721 Some drives will report 0 defects if neither the primary or grown defect
724 Allows the user to display and optionally edit a SCSI mode page.
726 page formats are located in
727 .Pa /usr/share/misc/scsi_modes .
728 This can be overridden by specifying a different file in the
730 environment variable.
733 command takes several arguments:
736 Use 6 byte MODE commands instead of default 10 byte.
737 Old devices may not support 10 byte MODE commands, while new devices may
738 not be able to report all mode pages with 6 byte commands.
741 starts with 10 byte commands and falls back to 6 byte on error.
743 Disable block descriptors for mode sense.
745 Display/edit block descriptors instead of mode page.
747 Use long LBA block descriptors.
748 Allows number of LBAs bigger then 2^^32.
750 Displays mode page data in binary format.
752 This flag allows the user to edit values in the mode page.
754 either edit mode page values with the text editor pointed to by his
756 environment variable, or supply mode page values via standard input, using
759 uses to display mode page values.
760 The editor will be invoked if
762 detects that standard input is terminal.
764 Lists all available mode pages.
765 If specified more then once, also lists subpages.
766 .It Fl m Ar page[,subpage]
767 This specifies the number of the mode page and optionally subpage the user
768 would like to view and/or edit.
769 This argument is mandatory unless
773 This allows the user to specify the page control field.
775 .Bl -tag -width xxx -compact
787 Allows the user to send an arbitrary ATA or SCSI CDB to any device.
790 function requires the
792 argument to specify SCSI CDB or the
794 argument to specify ATA Command Block registers values.
795 Other arguments are optional, depending on
797 The command and data specification syntax is documented
800 NOTE: If the CDB specified causes data to be transferred to or from the
801 SCSI device in question, you MUST specify either
806 .It Fl a Ar cmd Op args
807 This specifies the content of 12 ATA Command Block registers (command,
808 features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
809 lba_high_exp, features_exp, sector_count, sector_count_exp).
810 .It Fl c Ar cmd Op args
811 This specifies the SCSI CDB.
812 SCSI CDBs may be 6, 10, 12 or 16 bytes.
814 Specifies DMA protocol to be used for ATA command.
816 Specifies FPDMA (NCQ) protocol to be used for ATA command.
817 .It Fl i Ar len Ar fmt
818 This specifies the amount of data to read, and how it should be displayed.
822 bytes of data will be read from the device and written to standard output.
823 .It Fl o Ar len Ar fmt Op args
824 This specifies the amount of data to be written to a device, and the data
825 that is to be written.
829 bytes of data will be read from standard input and written to the device.
831 This specifies that 11 result ATA Command Block registers should be displayed
832 (status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
833 lba_high_exp, sector_count, sector_count_exp), and how.
836 11 result registers will be written to standard output in hex.
839 Allows the user to send an arbitrary Serial
840 Management Protocol (SMP) command to a device.
843 function requires the
845 argument to specify the SMP request to be sent, and the
847 argument to specify the format of the SMP response.
848 The syntax for the SMP request and response arguments is documented in
851 Note that SAS adapters that support SMP passthrough (at least the currently
852 known adapters) do not accept CRC bytes from the user in the request and do
853 not pass CRC bytes back to the user in the response.
854 Therefore users should not include the CRC bytes in the length of the
855 request and not expect CRC bytes to be returned in the response.
857 .It Fl r Ar len Ar fmt Op args
858 This specifies the size of the SMP request, without the CRC bytes, and the
863 bytes of data will be read from standard input and written as the SMP
865 .It Fl R Ar len Ar fmt Op args
866 This specifies the size of the buffer allocated for the SMP response, and
867 the SMP response format.
871 bytes of data will be allocated for the response and the response will be
872 written to standard output.
875 Allows the user to send the Serial Management Protocol (SMP) Report General
878 will display the data returned by the Report General command.
879 If the SMP target supports the long response format, the additional data
880 will be requested and displayed automatically.
883 Request the long response format only.
884 Not all SMP targets support the long response format.
887 to skip sending the initial report general request without the long bit set
888 and only issue a report general request with the long bit set.
891 Allows the user to issue the Serial Management Protocol (SMP) PHY Control
893 This function should be used with some caution, as it can render devices
894 inaccessible, and could potentially cause data corruption as well.
897 argument is required to specify the PHY to operate on.
900 Specify the PHY to operate on.
901 This argument is required.
903 Request the long request/response format.
904 Not all SMP targets support the long response format.
905 For the PHY Control command, this currently only affects whether the
906 request length is set to a value other than 0.
907 .It Fl o Ar operation
908 Specify a PHY control operation.
911 operation may be specified.
912 The operation may be specified numerically (in decimal, hexadecimal, or octal)
913 or one of the following operation names may be specified:
917 It is not necessary to specify this argument.
919 Send the LINK RESET command to the phy.
921 Send the HARD RESET command to the phy.
923 Send the DISABLE command to the phy.
924 Note that the LINK RESET or HARD RESET commands should re-enable the phy.
926 Send the CLEAR ERROR LOG command.
927 This clears the error log counters for the specified phy.
929 Send the CLEAR AFFILIATION command.
930 This clears the affiliation from the STP initiator port with the same SAS
931 address as the SMP initiator that requests the clear operation.
933 Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
934 This will cause a SATA port selector to use the given phy as its active phy
935 and make the other phy inactive.
937 Send the CLEAR STP I_T NEXUS LOSS command to the PHY.
939 Send the SET ATTACHED DEVICE NAME command to the PHY.
942 argument to specify the device name.
945 Specify the attached device name.
946 This option is needed with the
949 The name is a 64-bit number, and can be specified in decimal, hexadecimal
952 Set the minimum physical link rate for the phy.
953 This is a numeric argument.
954 Currently known link rates are:
957 Do not change current value.
966 Other values may be specified for newer physical link rates.
968 Set the maximum physical link rate for the phy.
969 This is a numeric argument.
972 argument description for known link rate arguments.
973 .It Fl T Ar pp_timeout
974 Set the partial pathway timeout value, in microseconds.
979 specification for more information on this field.
980 .It Fl a Ar enable|disable
981 Enable or disable SATA slumber phy power conditions.
982 .It Fl A Ar enable|disable
983 Enable or disable SATA partial power conditions.
984 .It Fl s Ar enable|disable
985 Enable or disable SAS slumber phy power conditions.
986 .It Fl S Ar enable|disable
987 Enable or disable SAS partial phy power conditions.
990 List phys attached to a SAS expander, the address of the end device
991 attached to the phy, and the inquiry data for that device and peripheral
992 devices attached to that device.
993 The inquiry data and peripheral devices are displayed if available.
996 Turn on the long response format for the underlying SMP commands used for
999 Only print out phys that are attached to a device in the CAM EDT (Existing
1003 Send the SMP Report Manufacturer Information command to the device and
1004 display the response.
1007 Turn on the long response format for the underlying SMP commands used for
1011 Turn on CAM debugging printfs in the kernel.
1012 This requires options CAMDEBUG
1013 in your kernel config file.
1014 WARNING: enabling debugging printfs currently
1015 causes an EXTREME number of kernel printfs.
1016 You may have difficulty
1017 turning off the debugging printfs once they start, since the kernel will be
1018 busy printing messages and unable to service other requests quickly.
1021 function takes a number of arguments:
1024 Enable CAM_DEBUG_INFO printfs.
1026 Enable CAM_DEBUG_PERIPH printfs.
1028 Enable CAM_DEBUG_TRACE printfs.
1030 Enable CAM_DEBUG_SUBTRACE printfs.
1032 Enable CAM_DEBUG_XPT printfs.
1034 Enable CAM_DEBUG_CDB printfs.
1035 This will cause the kernel to print out the
1036 SCSI CDBs sent to the specified device(s).
1038 Enable CAM_DEBUG_PROBE printfs.
1040 Enable debugging for all devices.
1042 Turn off debugging for all devices
1043 .It bus Ns Op :target Ns Op :lun
1044 Turn on debugging for the given bus, target or lun.
1045 If the lun or target
1046 and lun are not specified, they are wildcarded.
1047 (i.e., just specifying a
1048 bus turns on debugging printfs for all devices on that bus.)
1051 Show or set the number of "tagged openings" or simultaneous transactions
1052 we attempt to queue to a particular device.
1055 command, with no command-specific arguments (i.e., only generic arguments)
1056 prints out the "soft" maximum number of transactions that can be queued to
1057 the device in question.
1058 For more detailed information, use the
1060 argument described below.
1063 Set the number of tags for the given device.
1064 This must be between the
1065 minimum and maximum number set in the kernel quirk table.
1067 most devices that support tagged queueing is a minimum of 2 and a maximum
1069 The minimum and maximum values for a given device may be
1070 determined by using the
1077 subcommand is described below.
1079 Be quiet, and do not report the number of tags.
1080 This is generally used when
1081 setting the number of tags.
1083 The verbose flag has special functionality for the
1088 to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
1091 This is the amount of capacity for transactions queued to a given device.
1093 This is the number of transactions currently queued to a device.
1095 This is the number of CCBs allocated for the device.
1097 The held count is the number of CCBs held by peripheral drivers that have
1098 either just been completed or are about to be released to the transport
1099 layer for service by a device.
1100 Held CCBs reserve capacity on a given
1103 This is the current "hard" minimum number of transactions that can be
1104 queued to a device at once.
1107 value above cannot go below this number.
1108 The default value for
1110 is 2, although it may be set higher or lower for various devices.
1112 This is the "hard" maximum number of transactions that can be queued to a
1116 value cannot go above this number.
1117 The default value for
1119 is 255, although it may be set higher or lower for various devices.
1123 Show or negotiate various communication parameters.
1124 Some controllers may
1125 not support setting or changing some of these values.
1127 Adaptec 174x controllers do not support changing a device's sync rate or
1132 will not attempt to set the parameter if the controller indicates that it
1133 does not support setting the parameter.
1134 To find out what the controller
1142 command is described below.
1143 Also, some controller drivers do not support
1144 setting negotiation parameters, even if the underlying controller supports
1145 negotiation changes.
1146 Some controllers, such as the Advansys wide
1147 controllers, support enabling and disabling synchronous negotiation for
1148 a device, but do not support setting the synchronous negotiation rate.
1151 Attempt to make the negotiation settings take effect immediately by sending
1152 a Test Unit Ready command to the device.
1154 Show or set current negotiation settings.
1155 This is the default.
1156 .It Fl D Ar enable|disable
1157 Enable or disable disconnection.
1161 Set the command delay offset.
1163 Be quiet, do not print anything.
1164 This is generally useful when you want to
1165 set a parameter, but do not want any status information.
1166 .It Fl R Ar syncrate
1167 Change the synchronization rate for a device.
1168 The sync rate is a floating
1169 point value specified in MHz.
1172 is a legal value, as is
1174 .It Fl T Ar enable|disable
1175 Enable or disable tagged queueing for a device.
1177 Show or set user negotiation settings.
1178 The default is to show or set
1179 current negotiation settings.
1181 The verbose switch has special meaning for the
1186 to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
1188 .It Fl W Ar bus_width
1189 Specify the bus width to negotiate with a device.
1192 The only useful values to specify are 8, 16, and 32
1194 The controller must support the bus width in question in order for
1195 the setting to take effect.
1198 In general, sync rate and offset settings will not take effect for a
1199 device until a command has been sent to the device.
1202 switch above will automatically send a Test Unit Ready to the device so
1203 negotiation parameters will take effect.
1207 FORMAT UNIT command to the named device.
1209 .Em WARNING! WARNING! WARNING!
1211 Low level formatting a disk will destroy ALL data on the disk.
1213 extreme caution when issuing this command.
1214 Many users low-level format
1215 disks that do not really need to be low-level formatted.
1217 relatively few scenarios that call for low-level formatting a disk.
1219 low-level formatting a disk is to initialize the disk after changing
1220 its physical sector size.
1221 Another reason for low-level formatting a disk
1222 is to revive the disk if you are getting "medium format corrupted" errors
1223 from the disk in response to read and write requests.
1225 Some disks take longer than others to format.
1226 Users should specify a
1227 timeout long enough to allow the format to complete.
1229 timeout is 3 hours, which should be long enough for most disks.
1231 disks will complete a format operation in a very short period of time
1232 (on the order of 5 minutes or less).
1233 This is often because the drive
1234 does not really support the FORMAT UNIT command -- it just accepts the
1235 command, waits a few minutes and then returns it.
1239 subcommand takes several arguments that modify its default behavior.
1244 arguments can be useful for scripts.
1247 Be quiet, do not print any status messages.
1248 This option will not disable
1249 the questions, however.
1250 To disable questions, use the
1257 This will report status on a format that is already running on the drive.
1259 Issue a non-immediate format command.
1262 issues the FORMAT UNIT command with the immediate bit set.
1264 device to immediately return the format command, before the format has
1270 sense information from the device every second to determine how far along
1271 in the format process it is.
1274 argument is specified,
1276 will issue a non-immediate format command, and will be unable to print any
1277 information to let the user know what percentage of the disk has been
1280 Do not ask any questions.
1283 will ask the user if he/she really wants to format the disk in question,
1284 and also if the default format command timeout is acceptable.
1286 will not be asked about the timeout if a timeout is specified on the
1290 Issue the SANITIZE command to the named device.
1292 .Em WARNING! WARNING! WARNING!
1294 ALL data on the disk will be destroyed or made inaccessible.
1295 Recovery of the data is not possible.
1296 Use extreme caution when issuing this command.
1300 subcommand takes several arguments that modify its default behavior.
1305 arguments can be useful for scripts.
1307 .It Fl a Ar operation
1308 Specify the sanitize operation to perform.
1311 Perform an overwrite operation by writing a user supplied
1312 data pattern to the device one or more times.
1313 The pattern is given by the
1316 The number of times is given by the
1320 Perform a block erase operation.
1321 All the device's blocks are set to a vendor defined
1322 value, typically zero.
1324 Perform a cryptographic erase operation.
1325 The encryption keys are changed to prevent the decryption
1328 Exits a previously failed sanitize operation.
1329 A failed sanitize operation can only be exited if it was
1330 run in the unrestricted completion mode, as provided by the
1335 The number of passes when performing an
1338 Valid values are between 1 and 31.
1343 operation, the pattern is inverted between consecutive passes.
1345 Path to the file containing the pattern to use when
1349 The pattern is repeated as needed to fill each block.
1351 Be quiet, do not print any status messages.
1352 This option will not disable
1353 the questions, however.
1354 To disable questions, use the
1358 Perform the sanitize in the unrestricted completion mode.
1359 If the operation fails, it can later be exited with the
1366 This will report status on a sanitize that is already running on the drive.
1368 Issue a non-immediate sanitize command.
1371 issues the SANITIZE command with the immediate bit set.
1373 device to immediately return the sanitize command, before
1374 the sanitize has actually completed.
1379 sense information from the device every second to determine how far along
1380 in the sanitize process it is.
1383 argument is specified,
1385 will issue a non-immediate sanitize command, and will be unable to print any
1386 information to let the user know what percentage of the disk has been
1389 Do not ask any questions.
1392 will ask the user if he/she really wants to sanitize the disk in question,
1393 and also if the default sanitize command timeout is acceptable.
1395 will not be asked about the timeout if a timeout is specified on the
1399 Put ATA device into IDLE state.
1402 specifies automatic standby timer value in seconds.
1403 Value 0 disables timer.
1405 Put ATA device into STANDBY state.
1408 specifies automatic standby timer value in seconds.
1409 Value 0 disables timer.
1411 Put ATA device into SLEEP state.
1412 Note that the only way get device out of
1413 this state may be reset.
1415 Report ATA device power mode.
1417 It optional parameter
1419 specified, enables and sets advanced power management level, where
1420 1 -- minimum power, 127 -- maximum performance with standby,
1421 128 -- minimum power without standby, 254 -- maximum performance.
1422 If not specified -- APM is disabled.
1424 It optional parameter
1426 specified, enables and sets automatic acoustic management level, where
1427 1 -- minimum noise, 254 -- maximum performance.
1428 If not specified -- AAM is disabled.
1430 Update or report security settings, using an ATA identify command (0xec).
1433 will print out the security support and associated settings of the device.
1436 command takes several arguments:
1440 Disable device security using the given password for the selected user according
1441 to the devices configured security level.
1444 Erase the device using the given password for the selected user.
1446 .Em WARNING! WARNING! WARNING!
1448 Issuing a secure erase will
1450 user data on the device and may take several hours to complete.
1452 When this command is used against an SSD drive all its cells will be marked as
1453 empty, restoring it to factory default write performance.
1454 For SSD's this action
1455 usually takes just a few seconds.
1458 Freeze the security configuration of the specified device.
1460 After command completion any other commands that update the device lock mode
1461 shall be command aborted.
1462 Frozen mode is disabled by power-off or hardware reset.
1465 Enhanced erase the device using the given password for the selected user.
1467 .Em WARNING! WARNING! WARNING!
1469 Issuing an enhanced secure erase will
1471 user data on the device and may take several hours to complete.
1473 An enhanced erase writes predetermined data patterns to all user data areas,
1474 all previously written user data shall be overwritten, including sectors that
1475 are no longer in use due to reallocation.
1478 Unlock the device using the given password for the selected user according to
1479 the devices configured security level.
1480 .It Fl l Ar high|maximum
1482 Specifies which security level to set when issuing a
1485 The security level determines device behavior when the master
1486 password is used to unlock the device.
1487 When the security level is set to high
1488 the device requires the unlock command and the master password to unlock.
1489 When the security level is set to maximum the device requires a secure erase
1490 with the master password to unlock.
1492 This option must be used in conjunction with one of the security action commands.
1498 Be quiet, do not print any status messages.
1499 This option will not disable the questions, however.
1500 To disable questions, use the
1505 Password the device (enable security) using the given password for the selected
1507 This option can be combined with other options such as
1510 A master password may be set in a addition to the user password.
1511 The purpose of the master password is to allow an administrator to establish
1512 a password that is kept secret from the user, and which may be used to unlock
1513 the device if the user password is lost.
1516 Setting the master password does not enable device security.
1518 If the master password is set and the drive supports a Master Revision Code
1519 feature the Master Password Revision Code will be decremented.
1522 Overrides the default timeout, specified in seconds, used for both
1526 this is useful if your system has problems processing long timeouts correctly.
1528 Usually the timeout is calculated from the information stored on the drive if
1529 present, otherwise it defaults to 2 hours.
1530 .It Fl U Ar user|master
1532 Specifies which user to set / use for the running action command, valid values
1533 are user or master and defaults to master if not set.
1535 This option must be used in conjunction with one of the security action commands.
1541 Confirm yes to dangerous options such as
1543 without prompting for confirmation.
1546 If the password specified for any action commands does not match the configured
1547 password for the specified user the command will fail.
1549 The password in all cases is limited to 32 characters, longer passwords will
1552 Update or report Host Protected Area details.
1555 will print out the HPA support and associated settings of the device.
1558 command takes several optional arguments:
1562 Freeze the HPA configuration of the specified device.
1564 After command completion any other commands that update the HPA configuration
1565 shall be command aborted.
1566 Frozen mode is disabled by power-off or hardware reset.
1569 Lock the HPA configuration of the device until a successful call to unlock or
1570 the next power-on reset occurs.
1573 Make the HPA max sectors persist across power-on reset or a hardware reset.
1574 This must be used in combination with
1575 .Fl s Ar max_sectors
1579 Set the HPA configuration password required for unlock calls.
1582 Be quiet, do not print any status messages.
1583 This option will not disable the questions.
1584 To disable questions, use the
1587 .It Fl s Ar max_sectors
1589 Configures the maximum user accessible sectors of the device.
1590 This will change the number of sectors the device reports.
1592 .Em WARNING! WARNING! WARNING!
1594 Changing the max sectors of a device using this option will make the data on
1595 the device beyond the specified value inaccessible.
1598 .Fl s Ar max_sectors
1599 call can be made without a power-on reset or a hardware reset of the device.
1602 Unlock the HPA configuration of the specified device using the given password.
1603 If the password specified does not match the password configured via
1605 the command will fail.
1607 After 5 failed unlock calls, due to password miss-match, the device will refuse
1608 additional unlock calls until after a power-on reset.
1611 Confirm yes to dangerous options such as
1613 without prompting for confirmation
1616 The password for all HPA commands is limited to 32 characters, longer passwords
1619 Update or report Accessible Max Address Configuration.
1622 will print out the Accessible Max Address Configuration support and associated
1623 settings of the device.
1626 command takes several optional arguments:
1630 Freeze the Accessible Max Address Configuration of the specified device.
1632 After command completion any other commands that update the configuration
1633 shall be command aborted.
1634 Frozen mode is disabled by power-off.
1637 Be quiet, do not print any status messages.
1638 .It Fl s Ar max_sectors
1640 Configures the maximum user accessible sectors of the device.
1641 This will change the number of sectors the device reports.
1643 .Em WARNING! WARNING! WARNING!
1645 Changing the max sectors of a device using this option will make the data on
1646 the device beyond the specified value indeterminate.
1649 .Fl s Ar max_sectors
1650 call can be made without a power-on reset of the device.
1653 Program firmware of the named
1655 or ATA device using the image file provided.
1659 device and it provides a recommended timeout for the WRITE BUFFER command
1662 opcodes subcommand), that timeout will be used for the firmware download.
1663 The drive-recommended timeout value may be overridden on the command line
1668 Current list of supported vendors for SCSI/SAS drives:
1671 Tested with 4TB SAS drives, model number HUS724040ALS640.
1675 Tested with LTO-5 (ULTRIUM-HH5) and LTO-6 (ULTRIUM-HH6) tape drives.
1676 There is a separate table entry for hard drives, because the update method
1677 for hard drives is different than the method for tape drives.
1682 Tested with SM1625 SSDs.
1684 Tested with Constellation ES (ST32000444SS), ES.2 (ST33000651SS) and
1685 ES.3 (ST1000NM0023) drives.
1687 Tested with 400GB Optimus SSDs (TXA2D20400GA6001).
1690 .Em WARNING! WARNING! WARNING!
1692 Little testing has been done to make sure that different device models from
1693 each vendor work correctly with the fwdownload command.
1694 A vendor name appearing in the supported list means only that firmware of at
1695 least one device type from that vendor has successfully been programmed with
1696 the fwdownload command.
1697 Extra caution should be taken when using this command since there is no
1698 guarantee it will not break a device from the listed vendors.
1699 Ensure that you have a recent backup of the data on the device before
1700 performing a firmware update.
1704 protocol devices will not be programmed, since there is little chance of
1705 the firmware download succeeding.
1708 will currently attempt a firmware download to any
1712 device, since the standard
1714 DOWNLOAD MICROCODE command may work.
1715 Firmware downloads to
1719 devices are supported for devices connected
1724 controllers, and devices connected to SAS controllers
1729 translation capability.
1735 PASS-THROUGH command to send the
1737 DOWNLOAD MICROCODE command to the drive.
1742 translation implementations don't work fully when translating
1744 WRITE BUFFER commands to
1746 DOWNLOAD MICROCODE commands, but do support
1748 passthrough well enough to do a firmware download.
1750 .It Fl f Ar fw_image
1751 Path to the firmware image file to be downloaded to the specified device.
1753 Do not print informational messages, only print errors.
1754 This option should be used with the
1756 option to suppress all output.
1758 Run in simulation mode.
1759 Device checks are run and the confirmation dialog is shown, but no firmware
1760 download will occur.
1766 errors in the event of a failure.
1768 In simulation mode, print out the
1773 register values that would be used for the firmware download command.
1775 Do not ask for confirmation.
1778 Persistent reservation support.
1779 Persistent reservations are a way to reserve a particular
1781 LUN for use by one or more
1786 option is specified,
1790 PERSISTENT RESERVE IN
1791 command using the requested service action.
1794 option is specified,
1798 PERSISTENT RESERVE OUT
1799 command using the requested service action.
1800 One of those two options is required.
1802 Persistent reservations are complex, and fully explaining them is outside
1803 the scope of this manual.
1806 and download the latest SPC spec for a full explanation of persistent
1810 Specify the service action for the PERSISTENT RESERVE IN command.
1811 Supported service actions:
1814 Report the current persistent reservation generation (PRgeneration) and any
1816 .It read_reservation
1817 Report the persistent reservation, if any.
1818 .It report_capabilities
1819 Report the persistent reservation capabilities of the LUN.
1820 .It read_full_status
1821 Report the full status of persistent reservations on the LUN.
1824 Specify the service action for the PERSISTENT RESERVE OUT command.
1825 For service actions like register that are components of other service
1826 action names, the entire name must be specified.
1827 Otherwise, enough of the service action name must be specified to
1828 distinguish it from other possible service actions.
1829 Supported service actions:
1832 Register a reservation key with the LUN or unregister a reservation key.
1833 To register a key, specify the requested key as the Service Action
1835 To unregister a key, specify the previously registered key as the
1837 To change a key, specify the old key as the Reservation Key and the new
1838 key as the Service Action Reservation Key.
1840 This is similar to the register subcommand, except that the Reservation Key
1842 The Service Action Reservation Key will overwrite any previous key
1843 registered for the initiator.
1845 Create a reservation.
1846 A key must be registered with the LUN before the LUN can be reserved, and
1847 it must be specified as the Reservation Key.
1848 The type of reservation must also be specified.
1849 The scope defaults to LUN scope (LU_SCOPE), but may be changed.
1851 Release a reservation.
1852 The Reservation Key must be specified.
1854 Release a reservation and remove all keys from the device.
1855 The Reservation Key must be specified.
1857 Remove a reservation belonging to another initiator.
1858 The Reservation Key must be specified.
1859 The Service Action Reservation Key may be specified, depending on the
1860 operation being performed.
1862 Remove a reservation belonging to another initiator and abort all
1863 outstanding commands from that initiator.
1864 The Reservation Key must be specified.
1865 The Service Action Reservation Key may be specified, depending on the
1866 operation being performed.
1868 Register another initiator with the LUN, and establish a reservation on the
1869 LUN for that initiator.
1870 The Reservation Key and Service Action Reservation Key must be specified.
1872 Replace Lost Reservation information.
1875 Set the All Target Ports (ALL_TG_PT) bit.
1876 This requests that the key registration be applied to all target ports and
1877 not just the particular target port that receives the command.
1878 This only applies to the register and register_ignore actions.
1880 Specify a Transport ID.
1881 This only applies to the Register and Register and Move service actions for
1882 Persistent Reserve Out.
1883 Multiple Transport IDs may be specified with multiple
1886 With the Register service action, specifying one or more Transport IDs
1887 implicitly enables the
1889 option which turns on the SPEC_I_PT bit.
1890 Transport IDs generally have the format protocol,id.
1893 A SAS Transport ID consists of
1895 followed by a 64-bit SAS address.
1898 .Dl sas,0x1234567812345678
1900 A Fibre Channel Transport ID consists of
1902 followed by a 64-bit Fibre Channel World Wide Name.
1905 .Dl fcp,0x1234567812345678
1907 A Parallel SCSI address consists of
1909 followed by a SCSI target ID and a relative target port identifier.
1914 An IEEE 1394 (Firewire) Transport ID consists of
1916 followed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
1919 .Dl sbp,0x1234567812345678
1921 A SCSI over RDMA Transport ID consists of
1923 followed by a 128-bit RDMA initiator port identifier.
1924 The port identifier must be exactly 32 or 34 (if the leading 0x is
1925 included) hexadecimal digits.
1926 Only hexadecimal (base 16) numbers are supported.
1929 .Dl srp,0x12345678123456781234567812345678
1931 An iSCSI Transport ID consists an iSCSI name and optionally a separator and
1933 For example, if only the iSCSI name is specified:
1935 .Dl iqn.2012-06.com.example:target0
1937 If the iSCSI separator and initiator session ID are specified:
1939 .Dl iqn.2012-06.com.example:target0,i,0x123
1941 A SCSI over PCIe Transport ID consists of
1943 followed by a PCIe Routing ID.
1944 The Routing ID consists of a bus, device and function or in the alternate
1945 form, a bus and function.
1946 The bus must be in the range of 0 to 255 inclusive and the device must be
1947 in the range of 0 to 31 inclusive.
1948 The function must be in the range of 0 to 7 inclusive if the standard form
1949 is used, and in the range of 0 to 255 inclusive if the alternate form is
1951 For example, if a bus, device and function are specified for the standard
1956 If the alternate Routing ID form is used:
1961 Specify the Reservation Key.
1962 This may be in decimal, octal or hexadecimal format.
1963 The value is zero by default if not otherwise specified.
1964 The value must be between 0 and 2^64 - 1, inclusive.
1966 Specify the Service Action Reservation Key.
1967 This may be in decimal, octal or hexadecimal format.
1968 The value is zero by default if not otherwise specified.
1969 The value must be between 0 and 2^64 - 1, inclusive.
1971 Enable the Activate Persist Through Power Loss bit.
1972 This is only used for the register and register_ignore actions.
1973 This requests that the reservation persist across power loss events.
1975 Specify the scope of the reservation.
1976 The scope may be specified by name or by number.
1977 The scope is ignored for register, register_ignore and clear.
1978 If the desired scope isn't available by name, you may specify the number.
1982 This encompasses the entire LUN.
1984 Extent scope (0x01).
1986 Element scope (0x02).
1989 Specify the Relative Target Port.
1990 This only applies to the Register and Move service action of the Persistent
1991 Reserve Out command.
1993 Enable the SPEC_I_PT bit.
1994 This only applies to the Register service action of Persistent Reserve Out.
1995 You must also specify at least one Transport ID with
1997 if this option is set.
1998 If you specify a Transport ID, this option is automatically set.
1999 It is an error to specify this option for any service action other than
2002 Specify the reservation type.
2003 The reservation type may be specified by name or by number.
2004 If the desired reservation type isn't available by name, you may specify
2006 Supported reservation type names:
2011 Write Exclusive mode.
2012 May also be specified as
2013 .Dq write_exclusive .
2015 Read Exclusive mode.
2016 May also be specified as
2017 .Dq read_exclusive .
2019 Exclusive access mode.
2020 May also be specified as
2021 .Dq exclusive_access .
2023 Write Exclusive Registrants Only mode.
2024 May also be specified as
2025 .Dq write_exclusive_reg_only .
2027 Exclusive Access Registrants Only mode.
2028 May also be specified as
2029 .Dq exclusive_access_reg_only .
2031 Write Exclusive All Registrants mode.
2032 May also be specified as
2033 .Dq write_exclusive_all_regs .
2035 Exclusive Access All Registrants mode.
2036 May also be specified as
2037 .Dq exclusive_access_all_regs .
2040 Specify that the target should unregister the initiator that sent
2041 the Register and Move request.
2042 By default, the target will not unregister the initiator that sends the
2043 Register and Move request.
2044 This option only applies to the Register and Move service action of the
2045 Persistent Reserve Out command.
2050 READ or WRITE ATTRIBUTE commands.
2051 These commands are used to read and write attributes in Medium Auxiliary
2053 The most common place Medium Auxiliary Memory is found is small flash chips
2054 included tape cartriges.
2062 option must be specified.
2065 Specify the READ ATTRIBUTE service action.
2068 Issue the ATTRIBUTE VALUES service action.
2069 Read and decode the available attributes and their values.
2071 Issue the ATTRIBUTE LIST service action.
2072 List the attributes that are available to read and write.
2074 Issue the LOGICAL VOLUME LIST service action.
2075 List the available logical volumes in the MAM.
2077 Issue the PARTITION LIST service action.
2078 List the available partitions in the MAM.
2080 Issue the SUPPORTED ATTRIBUTES service action.
2081 List attributes that are supported for reading or writing.
2082 These attributes may or may not be currently present in the MAM.
2085 Specify an attribute to write to the MAM.
2086 This option is not yet implemented.
2088 Specify the attribute number to display.
2089 This option only works with the attr_values, attr_list and supp_attr
2093 Display cached attributes.
2094 If the device supports this flag, it allows displaying attributes for the
2095 last piece of media loaded in the drive.
2097 Specify the element address.
2098 This is used for specifying which element number in a medium changer to
2099 access when reading attributes.
2100 The element number could be for a picker, portal, slot or drive.
2101 .It Fl F Ar form1,form2
2102 Specify the output format for the attribute values (attr_val) display as a
2103 comma separated list of options.
2104 The default output is currently set to field_all,nonascii_trim,text_raw.
2105 Once this code is ported to FreeBSD 10, any text fields will be converted
2106 from their codeset to the user's native codeset with
2109 The text options are mutually exclusive; if you specify more than one, you
2110 will get unpredictable results.
2111 The nonascii options are also mutually exclusive.
2112 Most of the field options may be logically ORed together.
2115 Print text fields with non-ASCII characters escaped.
2117 Print text fields natively, with no codeset conversion.
2119 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2120 escape the non-ASCII characters.
2122 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2123 omit the non-ASCII characters.
2125 If any non-ASCII characters occur in fields that are supposed to be ASCII,
2126 print them as they are.
2128 Print all of the prefix fields: description, attribute number, attribute
2129 size, and the attribute's readonly status.
2130 If field_all is specified, specifying any other field options will not have
2133 Print none of the prefix fields, and only print out the attribute value.
2134 If field_none is specified, specifying any other field options will result
2135 in those fields being printed.
2137 Print out the attribute description.
2139 Print out the attribute number.
2141 Print out the attribute size.
2143 Print out the attribute's readonly status.
2146 Specify the partition.
2147 When the media has multiple partitions, specifying different partition
2148 numbers allows seeing the values for each individual partition.
2149 .It Fl s Ar start_num
2150 Specify the starting attribute number.
2151 This requests that the target device return attribute information starting
2152 at the given number.
2153 .It Fl T Ar elem_type
2154 Specify the element type.
2155 For medium changer devices, this allows specifying the type the element
2156 referenced in the element address (
2166 Specify the number of the logical volume to operate on.
2167 If the media has multiple logical volumes, this will allow displaying
2168 or writing attributes on the given logical volume.
2171 Issue the REPORT SUPPORTED OPCODES service action of the
2175 Without arguments, this command will return a list of all
2177 commands supported by the device, including service actions of commands
2178 that support service actions.
2179 It will also include the
2181 CDB (Command Data Block) length for each command, and the description of
2182 each command if it is known.
2185 Request information on a specific opcode instead of the list of supported
2187 If supported, the target will return a CDB-like structure that indicates
2188 the opcode, service action (if any), and a mask of bits that are supported
2190 .It Fl s Ar service_action
2191 For commands that support a service action, specify the service action to
2194 If a service action is specified for a given opcode, and the device does
2195 not support the given service action, the device should not return a
2197 error, but rather indicate in the returned parameter data that the command
2199 By default, if a service action is specified for an opcode, and service
2200 actions are not supported for the opcode in question, the device will
2203 Include timeout values.
2204 This option works with the default display, which includes all commands
2205 supported by the device, and with the
2209 options, which request information on a specific command and service
2211 This requests that the device report Nominal and Recommended timeout values
2212 for the given command or commands.
2213 The timeout values are in seconds.
2214 The timeout descriptor also includes a command-specific
2221 Zoned Block devices.
2222 This allows managing devices that conform to the
2224 Zoned Block Commands (ZBC) and
2226 Zoned ATA Command Set (ZAC)
2228 Devices using these command sets are usually hard drives using Shingled
2229 Magnetic Recording (SMR).
2230 There are three types of SMR drives:
2233 Drive Managed drives look and act just like a standard random access block
2234 device, but underneath, the drive reads and writes the bulk of its capacity
2236 Sequential writes will yield better performance, but writing sequentially
2239 Host Aware drives expose the underlying zone layout via
2243 commands and allow the host to manage the zone conditions.
2244 The host is not required to manage the zones on the drive, though.
2245 Sequential writes will yield better performance in Sequential Write
2246 Preferred zones, but the host can write randomly in those zones.
2248 Host Managed drives expose the underlying zone layout via
2253 The host is required to access the zones according to the rules described
2255 Any commands that violate the rules will be returned with an error.
2258 SMR drives are divided into zones (typically in the range of 256MB each)
2259 that fall into three general categories:
2262 These are also known as Non Write Pointer zones.
2263 These zones can be randomly written without an unexpected performance penalty.
2264 .It Sequential Preferred
2265 These zones should be written sequentially starting at the write pointer
2267 They may be written randomly.
2268 Writes that do not conform to the zone layout may be significantly slower
2270 .It Sequential Required
2271 These zones must be written sequentially.
2272 If they are not written sequentially, starting at the write pointer, the
2277 Specify the zone subcommand:
2280 Issue the Report Zones command.
2281 All zones are returned by default.
2282 Specify report options with
2284 and printing options with
2286 Specify the starting LBA with
2290 is also accepted as a command argument.
2292 Explicitly open the zone specified by the starting LBA.
2294 Close the zone specified by starting LBA.
2296 Finish the zone specified by the starting LBA.
2298 Reset the write pointer for the zone specified by the starting LBA.
2301 For the Open, Close, Finish, and Reset Write Pointer operations, apply the
2302 operation to all zones on the drive.
2304 Specify the starting LBA.
2305 For the Report Zones command, this tells the drive to report starting with
2306 the zone that starts at the given LBA.
2307 For the other commands, this allows the user to identify the zone requested
2308 by its starting LBA.
2309 The LBA may be specified in decimal, hexadecimal or octal notation.
2311 For the Report Zones command, specify a subset of zones to report.
2315 This is the default.
2317 Report only empty zones.
2319 Report zones that are implicitly open.
2320 This means that the host has sent a write to the zone without explicitly
2323 Report zones that are explicitly open.
2325 Report zones that have been closed by the host.
2327 Report zones that are full.
2329 Report zones that are in the read only state.
2332 is also accepted as an argument.
2334 Report zones that are in the offline state.
2336 Report zones where the device recommends resetting write pointers.
2338 Report zones that have the Non Sequential Resources Active flag set.
2339 These are zones that are Sequential Write Preferred, but have been written
2342 Report Non Write Pointer zones, also known as Conventional zones.
2344 .It Fl P Ar print_opt
2345 Specify a printing option for Report Zones:
2348 Normal Report Zones output.
2349 This is the default.
2350 The summary and column headings are printed, fields are separated by spaces
2351 and the fields themselves may contain spaces.
2353 Just print the summary: the number of zones, the maximum LBA (LBA of the
2354 last logical block on the drive), and the value of the
2359 field describes whether the zones on the drive are all identical, all
2360 different, or whether they are the same except for the last zone, etc.
2362 Print the zones in a script friendly format.
2363 The summary and column headings are omitted, the fields are separated by
2364 commas, and the fields do not contain spaces.
2365 The fields contain underscores where spaces would normally be used.
2371 Extended Power Conditions (EPC) feature set commands.
2374 protocol drives, and will not work on
2383 translation layer (SAT).
2384 It may be helpful to read the ATA Command Set - 4 (ACS-4) description of
2385 the Extended Power Conditions feature set, available at t13.org, to
2386 understand the details of this particular
2391 Specify the epc subcommand
2394 Restore drive power condition settings.
2397 Specify the source for the restored power settings, either
2401 This argument is required.
2404 This only makes sense to specify when restoring from defaults.
2407 Go to the specified power condition.
2410 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2411 This argument is required.
2413 Specify delayed entry to the power condition.
2414 The drive, if it supports this, can enter the power condition after the
2417 Hold the power condition.
2418 If the drive supports this option, it will hold the power condition and
2419 reject all commands that would normally cause it to exit that power
2423 Set the timer value for a power condition and enable or disable the
2427 display described below to see what the current timer settings are for each
2428 Idle and Standby mode supported by the drive.
2431 Enable the power condition.
2438 Disable the power condition.
2445 Specify the timer in seconds.
2446 The user may specify a timer as a floating point number with a maximum
2447 supported resolution of tenths of a second.
2448 Drives may or may not support sub-second timer values.
2450 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2451 This argument is required.
2453 Save the timer and power condition enable/disable state.
2454 By default, if this option is not specified, only the current values for
2455 this power condition will be affected.
2458 Enable or disable a particular power condition.
2461 Enable the power condition.
2468 Disable the power condition.
2475 Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
2476 This argument is required.
2478 Save the power condition enable/disable state.
2479 By default, if this option is not specified, only the current values for
2480 this power condition will be affected.
2483 Enable the Extended Power Condition (EPC) feature set.
2485 Disable the Extended Power Condition (EPC) feature set.
2487 Specify the EPC power source.
2490 Specify the power source, either
2496 Get the current status of several parameters related to the Extended Power
2497 Condition (EPC) feature set, including whether APM and EPC are supported
2498 and enabled, whether Low Power Standby is supported, whether setting the
2499 EPC power source is supported, whether Low Power Standby is supported and
2500 the current power condition.
2503 Only report the current power condition.
2504 Some drives will exit their current power condition if a command other than
2507 CHECK POWER MODE command is received.
2508 If this flag is specified,
2512 CHECK POWER MODE command to the drive.
2517 Power Conditions log (Log Address 0x08).
2518 This shows the list of Idle and Standby power conditions the drive
2519 supports, and a number of parameters about each condition, including
2520 whether it is enabled and what the timer value is.
2524 Issue REPORT TIMESTAMP or SET TIMESTAMP
2531 option must be specified.
2534 Report the device's timestamp.
2535 If no more arguments are specified, the timestamp will be reported using
2536 the national representation of the date and time, followed by the time
2540 Specify the strftime format string, as documented in strftime(3), to be used
2541 to format the reported timestamp.
2543 Report the timestamp as milliseconds since the epoch.
2545 Report the timestamp using the national representation of the date and
2546 time, but override the system time zone and use UTC instead.
2551 Set the device's timestamp.
2558 option must be specified.
2561 Specify the strptime format string, as documented in strptime(3).
2562 The time must also be specified with the
2566 Provide the time in the format specified with the
2570 Set the timestamp to the host system's time in UTC.
2574 Print out the device type for specified device.
2577 An ATA device attached directly to an ATA controller
2579 An SATA device attached behind a SAS controller via SCSI-ATA Translation Layer (SATL)
2583 An directly attached NVMe device
2585 An MMC or SD device attached via a mmcsd bus
2587 No device type reported
2589 Device type is unknown
2591 A programming error occurred
2594 Commands necessary to support the depopulation (depop) of defective elements of a device
2595 (typically heads for hard drives) or setting capacity point (typically used on
2597 Issues either GET PHYSICAL ELEMENT STATUS, REMOVE ELEMENT AND TRUNCATE, or RESTORE
2598 ELEMENT AND REBUILD command to manage storage elements of a drive.
2599 Removal or restoration of elements may take up to a day to complete.
2605 options must be specified.
2606 These options are mutually exclusive.
2607 Only SCSI drives are supported.
2608 Changing the storage elements of a storage drive may result in the loss of all
2609 data on that storage drive.
2610 The drive may need to reinitialize after
2615 The data on the drive is inaccessible until one of these commands complete.
2616 Once one of these commands start, the drive is format corrupt until the
2617 operation successfully completes.
2618 While format corrupt, no read or write I/O is possible to the drive.
2619 If the drive power cycles, it will remain format corrupt and the operation
2623 can monitor an in-progress depop operation.
2625 .It Fl c Ar capacity
2626 Specify the desired capacity point for the drive.
2631 Remove the physical element from service or set the capacity point specified by the
2636 The drive's capacity may be reduced by this operation.
2638 Specify the physical element to remove from service.
2643 Report the current status of the physical elements of a drive.
2645 Restore all the eligible physical elements to service.
2648 Print out verbose usage information.
2653 variable allows the user to specify an alternate mode page format file.
2657 variable determines which text editor
2659 starts when editing mode pages.
2661 .Bl -tag -width /usr/share/misc/scsi_modes -compact
2662 .It Pa /usr/share/misc/scsi_modes
2663 is the SCSI mode format database.
2665 is the transport layer device.
2667 are the CAM application passthrough devices.
2670 .Dl camcontrol eject -n cd -u 1 -v
2672 Eject the CD from cd1, and print SCSI sense information if the command
2675 .Dl camcontrol tur da0
2677 Send the SCSI test unit ready command to da0.
2680 utility will report whether the disk is ready, but will not display sense
2681 information if the command fails since the
2683 switch was not specified.
2684 .Bd -literal -offset indent
2685 camcontrol tur da1 -E -C 4 -t 50 -Q head -v
2688 Send a test unit ready command to da1.
2689 Enable kernel error recovery.
2690 Specify a retry count of 4, and a timeout of 50 seconds.
2694 flag) if the command fails.
2695 Since error recovery is turned on, the
2696 disk will be spun up if it is not currently spinning.
2699 task attribute for the command will be set to Head of Queue.
2702 utility will report whether the disk is ready.
2703 .Bd -literal -offset indent
2704 camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
2705 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
2708 Issue a READ BUFFER command (0x3C) to cd1.
2709 Display the buffer size of cd1,
2710 and display the first 10 bytes from the cache on cd1.
2712 information if the command fails.
2713 .Bd -literal -offset indent
2714 camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
2715 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
2718 Issue a WRITE BUFFER (0x3B) command to cd1.
2719 Write out 10 bytes of data,
2720 not including the (reserved) 4 byte header.
2721 Print out sense information if
2723 Be very careful with this command, improper use may
2724 cause data corruption.
2725 .Bd -literal -offset indent
2726 camcontrol modepage da3 -m 1 -e -P 3
2729 Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
2730 settings on the drive.
2731 Mode page 1 contains a disk drive's auto read and
2732 write reallocation settings, among other things.
2734 .Dl camcontrol rescan all
2736 Rescan all SCSI buses in the system for devices that have been added,
2739 .Dl camcontrol rescan 0
2741 Rescan SCSI bus 0 for devices that have been added, removed or changed.
2743 .Dl camcontrol rescan 0:1:0
2745 Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
2748 .Dl camcontrol tags da5 -N 24
2750 Set the number of concurrent transactions for da5 to 24.
2751 .Bd -literal -offset indent
2752 camcontrol negotiate -n da -u 4 -T disable
2755 Disable tagged queueing for da4.
2756 .Bd -literal -offset indent
2757 camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
2760 Negotiate a sync rate of 20MHz and an offset of 15 with da3.
2762 Test Unit Ready command to make the settings take effect.
2763 .Bd -literal -offset indent
2764 camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
2767 Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs
2769 Display SMP errors if the command fails.
2770 .Bd -literal -offset indent
2771 camcontrol security ada0
2774 Report security support and settings for ada0
2775 .Bd -literal -offset indent
2776 camcontrol security ada0 -U user -s MyPass
2779 Enable security on device ada0 with the password MyPass
2780 .Bd -literal -offset indent
2781 camcontrol security ada0 -U user -e MyPass
2784 Secure erase ada0 which has had security enabled with user password MyPass
2786 .Em WARNING! WARNING! WARNING!
2790 data from the device, so backup your data before using!
2792 This command can be used against an SSD drive to restoring it to
2793 factory default write performance.
2794 .Bd -literal -offset indent
2798 Report HPA support and settings for ada0 (also reported via
2800 .Bd -literal -offset indent
2801 camcontrol hpa ada0 -s 10240
2804 Enables HPA on ada0 setting the maximum reported sectors to 10240.
2806 .Em WARNING! WARNING! WARNING!
2810 to all data on the device beyond this limit until HPA is disabled by setting
2811 HPA to native max sectors of the device, which can only be done after a
2812 power-on or hardware reset!
2815 use this on a device which has an active filesystem!
2816 .Bd -literal -offset indent
2817 camcontrol persist da0 -v -i read_keys
2820 This will read any persistent reservation keys registered with da0, and
2821 display any errors encountered when sending the PERSISTENT RESERVE IN
2824 .Bd -literal -offset indent
2825 camcontrol persist da0 -v -o register -a -K 0x12345678
2828 This will register the persistent reservation key 0x12345678 with da0,
2829 apply that registration to all ports on da0, and display any errors that
2830 occur when sending the PERSISTENT RESERVE OUT command.
2831 .Bd -literal -offset indent
2832 camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
2835 This will reserve da0 for the exlusive use of the initiator issuing the
2837 The scope of the reservation is the entire LUN.
2838 Any errors sending the PERSISTENT RESERVE OUT command will be displayed.
2839 .Bd -literal -offset indent
2840 camcontrol persist da0 -v -i read_full
2843 This will display the full status of all reservations on da0 and print out
2844 status if there are any errors.
2845 .Bd -literal -offset indent
2846 camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
2849 This will release a reservation on da0 of the type ex_ac
2851 The Reservation Key for this registration is 0x12345678.
2852 Any errors that occur will be displayed.
2853 .Bd -literal -offset indent
2854 camcontrol persist da0 -v -o register -K 0x12345678 -S \e
2855 -I sas,0x1234567812345678 -I sas,0x8765432187654321
2858 This will register the key 0x12345678 with da0, specifying that it applies
2859 to the SAS initiators with SAS addresses 0x1234567812345678 and
2861 .Bd -literal -offset indent
2862 camcontrol persist da0 -v -o register_move -k 0x87654321 \e
2863 -K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
2866 This will move the registration from the current initiator, whose
2867 Registration Key is 0x87654321, to the Fibre Channel initiator with the
2868 Fiber Channel World Wide Node Name 0x1234567812345678.
2869 A new registration key, 0x12345678, will be registered for the initiator
2870 with the Fibre Channel World Wide Node Name 0x1234567812345678, and the
2871 current initiator will be unregistered from the target.
2872 The reservation will be moved to relative target port 2 on the target
2874 The registration will persist across power losses.
2875 .Bd -literal -offset indent
2876 camcontrol attrib sa0 -v -i attr_values -p 1
2879 This will read and decode the attribute values from partition 1 on the tape
2880 in tape drive sa0, and will display any
2883 .Bd -literal -offset indent
2884 camcontrol zone da0 -v -c rz -P summary
2887 This will request the SMR zone list from disk da0, and print out a
2888 summary of the zone parameters, and display any
2893 .Bd -literal -offset indent
2894 camcontrol zone da0 -v -c rz -o reset
2897 This will request the list of SMR zones that should have their write
2898 pointer reset from the disk da0, and display any
2903 .Bd -literal -offset indent
2904 camcontrol zone da0 -v -c rwp -l 0x2c80000
2907 This will issue the Reset Write Pointer command to disk da0 for the zone
2908 that starts at LBA 0x2c80000 and display any
2913 .Bd -literal -offset indent
2914 camcontrol epc ada0 -c timer -T 60.1 -p Idle_a -e -s
2917 Set the timer for the Idle_a power condition on drive
2919 to 60.1 seconds, enable that particular power condition, and save the timer
2920 value and the enabled state of the power condition.
2921 .Bd -literal -offset indent
2922 camcontrol epc da4 -c goto -p Standby_z -H
2927 to go to the Standby_z power state (which is
2928 the drive's lowest power state) and hold in that state until it is
2929 explicitly released by another
2932 .Bd -literal -offset indent
2933 camcontrol epc da2 -c status -P
2936 Report only the power state of
2939 Some drives will power up in response to the commands sent by the
2947 CHECK POWER MODE command, which should not trigger a change in the drive's
2949 .Bd -literal -offset indent
2950 camcontrol epc ada0 -c list
2953 Display the ATA Power Conditions log (Log Address 0x08) for
2956 .Bd -literal -offset indent
2957 camcontrol timestamp sa0 -s -f "%a, %d %b %Y %T %z" \e
2958 -T "Wed, 26 Oct 2016 21:43:57 -0600"
2961 Set the timestamp of drive
2965 format string followed by a time string
2966 that was created using this format string.
2969 .Xr cam_cdbparse 3 ,
2979 utility first appeared in
2982 The mode page editing code and arbitrary SCSI command code are based upon
2987 library, written by Julian Elischer and Peter Dufault.
2990 program first appeared in
2992 and first appeared in
2997 .An Kenneth Merry Aq Mt ken@FreeBSD.org
2999 The code that parses the generic command line arguments does not know that
3000 some of the subcommands take multiple arguments.
3001 So if, for instance, you
3002 tried something like this:
3003 .Bd -literal -offset indent
3004 camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
3007 The sense information from the test unit ready command would not get
3008 printed out, since the first
3012 bails out when it sees the second argument to
3016 Fixing this behavior would take some gross code, or changes to the
3019 The best way to circumvent this problem is to always make sure
3022 arguments before any command-specific arguments.