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
49 .Op Fl u Ar unit_number
72 .Op Fl r Ar reporttype
101 .Aq all | bus Ns Op :target:lun
104 .Aq all | bus Ns Op :target:lun
116 .Aq Fl m Ar page | Fl l
124 .Aq Fl a Ar cmd Op args
125 .Aq Fl c Ar cmd Op args
128 .Op Fl i Ar len Ar fmt
130 .Op Fl o Ar len Ar fmt Op args
137 .Aq Fl r Ar len Ar fmt Op args
138 .Aq Fl R Ar len Ar fmt Op args
150 .Op Fl o Ar operation
154 .Op Fl T Ar pp_timeout
155 .Op Fl a Ar enable|disable
156 .Op Fl A Ar enable|disable
157 .Op Fl s Ar enable|disable
158 .Op Fl S Ar enable|disable
179 .Aq all|off|bus Ns Op :target Ns Op :lun
192 .Op Fl D Ar enable|disable
197 .Op Fl T Ar enable|disable
199 .Op Fl W Ar bus_width
213 .Aq Fl a Ar overwrite | block | crypto | exitfailure
252 .Op Fl l Ar high|maximum
256 .Op Fl U Ar user|master
267 .Op Fl s Ar max_sectors
275 utility is designed to provide a way for users to access and control the
282 can cause a loss of data and/or system crashes if used improperly.
284 expert users are encouraged to exercise caution when using this command.
285 Novice users should stay away from this utility.
289 utility has a number of primary functions, many of which support an optional
291 A device identifier can take one of three forms:
294 Specify a device name and unit number combination, like "da5" or "cd3".
296 Specify a bus number and target id.
297 The bus number can be determined from
299 .Dq camcontrol devlist .
300 The lun defaults to 0.
302 Specify the bus, target and lun for a device.
306 The device identifier, if it is specified,
308 come immediately after the function name, and before any generic or
309 function-specific arguments.
314 arguments described below will override any device name or unit number
315 specified beforehand.
322 override a specified bus:target or bus:target:lun, however.
326 primary functions support these generic arguments:
329 SCSI command retry count.
330 In order for this to work, error recovery
334 Instruct the kernel to perform generic SCSI error recovery for the given
336 This is needed in order for the retry count
339 Other than retrying commands, the generic error recovery in
340 the code will generally attempt to spin up drives that are not spinning.
341 It may take some other actions, depending upon the sense code returned from
344 Specify the device type to operate on, e.g.\& "da", "cd".
346 SCSI command timeout in seconds.
347 This overrides the default timeout for
349 .It Fl u Ar unit_number
350 Specify the device unit number, e.g.\& "1", "5".
352 Be verbose, print out sense information for failed SCSI commands.
355 Primary command functions:
356 .Bl -tag -width periphlist
358 List all physical devices (logical units) attached to the CAM subsystem.
359 This also includes a list of peripheral drivers attached to each device.
362 argument, SCSI bus number, adapter name and unit numbers are printed as
365 List all peripheral drivers attached to a given physical device (logical
368 Send the SCSI test unit ready (0x00) command to the given device.
371 utility will report whether the device is ready or not.
373 Send a SCSI inquiry command (0x12) to a device.
376 will print out the standard inquiry data, device serial number, and
377 transfer rate information.
378 The user can specify that only certain types of
379 inquiry data be printed:
382 Get the standard inquiry data.
384 Print out the serial number.
385 If this flag is the only one specified,
387 will not print out "Serial Number" before the value returned by the drive.
388 This is to aid in script writing.
390 Print out transfer rate information.
393 Send a ATA identify command (0xec) to a device.
395 Send the SCSI REPORT LUNS (0xA0) command to the given device.
398 will print out the list of logical units (LUNs) supported by the target device.
399 There are a couple of options to modify the output:
402 Just print out a count of LUNs, not the actual LUN numbers.
404 Just print out the LUNs, and do not print out the count.
405 .It Fl r Ar reporttype
406 Specify the type of report to request from the target:
407 .Bl -tag -width 012345678
409 Return the default report.
413 Most targets will support this report if they support the REPORT LUNS
416 Return only well known LUNs.
418 Return all available LUNs.
423 will try to print out LUN numbers in a reasonable format.
424 It can understand the peripheral, flat, LUN and extended LUN formats.
426 Send the SCSI READ CAPACITY command to the given device and display
428 If the device is larger than 2TB, the SCSI READ CAPACITY (16) service
429 action will be sent to obtain the full size of the device.
432 will print out the last logical block of the device, and the blocksize of
434 To modify the output format, use the following options:
437 Just print out the blocksize, not the last block or device size.
438 This cannot be used with
443 Print out the device size in human readable (base 2, 1K == 1024) format.
446 and cannot be used with
451 Print out the device size in human readable (base 10, 1K == 1000) format.
453 Print out the number of blocks in the device instead of the last logical
456 Quiet, print out the numbers only (separated by a comma if
462 Print out the last logical block or the size of the device only, and omit
466 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
469 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
472 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
473 start bit set and the load/eject bit set.
475 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
476 start bit cleared and the load/eject bit set.
478 Tell the kernel to scan all busses in the system (with the
480 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
481 (XPT_SCAN_LUN) for new devices or devices that have gone away.
483 may specify a scan of all busses, a single bus, or a lun.
485 on a target is not supported.
487 Tell the kernel to reset all busses in the system (with the
489 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
490 reset for that bus, or to reset the given bus:target:lun
491 (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
492 connecting to that device.
493 Note that this can have a destructive impact
496 Send the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and
497 print out any combination of: the total number of defects, the primary
498 defect list (PLIST), and the grown defect list (GLIST).
501 The three format options are:
503 to print out the list as logical blocks,
505 to print out the list in bytes from index format, and
507 to print out the list in physical sector format.
508 The format argument is
510 Most drives support the physical sector format.
512 support the logical block format.
513 Many drives, if they do not support the
514 requested format, return the data in an alternate format, along with sense
515 information indicating that the requested data format is not supported.
519 attempts to detect this, and print out whatever format the drive returns.
520 If the drive uses a non-standard sense code to report that it does not
521 support the requested format,
523 will probably see the error as a failure to complete the request.
525 Print out the grown defect list.
526 This is a list of bad blocks that have
527 been remapped since the disk left the factory.
529 Print out the primary defect list.
538 will print out the number of defects given in the READ DEFECT DATA header
539 returned from the drive.
540 Some drives will report 0 defects if neither the primary or grown defect
543 Allows the user to display and optionally edit a SCSI mode page.
545 page formats are located in
546 .Pa /usr/share/misc/scsi_modes .
547 This can be overridden by specifying a different file in the
549 environment variable.
552 command takes several arguments:
555 Disable block descriptors for mode sense.
557 Displays mode page data in binary format.
559 This flag allows the user to edit values in the mode page.
561 either edit mode page values with the text editor pointed to by his
563 environment variable, or supply mode page values via standard input, using
566 uses to display mode page values.
567 The editor will be invoked if
569 detects that standard input is terminal.
571 Lists all available mode pages.
572 .It Fl m Ar mode_page
573 This specifies the number of the mode page the user would like to view
575 This argument is mandatory unless
579 This allows the user to specify the page control field.
581 .Bl -tag -width xxx -compact
593 Allows the user to send an arbitrary ATA or SCSI CDB to any device.
596 function requires the
598 argument to specify SCSI CDB or the
600 argument to specify ATA Command Block registers values.
601 Other arguments are optional, depending on
603 The command and data specification syntax is documented
606 NOTE: If the CDB specified causes data to be transferred to or from the
607 SCSI device in question, you MUST specify either
612 .It Fl a Ar cmd Op args
613 This specifies the content of 12 ATA Command Block registers (command,
614 features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
615 lba_high_exp, features_exp, sector_count, sector_count_exp).
616 .It Fl c Ar cmd Op args
617 This specifies the SCSI CDB.
618 SCSI CDBs may be 6, 10, 12 or 16 bytes.
620 Specifies DMA protocol to be used for ATA command.
622 Specifies FPDMA (NCQ) protocol to be used for ATA command.
623 .It Fl i Ar len Ar fmt
624 This specifies the amount of data to read, and how it should be displayed.
628 bytes of data will be read from the device and written to standard output.
629 .It Fl o Ar len Ar fmt Op args
630 This specifies the amount of data to be written to a device, and the data
631 that is to be written.
635 bytes of data will be read from standard input and written to the device.
637 This specifies that 11 result ATA Command Block registers should be displayed
638 (status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
639 lba_high_exp, sector_count, sector_count_exp), and how.
642 11 result registers will be written to standard output in hex.
645 Allows the user to send an arbitrary Serial
646 Management Protocol (SMP) command to a device.
649 function requires the
651 argument to specify the SMP request to be sent, and the
653 argument to specify the format of the SMP response.
654 The syntax for the SMP request and response arguments is documented in
657 Note that SAS adapters that support SMP passthrough (at least the currently
658 known adapters) do not accept CRC bytes from the user in the request and do
659 not pass CRC bytes back to the user in the response.
660 Therefore users should not include the CRC bytes in the length of the
661 request and not expect CRC bytes to be returned in the response.
663 .It Fl r Ar len Ar fmt Op args
664 This specifies the size of the SMP request, without the CRC bytes, and the
669 bytes of data will be read from standard input and written as the SMP
671 .It Fl R Ar len Ar fmt Op args
672 This specifies the size of the buffer allocated for the SMP response, and
673 the SMP response format.
677 bytes of data will be allocated for the response and the response will be
678 written to standard output.
681 Allows the user to send the Serial Management Protocol (SMP) Report General
684 will display the data returned by the Report General command.
685 If the SMP target supports the long response format, the additional data
686 will be requested and displayed automatically.
689 Request the long response format only.
690 Not all SMP targets support the long response format.
693 to skip sending the initial report general request without the long bit set
694 and only issue a report general request with the long bit set.
697 Allows the user to issue the Serial Management Protocol (SMP) PHY Control
699 This function should be used with some caution, as it can render devices
700 inaccessible, and could potentially cause data corruption as well.
703 argument is required to specify the PHY to operate on.
706 Specify the PHY to operate on.
707 This argument is required.
709 Request the long request/response format.
710 Not all SMP targets support the long response format.
711 For the PHY Control command, this currently only affects whether the
712 request length is set to a value other than 0.
713 .It Fl o Ar operation
714 Specify a PHY control operation.
717 operation may be specified.
718 The operation may be specified numerically (in decimal, hexadecimal, or octal)
719 or one of the following operation names may be specified:
723 It is not necessary to specify this argument.
725 Send the LINK RESET command to the phy.
727 Send the HARD RESET command to the phy.
729 Send the DISABLE command to the phy.
730 Note that the LINK RESET or HARD RESET commands should re-enable the phy.
732 Send the CLEAR ERROR LOG command.
733 This clears the error log counters for the specified phy.
735 Send the CLEAR AFFILIATION command.
736 This clears the affiliation from the STP initiator port with the same SAS
737 address as the SMP initiator that requests the clear operation.
739 Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
740 This will cause a SATA port selector to use the given phy as its active phy
741 and make the other phy inactive.
743 Send the CLEAR STP I_T NEXUS LOSS command to the PHY.
745 Send the SET ATTACHED DEVICE NAME command to the PHY.
748 argument to specify the device name.
751 Specify the attached device name.
752 This option is needed with the
755 The name is a 64-bit number, and can be specified in decimal, hexadecimal
758 Set the minimum physical link rate for the phy.
759 This is a numeric argument.
760 Currently known link rates are:
763 Do not change current value.
772 Other values may be specified for newer physical link rates.
774 Set the maximum physical link rate for the phy.
775 This is a numeric argument.
778 argument description for known link rate arguments.
779 .It Fl T Ar pp_timeout
780 Set the partial pathway timeout value, in microseconds.
785 specification for more information on this field.
786 .It Fl a Ar enable|disable
787 Enable or disable SATA slumber phy power conditions.
788 .It Fl A Ar enable|disable
789 Enable or disable SATA partial power conditions.
790 .It Fl s Ar enable|disable
791 Enable or disable SAS slumber phy power conditions.
792 .It Fl S Ar enable|disable
793 Enable or disable SAS partial phy power conditions.
796 List phys attached to a SAS expander, the address of the end device
797 attached to the phy, and the inquiry data for that device and peripheral
798 devices attached to that device.
799 The inquiry data and peripheral devices are displayed if available.
802 Turn on the long response format for the underlying SMP commands used for
805 Only print out phys that are attached to a device in the CAM EDT (Existing
809 Send the SMP Report Manufacturer Information command to the device and
810 display the response.
813 Turn on the long response format for the underlying SMP commands used for
817 Turn on CAM debugging printfs in the kernel.
818 This requires options CAMDEBUG
819 in your kernel config file.
820 WARNING: enabling debugging printfs currently
821 causes an EXTREME number of kernel printfs.
822 You may have difficulty
823 turning off the debugging printfs once they start, since the kernel will be
824 busy printing messages and unable to service other requests quickly.
827 function takes a number of arguments:
830 Enable CAM_DEBUG_INFO printfs.
832 Enable CAM_DEBUG_PERIPH printfs.
834 Enable CAM_DEBUG_TRACE printfs.
836 Enable CAM_DEBUG_SUBTRACE printfs.
838 Enable CAM_DEBUG_XPT printfs.
840 Enable CAM_DEBUG_CDB printfs.
841 This will cause the kernel to print out the
842 SCSI CDBs sent to the specified device(s).
844 Enable CAM_DEBUG_PROBE printfs.
846 Enable debugging for all devices.
848 Turn off debugging for all devices
849 .It bus Ns Op :target Ns Op :lun
850 Turn on debugging for the given bus, target or lun.
852 and lun are not specified, they are wildcarded.
853 (i.e., just specifying a
854 bus turns on debugging printfs for all devices on that bus.)
857 Show or set the number of "tagged openings" or simultaneous transactions
858 we attempt to queue to a particular device.
861 command, with no command-specific arguments (i.e., only generic arguments)
862 prints out the "soft" maximum number of transactions that can be queued to
863 the device in question.
864 For more detailed information, use the
866 argument described below.
869 Set the number of tags for the given device.
870 This must be between the
871 minimum and maximum number set in the kernel quirk table.
873 most devices that support tagged queueing is a minimum of 2 and a maximum
875 The minimum and maximum values for a given device may be
876 determined by using the
883 subcommand is described below.
885 Be quiet, and do not report the number of tags.
886 This is generally used when
887 setting the number of tags.
889 The verbose flag has special functionality for the
894 to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
897 This is the amount of capacity for transactions queued to a given device.
899 This is the number of transactions currently queued to a device.
901 This is the kernel queue space for transactions.
902 This count usually mirrors
903 dev_openings except during error recovery operations when
904 the device queue is frozen (device is not allowed to receive
905 commands), the number of dev_openings is reduced, or transaction
908 This is the number of transactions waiting in the kernel queue for capacity
910 This number is usually zero unless error recovery is in
913 The held count is the number of CCBs held by peripheral drivers that have
914 either just been completed or are about to be released to the transport
915 layer for service by a device.
916 Held CCBs reserve capacity on a given
919 This is the current "hard" minimum number of transactions that can be
920 queued to a device at once.
923 value above cannot go below this number.
924 The default value for
926 is 2, although it may be set higher or lower for various devices.
928 This is the "hard" maximum number of transactions that can be queued to a
932 value cannot go above this number.
933 The default value for
935 is 255, although it may be set higher or lower for various devices.
939 Show or negotiate various communication parameters.
941 not support setting or changing some of these values.
943 Adaptec 174x controllers do not support changing a device's sync rate or
948 will not attempt to set the parameter if the controller indicates that it
949 does not support setting the parameter.
950 To find out what the controller
958 command is described below.
959 Also, some controller drivers do not support
960 setting negotiation parameters, even if the underlying controller supports
962 Some controllers, such as the Advansys wide
963 controllers, support enabling and disabling synchronous negotiation for
964 a device, but do not support setting the synchronous negotiation rate.
967 Attempt to make the negotiation settings take effect immediately by sending
968 a Test Unit Ready command to the device.
970 Show or set current negotiation settings.
972 .It Fl D Ar enable|disable
973 Enable or disable disconnection.
977 Set the command delay offset.
979 Be quiet, do not print anything.
980 This is generally useful when you want to
981 set a parameter, but do not want any status information.
983 Change the synchronization rate for a device.
984 The sync rate is a floating
985 point value specified in MHz.
988 is a legal value, as is
990 .It Fl T Ar enable|disable
991 Enable or disable tagged queueing for a device.
993 Show or set user negotiation settings.
994 The default is to show or set
995 current negotiation settings.
997 The verbose switch has special meaning for the
1002 to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
1004 .It Fl W Ar bus_width
1005 Specify the bus width to negotiate with a device.
1008 The only useful values to specify are 8, 16, and 32
1010 The controller must support the bus width in question in order for
1011 the setting to take effect.
1014 In general, sync rate and offset settings will not take effect for a
1015 device until a command has been sent to the device.
1018 switch above will automatically send a Test Unit Ready to the device so
1019 negotiation parameters will take effect.
1023 FORMAT UNIT command to the named device.
1025 .Em WARNING! WARNING! WARNING!
1027 Low level formatting a disk will destroy ALL data on the disk.
1029 extreme caution when issuing this command.
1030 Many users low-level format
1031 disks that do not really need to be low-level formatted.
1033 relatively few scenarios that call for low-level formatting a disk.
1035 low-level formatting a disk is to initialize the disk after changing
1036 its physical sector size.
1037 Another reason for low-level formatting a disk
1038 is to revive the disk if you are getting "medium format corrupted" errors
1039 from the disk in response to read and write requests.
1041 Some disks take longer than others to format.
1042 Users should specify a
1043 timeout long enough to allow the format to complete.
1045 timeout is 3 hours, which should be long enough for most disks.
1047 disks will complete a format operation in a very short period of time
1048 (on the order of 5 minutes or less).
1049 This is often because the drive
1050 does not really support the FORMAT UNIT command -- it just accepts the
1051 command, waits a few minutes and then returns it.
1055 subcommand takes several arguments that modify its default behavior.
1060 arguments can be useful for scripts.
1063 Be quiet, do not print any status messages.
1064 This option will not disable
1065 the questions, however.
1066 To disable questions, use the
1073 This will report status on a format that is already running on the drive.
1075 Issue a non-immediate format command.
1078 issues the FORMAT UNIT command with the immediate bit set.
1080 device to immediately return the format command, before the format has
1086 sense information from the device every second to determine how far along
1087 in the format process it is.
1090 argument is specified,
1092 will issue a non-immediate format command, and will be unable to print any
1093 information to let the user know what percentage of the disk has been
1096 Do not ask any questions.
1099 will ask the user if he/she really wants to format the disk in question,
1100 and also if the default format command timeout is acceptable.
1102 will not be asked about the timeout if a timeout is specified on the
1108 SANITIZE command to the named device.
1110 .Em WARNING! WARNING! WARNING!
1112 ALL data in the cache and on the disk will be destroyed or made inaccessible.
1113 Recovery of the data is not possible.
1114 Use extreme caution when issuing this command.
1118 subcommand takes several arguments that modify its default behavior.
1123 arguments can be useful for scripts.
1125 .It Fl a Ar operation
1126 Specify the sanitize operation to perform.
1129 Perform an overwrite operation by writing a user supplied
1130 data pattern to the device one or more times.
1131 The pattern is given by the
1134 The number of times is given by the
1138 Perform a block erase operation.
1139 All the device's blocks are set to a vendor defined
1140 value, typically zero.
1142 Perform a cryptographic erase operation.
1143 The encryption keys are changed to prevent the decryption
1146 Exits a previously failed sanitize operation.
1147 A failed sanitize operation can only be exited if it was
1148 run in the unrestricted completion mode, as provided by the
1153 The number of passes when performing an
1156 Valid values are between 1 and 31.
1161 operation, the pattern is inverted between consecutive passes.
1163 Path to the file containing the pattern to use when
1167 The pattern is repeated as needed to fill each block.
1169 Be quiet, do not print any status messages.
1170 This option will not disable
1171 the questions, however.
1172 To disable questions, use the
1176 Perform the sanitize in the unrestricted completion mode.
1177 If the operation fails, it can later be exited with the
1184 This will report status on a sanitize that is already running on the drive.
1186 Issue a non-immediate sanitize command.
1189 issues the SANITIZE command with the immediate bit set.
1191 device to immediately return the sanitize command, before
1192 the sanitize has actually completed.
1197 sense information from the device every second to determine how far along
1198 in the sanitize process it is.
1201 argument is specified,
1203 will issue a non-immediate sanitize command, and will be unable to print any
1204 information to let the user know what percentage of the disk has been
1207 Do not ask any questions.
1210 will ask the user if he/she really wants to sanitize the disk in question,
1211 and also if the default sanitize command timeout is acceptable.
1213 will not be asked about the timeout if a timeout is specified on the
1217 Put ATA device into IDLE state.
1220 specifies automatic standby timer value in seconds.
1221 Value 0 disables timer.
1223 Put ATA device into STANDBY state.
1226 specifies automatic standby timer value in seconds.
1227 Value 0 disables timer.
1229 Put ATA device into SLEEP state.
1230 Note that the only way get device out of
1231 this state may be reset.
1233 Update or report security settings, using an ATA identify command (0xec).
1236 will print out the security support and associated settings of the device.
1239 command takes several arguments:
1243 Disable device security using the given password for the selected user according
1244 to the devices configured security level.
1247 Erase the device using the given password for the selected user.
1249 .Em WARNING! WARNING! WARNING!
1251 Issuing a secure erase will
1253 user data on the device and may take several hours to complete.
1255 When this command is used against an SSD drive all its cells will be marked as
1256 empty, restoring it to factory default write performance.
1257 For SSD's this action
1258 usually takes just a few seconds.
1261 Freeze the security configuration of the specified device.
1263 After command completion any other commands that update the device lock mode
1264 shall be command aborted.
1265 Frozen mode is disabled by power-off or hardware reset.
1268 Enhanced erase the device using the given password for the selected user.
1270 .Em WARNING! WARNING! WARNING!
1272 Issuing an enhanced secure erase will
1274 user data on the device and may take several hours to complete.
1276 An enhanced erase writes predetermined data patterns to all user data areas,
1277 all previously written user data shall be overwritten, including sectors that
1278 are no longer in use due to reallocation.
1281 Unlock the device using the given password for the selected user according to
1282 the devices configured security level.
1283 .It Fl l Ar high|maximum
1285 Specifies which security level to set when issuing a
1288 The security level determines device behavior when the master
1289 password is used to unlock the device.
1290 When the security level is set to high
1291 the device requires the unlock command and the master password to unlock.
1292 When the security level is set to maximum the device requires a secure erase
1293 with the master password to unlock.
1295 This option must be used in conjunction with one of the security action commands.
1301 Be quiet, do not print any status messages.
1302 This option will not disable the questions, however.
1303 To disable questions, use the
1308 Password the device (enable security) using the given password for the selected
1310 This option can be combined with other options such as
1313 A master password may be set in a addition to the user password. The purpose of
1314 the master password is to allow an administrator to establish a password that
1315 is kept secret from the user, and which may be used to unlock the device if the
1316 user password is lost.
1319 Setting the master password does not enable device security.
1321 If the master password is set and the drive supports a Master Revision Code
1322 feature the Master Password Revision Code will be decremented.
1325 Overrides the default timeout, specified in seconds, used for both
1329 this is useful if your system has problems processing long timeouts correctly.
1331 Usually the timeout is calculated from the information stored on the drive if
1332 present, otherwise it defaults to 2 hours.
1333 .It Fl U Ar user|master
1335 Specifies which user to set / use for the running action command, valid values
1336 are user or master and defaults to master if not set.
1338 This option must be used in conjunction with one of the security action commands.
1344 Confirm yes to dangerous options such as
1346 without prompting for confirmation.
1349 If the password specified for any action commands does not match the configured
1350 password for the specified user the command will fail.
1352 The password in all cases is limited to 32 characters, longer passwords will
1355 Update or report Host Protected Area details.
1358 will print out the HPA support and associated settings of the device.
1361 command takes several optional arguments:
1365 Freeze the HPA configuration of the specified device.
1367 After command completion any other commands that update the HPA configuration
1368 shall be command aborted.
1369 Frozen mode is disabled by power-off or hardware reset.
1372 Lock the HPA configuration of the device until a successful call to unlock or
1373 the next power-on reset occurs.
1376 Make the HPA max sectors persist across power-on reset or a hardware reset.
1377 This must be used in combination with
1378 .Fl s Ar max_sectors
1382 Set the HPA configuration password required for unlock calls.
1385 Be quiet, do not print any status messages.
1386 This option will not disable the questions.
1387 To disable questions, use the
1390 .It Fl s Ar max_sectors
1392 Configures the maximum user accessible sectors of the device.
1393 This will change the number of sectors the device reports.
1395 .Em WARNING! WARNING! WARNING!
1397 Changing the max sectors of a device using this option will make the data on
1398 the device beyond the specified value inaccessible.
1401 .Fl s Ar max_sectors
1402 call can be made without a power-on reset or a hardware reset of the device.
1405 Unlock the HPA configuration of the specified device using the given password.
1406 If the password specified does not match the password configured via
1408 the command will fail.
1410 After 5 failed unlock calls, due to password miss-match, the device will refuse
1411 additional unlock calls until after a power-on reset.
1414 Confirm yes to dangerous options such as
1416 without prompting for confirmation
1419 The password for all HPA commands is limited to 32 characters, longer passwords
1422 Program firmware of the named SCSI device using the image file provided.
1424 Current list of supported vendors:
1425 .Bl -bullet -offset indent -compact
1442 .Em WARNING! WARNING! WARNING!
1444 Little testing has been done to make sure that different device models from
1445 each vendor work correctly with the fwdownload command.
1446 A vendor name appearing in the supported list means only that firmware of at
1447 least one device type from that vendor has successfully been programmed with
1448 the fwdownload command.
1449 Extra caution should be taken when using this command since there is no
1450 guarantee it will not break a device from the listed vendors.
1451 Ensure that you have a recent backup of the data on the device before
1452 performing a firmware update.
1454 .It Fl f Ar fw_image
1455 Path to the firmware image file to be downloaded to the specified device.
1457 Do not ask for confirmation.
1459 Run in simulation mode.
1460 Packet sizes that will be sent are shown, but no actual packet is sent to the
1462 No confirmation is asked in simulation mode.
1464 Besides showing sense information in case of a failure, the verbose option
1467 to output a line for every firmware segment that is sent to the device by the
1469 -- the same as the ones shown in simulation mode.
1472 Print out verbose usage information.
1477 variable allows the user to specify an alternate mode page format file.
1481 variable determines which text editor
1483 starts when editing mode pages.
1485 .Bl -tag -width /usr/share/misc/scsi_modes -compact
1486 .It Pa /usr/share/misc/scsi_modes
1487 is the SCSI mode format database.
1489 is the transport layer device.
1491 are the CAM application passthrough devices.
1494 .Dl camcontrol eject -n cd -u 1 -v
1496 Eject the CD from cd1, and print SCSI sense information if the command
1499 .Dl camcontrol tur da0
1501 Send the SCSI test unit ready command to da0.
1504 utility will report whether the disk is ready, but will not display sense
1505 information if the command fails since the
1507 switch was not specified.
1508 .Bd -literal -offset indent
1509 camcontrol tur da1 -E -C 4 -t 50 -v
1512 Send a test unit ready command to da1.
1513 Enable kernel error recovery.
1514 Specify a retry count of 4, and a timeout of 50 seconds.
1518 flag) if the command fails.
1519 Since error recovery is turned on, the
1520 disk will be spun up if it is not currently spinning.
1523 utility will report whether the disk is ready.
1524 .Bd -literal -offset indent
1525 camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
1526 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
1529 Issue a READ BUFFER command (0x3C) to cd1.
1530 Display the buffer size of cd1,
1531 and display the first 10 bytes from the cache on cd1.
1533 information if the command fails.
1534 .Bd -literal -offset indent
1535 camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
1536 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
1539 Issue a WRITE BUFFER (0x3B) command to cd1.
1540 Write out 10 bytes of data,
1541 not including the (reserved) 4 byte header.
1542 Print out sense information if
1544 Be very careful with this command, improper use may
1545 cause data corruption.
1546 .Bd -literal -offset indent
1547 camcontrol modepage da3 -m 1 -e -P 3
1550 Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
1551 settings on the drive.
1552 Mode page 1 contains a disk drive's auto read and
1553 write reallocation settings, among other things.
1555 .Dl camcontrol rescan all
1557 Rescan all SCSI busses in the system for devices that have been added,
1560 .Dl camcontrol rescan 0
1562 Rescan SCSI bus 0 for devices that have been added, removed or changed.
1564 .Dl camcontrol rescan 0:1:0
1566 Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
1569 .Dl camcontrol tags da5 -N 24
1571 Set the number of concurrent transactions for da5 to 24.
1572 .Bd -literal -offset indent
1573 camcontrol negotiate -n da -u 4 -T disable
1576 Disable tagged queueing for da4.
1577 .Bd -literal -offset indent
1578 camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
1581 Negotiate a sync rate of 20MHz and an offset of 15 with da3.
1583 Test Unit Ready command to make the settings take effect.
1584 .Bd -literal -offset indent
1585 camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
1588 Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs
1590 Display SMP errors if the command fails.
1591 .Bd -literal -offset indent
1592 camcontrol security ada0
1595 Report security support and settings for ada0
1596 .Bd -literal -offset indent
1597 camcontrol security ada0 -u user -s MyPass
1600 Enable security on device ada0 with the password MyPass
1601 .Bd -literal -offset indent
1602 camcontrol security ada0 -u user -e MyPass
1605 Secure erase ada0 which has had security enabled with user password MyPass
1607 .Em WARNING! WARNING! WARNING!
1611 data from the device, so backup your data before using!
1613 This command can be used against an SSD drive to restoring it to
1614 factory default write performance.
1615 .Bd -literal -offset indent
1619 Report HPA support and settings for ada0 (also reported via
1621 .Bd -literal -offset indent
1622 camcontrol hpa ada0 -s 10240
1625 Enables HPA on ada0 setting the maximum reported sectors to 10240.
1627 .Em WARNING! WARNING! WARNING!
1631 to all data on the device beyond this limit until HPA is disabled by setting
1632 HPA to native max sectors of the device, which can only be done after a
1633 power-on or hardware reset!
1636 use this on a device which has an active filesystem!
1639 .Xr cam_cdbparse 3 ,
1646 utility first appeared in
1649 The mode page editing code and arbitrary SCSI command code are based upon
1654 library, written by Julian Elischer and Peter Dufault.
1657 program first appeared in
1659 and first appeared in
1664 .An Kenneth Merry Aq ken@FreeBSD.org
1666 The code that parses the generic command line arguments does not know that
1667 some of the subcommands take multiple arguments.
1668 So if, for instance, you
1669 tried something like this:
1670 .Bd -literal -offset indent
1671 camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
1674 The sense information from the test unit ready command would not get
1675 printed out, since the first
1679 bails out when it sees the second argument to
1683 Fixing this behavior would take some gross code, or changes to the
1686 The best way to circumvent this problem is to always make sure
1689 arguments before any command-specific arguments.