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
239 .Op Fl l Ar high|maximum
243 .Op Fl U Ar user|master
254 .Op Fl s Ar max_sectors
262 utility is designed to provide a way for users to access and control the
269 can cause a loss of data and/or system crashes if used improperly.
271 expert users are encouraged to exercise caution when using this command.
272 Novice users should stay away from this utility.
276 utility has a number of primary functions, many of which support an optional
278 A device identifier can take one of three forms:
281 Specify a device name and unit number combination, like "da5" or "cd3".
283 Specify a bus number and target id.
284 The bus number can be determined from
286 .Dq camcontrol devlist .
287 The lun defaults to 0.
289 Specify the bus, target and lun for a device.
293 The device identifier, if it is specified,
295 come immediately after the function name, and before any generic or
296 function-specific arguments.
301 arguments described below will override any device name or unit number
302 specified beforehand.
309 override a specified bus:target or bus:target:lun, however.
313 primary functions support these generic arguments:
316 SCSI command retry count.
317 In order for this to work, error recovery
321 Instruct the kernel to perform generic SCSI error recovery for the given
323 This is needed in order for the retry count
326 Other than retrying commands, the generic error recovery in
327 the code will generally attempt to spin up drives that are not spinning.
328 It may take some other actions, depending upon the sense code returned from
331 Specify the device type to operate on, e.g.\& "da", "cd".
333 SCSI command timeout in seconds.
334 This overrides the default timeout for
336 .It Fl u Ar unit_number
337 Specify the device unit number, e.g.\& "1", "5".
339 Be verbose, print out sense information for failed SCSI commands.
342 Primary command functions:
343 .Bl -tag -width periphlist
345 List all physical devices (logical units) attached to the CAM subsystem.
346 This also includes a list of peripheral drivers attached to each device.
349 argument, SCSI bus number, adapter name and unit numbers are printed as
352 List all peripheral drivers attached to a given physical device (logical
355 Send the SCSI test unit ready (0x00) command to the given device.
358 utility will report whether the device is ready or not.
360 Send a SCSI inquiry command (0x12) to a device.
363 will print out the standard inquiry data, device serial number, and
364 transfer rate information.
365 The user can specify that only certain types of
366 inquiry data be printed:
369 Get the standard inquiry data.
371 Print out the serial number.
372 If this flag is the only one specified,
374 will not print out "Serial Number" before the value returned by the drive.
375 This is to aid in script writing.
377 Print out transfer rate information.
380 Send a ATA identify command (0xec) to a device.
382 Send the SCSI REPORT LUNS (0xA0) command to the given device.
385 will print out the list of logical units (LUNs) supported by the target device.
386 There are a couple of options to modify the output:
389 Just print out a count of LUNs, not the actual LUN numbers.
391 Just print out the LUNs, and don't print out the count.
392 .It Fl r Ar reporttype
393 Specify the type of report to request from the target:
394 .Bl -tag -width 012345678
396 Return the default report.
400 Most targets will support this report if they support the REPORT LUNS
403 Return only well known LUNs.
405 Return all available LUNs.
410 will try to print out LUN numbers in a reasonable format.
411 It can understand the peripheral, flat, LUN and extended LUN formats.
413 Send the SCSI READ CAPACITY command to the given device and display
415 If the device is larger than 2TB, the SCSI READ CAPACITY (16) service
416 action will be sent to obtain the full size of the device.
419 will print out the last logical block of the device, and the blocksize of
421 To modify the output format, use the following options:
424 Just print out the blocksize, not the last block or device size.
425 This cannot be used with
430 Print out the device size in human readable (base 2, 1K == 1024) format.
433 and cannot be used with
438 Print out the device size in human readable (base 10, 1K == 1000) format.
440 Print out the number of blocks in the device instead of the last logical
443 Quiet, print out the numbers only (separated by a comma if
449 Print out the last logical block or the size of the device only, and omit
453 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
456 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
459 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
460 start bit set and the load/eject bit set.
462 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
463 start bit cleared and the load/eject bit set.
465 Tell the kernel to scan all busses in the system (with the
467 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
468 (XPT_SCAN_LUN) for new devices or devices that have gone away.
470 may specify a scan of all busses, a single bus, or a lun.
472 on a target is not supported.
474 Tell the kernel to reset all busses in the system (with the
476 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
477 reset for that bus, or to reset the given bus:target:lun
478 (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
479 connecting to that device.
480 Note that this can have a destructive impact
483 Send the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and
484 print out any combination of: the total number of defects, the primary
485 defect list (PLIST), and the grown defect list (GLIST).
488 The three format options are:
490 to print out the list as logical blocks,
492 to print out the list in bytes from index format, and
494 to print out the list in physical sector format.
495 The format argument is
497 Most drives support the physical sector format.
499 support the logical block format.
500 Many drives, if they do not support the
501 requested format, return the data in an alternate format, along with sense
502 information indicating that the requested data format is not supported.
506 attempts to detect this, and print out whatever format the drive returns.
507 If the drive uses a non-standard sense code to report that it does not
508 support the requested format,
510 will probably see the error as a failure to complete the request.
512 Print out the grown defect list.
513 This is a list of bad blocks that have
514 been remapped since the disk left the factory.
516 Print out the primary defect list.
525 will print out the number of defects given in the READ DEFECT DATA header
526 returned from the drive.
527 Some drives will report 0 defects if neither the primary or grown defect
530 Allows the user to display and optionally edit a SCSI mode page.
532 page formats are located in
533 .Pa /usr/share/misc/scsi_modes .
534 This can be overridden by specifying a different file in the
536 environment variable.
539 command takes several arguments:
542 Disable block descriptors for mode sense.
544 Displays mode page data in binary format.
546 This flag allows the user to edit values in the mode page.
548 either edit mode page values with the text editor pointed to by his
550 environment variable, or supply mode page values via standard input, using
553 uses to display mode page values.
554 The editor will be invoked if
556 detects that standard input is terminal.
558 Lists all available mode pages.
559 .It Fl m Ar mode_page
560 This specifies the number of the mode page the user would like to view
562 This argument is mandatory unless
566 This allows the user to specify the page control field.
568 .Bl -tag -width xxx -compact
580 Allows the user to send an arbitrary ATA or SCSI CDB to any device.
583 function requires the
585 argument to specify SCSI CDB or the
587 argument to specify ATA Command Block registers values.
588 Other arguments are optional, depending on
590 The command and data specification syntax is documented
593 NOTE: If the CDB specified causes data to be transferred to or from the
594 SCSI device in question, you MUST specify either
599 .It Fl a Ar cmd Op args
600 This specifies the content of 12 ATA Command Block registers (command,
601 features, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp.
602 lba_high_exp, features_exp, sector_count, sector_count_exp).
603 .It Fl c Ar cmd Op args
604 This specifies the SCSI CDB.
605 SCSI CDBs may be 6, 10, 12 or 16 bytes.
607 Specifies DMA protocol to be used for ATA command.
609 Specifies FPDMA (NCQ) protocol to be used for ATA command.
610 .It Fl i Ar len Ar fmt
611 This specifies the amount of data to read, and how it should be displayed.
615 bytes of data will be read from the device and written to standard output.
616 .It Fl o Ar len Ar fmt Op args
617 This specifies the amount of data to be written to a device, and the data
618 that is to be written.
622 bytes of data will be read from standard input and written to the device.
624 This specifies that 11 result ATA Command Block registers should be displayed
625 (status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp,
626 lba_high_exp, sector_count, sector_count_exp), and how.
629 11 result registers will be written to standard output in hex.
632 Allows the user to send an arbitrary Serial
633 Management Protocol (SMP) command to a device.
636 function requires the
638 argument to specify the SMP request to be sent, and the
640 argument to specify the format of the SMP response.
641 The syntax for the SMP request and response arguments is documented in
644 Note that SAS adapters that support SMP passthrough (at least the currently
645 known adapters) do not accept CRC bytes from the user in the request and do
646 not pass CRC bytes back to the user in the response.
647 Therefore users should not include the CRC bytes in the length of the
648 request and not expect CRC bytes to be returned in the response.
650 .It Fl r Ar len Ar fmt Op args
651 This specifies the size of the SMP request, without the CRC bytes, and the
652 SMP request format. If the format is
655 bytes of data will be read from standard input and written as the SMP
657 .It Fl R Ar len Ar fmt Op args
658 This specifies the size of the buffer allocated for the SMP response, and
659 the SMP response format.
663 bytes of data will be allocated for the response and the response will be
664 written to standard output.
667 Allows the user to send the Serial Management Protocol (SMP) Report General
670 will display the data returned by the Report General command.
671 If the SMP target supports the long response format, the additional data
672 will be requested and displayed automatically.
675 Request the long response format only.
676 Not all SMP targets support the long response format.
679 to skip sending the initial report general request without the long bit set
680 and only issue a report general request with the long bit set.
683 Allows the user to issue the Serial Management Protocol (SMP) PHY Control
685 This function should be used with some caution, as it can render devices
686 inaccessible, and could potentially cause data corruption as well.
689 argument is required to specify the PHY to operate on.
692 Specify the PHY to operate on.
693 This argument is required.
695 Request the long request/response format.
696 Not all SMP targets support the long response format.
697 For the PHY Control command, this currently only affects whether the
698 request length is set to a value other than 0.
699 .It Fl o Ar operation
700 Specify a PHY control operation.
703 operation may be specified.
704 The operation may be specified numerically (in decimal, hexadecimal, or octal)
705 or one of the following operation names may be specified:
709 It is not necessary to specify this argument.
711 Send the LINK RESET command to the phy.
713 Send the HARD RESET command to the phy.
715 Send the DISABLE command to the phy.
716 Note that the LINK RESET or HARD RESET commands should re-enable the phy.
718 Send the CLEAR ERROR LOG command.
719 This clears the error log counters for the specified phy.
721 Send the CLEAR AFFILIATION command.
722 This clears the affiliation from the STP initiator port with the same SAS
723 address as the SMP initiator that requests the clear operation.
725 Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy.
726 This will cause a SATA port selector to use the given phy as its active phy
727 and make the other phy inactive.
729 Send the CLEAR STP I_T NEXUS LOSS command to the PHY.
731 Send the SET ATTACHED DEVICE NAME command to the PHY.
734 argument to specify the device name.
737 Specify the attached device name.
738 This option is needed with the
741 The name is a 64-bit number, and can be specified in decimal, hexadecimal
744 Set the minimum physical link rate for the phy.
745 This is a numeric argument.
746 Currently known link rates are:
749 Do not change current value.
758 Other values may be specified for newer physical link rates.
760 Set the maximum physical link rate for the phy.
761 This is a numeric argument.
764 argument description for known link rate arguments.
765 .It Fl T Ar pp_timeout
766 Set the partial pathway timeout value, in microseconds.
771 specification for more information on this field.
772 .It Fl a Ar enable|disable
773 Enable or disable SATA slumber phy power conditions.
774 .It Fl A Ar enable|disable
775 Enable or disable SATA partial power conditions.
776 .It Fl s Ar enable|disable
777 Enable or disable SAS slumber phy power conditions.
778 .It Fl S Ar enable|disable
779 Enable or disable SAS partial phy power conditions.
782 List phys attached to a SAS expander, the address of the end device
783 attached to the phy, and the inquiry data for that device and peripheral
784 devices attached to that device.
785 The inquiry data and peripheral devices are displayed if available.
788 Turn on the long response format for the underlying SMP commands used for
791 Only print out phys that are attached to a device in the CAM EDT (Existing
795 Send the SMP Report Manufacturer Information command to the device and
796 display the response.
799 Turn on the long response format for the underlying SMP commands used for
803 Turn on CAM debugging printfs in the kernel.
804 This requires options CAMDEBUG
805 in your kernel config file.
806 WARNING: enabling debugging printfs currently
807 causes an EXTREME number of kernel printfs.
808 You may have difficulty
809 turning off the debugging printfs once they start, since the kernel will be
810 busy printing messages and unable to service other requests quickly.
813 function takes a number of arguments:
816 Enable CAM_DEBUG_INFO printfs.
818 Enable CAM_DEBUG_PERIPH printfs.
820 Enable CAM_DEBUG_TRACE printfs.
822 Enable CAM_DEBUG_SUBTRACE printfs.
824 Enable CAM_DEBUG_XPT printfs.
826 Enable CAM_DEBUG_CDB printfs.
827 This will cause the kernel to print out the
828 SCSI CDBs sent to the specified device(s).
830 Enable CAM_DEBUG_PROBE printfs.
832 Enable debugging for all devices.
834 Turn off debugging for all devices
835 .It bus Ns Op :target Ns Op :lun
836 Turn on debugging for the given bus, target or lun.
838 and lun are not specified, they are wildcarded.
839 (i.e., just specifying a
840 bus turns on debugging printfs for all devices on that bus.)
843 Show or set the number of "tagged openings" or simultaneous transactions
844 we attempt to queue to a particular device.
847 command, with no command-specific arguments (i.e., only generic arguments)
848 prints out the "soft" maximum number of transactions that can be queued to
849 the device in question.
850 For more detailed information, use the
852 argument described below.
855 Set the number of tags for the given device.
856 This must be between the
857 minimum and maximum number set in the kernel quirk table.
859 most devices that support tagged queueing is a minimum of 2 and a maximum
861 The minimum and maximum values for a given device may be
862 determined by using the
869 subcommand is described below.
871 Be quiet, and do not report the number of tags.
872 This is generally used when
873 setting the number of tags.
875 The verbose flag has special functionality for the
880 to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
883 This is the amount of capacity for transactions queued to a given device.
885 This is the number of transactions currently queued to a device.
887 This is the kernel queue space for transactions.
888 This count usually mirrors
889 dev_openings except during error recovery operations when
890 the device queue is frozen (device is not allowed to receive
891 commands), the number of dev_openings is reduced, or transaction
894 This is the number of transactions waiting in the kernel queue for capacity
896 This number is usually zero unless error recovery is in
899 The held count is the number of CCBs held by peripheral drivers that have
900 either just been completed or are about to be released to the transport
901 layer for service by a device.
902 Held CCBs reserve capacity on a given
905 This is the current "hard" minimum number of transactions that can be
906 queued to a device at once.
909 value above cannot go below this number.
910 The default value for
912 is 2, although it may be set higher or lower for various devices.
914 This is the "hard" maximum number of transactions that can be queued to a
918 value cannot go above this number.
919 The default value for
921 is 255, although it may be set higher or lower for various devices.
925 Show or negotiate various communication parameters.
927 not support setting or changing some of these values.
929 Adaptec 174x controllers do not support changing a device's sync rate or
934 will not attempt to set the parameter if the controller indicates that it
935 does not support setting the parameter.
936 To find out what the controller
944 command is described below.
945 Also, some controller drivers do not support
946 setting negotiation parameters, even if the underlying controller supports
948 Some controllers, such as the Advansys wide
949 controllers, support enabling and disabling synchronous negotiation for
950 a device, but do not support setting the synchronous negotiation rate.
953 Attempt to make the negotiation settings take effect immediately by sending
954 a Test Unit Ready command to the device.
956 Show or set current negotiation settings.
958 .It Fl D Ar enable|disable
959 Enable or disable disconnection.
963 Set the command delay offset.
965 Be quiet, do not print anything.
966 This is generally useful when you want to
967 set a parameter, but do not want any status information.
969 Change the synchronization rate for a device.
970 The sync rate is a floating
971 point value specified in MHz.
974 is a legal value, as is
976 .It Fl T Ar enable|disable
977 Enable or disable tagged queueing for a device.
979 Show or set user negotiation settings.
980 The default is to show or set
981 current negotiation settings.
983 The verbose switch has special meaning for the
988 to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
990 .It Fl W Ar bus_width
991 Specify the bus width to negotiate with a device.
994 The only useful values to specify are 8, 16, and 32
996 The controller must support the bus width in question in order for
997 the setting to take effect.
1000 In general, sync rate and offset settings will not take effect for a
1001 device until a command has been sent to the device.
1004 switch above will automatically send a Test Unit Ready to the device so
1005 negotiation parameters will take effect.
1009 FORMAT UNIT command to the named device.
1011 .Em WARNING! WARNING! WARNING!
1013 Low level formatting a disk will destroy ALL data on the disk.
1015 extreme caution when issuing this command.
1016 Many users low-level format
1017 disks that do not really need to be low-level formatted.
1019 relatively few scenarios that call for low-level formatting a disk.
1021 low-level formatting a disk is to initialize the disk after changing
1022 its physical sector size.
1023 Another reason for low-level formatting a disk
1024 is to revive the disk if you are getting "medium format corrupted" errors
1025 from the disk in response to read and write requests.
1027 Some disks take longer than others to format.
1028 Users should specify a
1029 timeout long enough to allow the format to complete.
1031 timeout is 3 hours, which should be long enough for most disks.
1033 disks will complete a format operation in a very short period of time
1034 (on the order of 5 minutes or less).
1035 This is often because the drive
1036 does not really support the FORMAT UNIT command -- it just accepts the
1037 command, waits a few minutes and then returns it.
1041 subcommand takes several arguments that modify its default behavior.
1046 arguments can be useful for scripts.
1049 Be quiet, do not print any status messages.
1050 This option will not disable
1051 the questions, however.
1052 To disable questions, use the
1059 This will report status on a format that is already running on the drive.
1061 Issue a non-immediate format command.
1064 issues the FORMAT UNIT command with the immediate bit set.
1066 device to immediately return the format command, before the format has
1072 sense information from the device every second to determine how far along
1073 in the format process it is.
1076 argument is specified,
1078 will issue a non-immediate format command, and will be unable to print any
1079 information to let the user know what percentage of the disk has been
1082 Do not ask any questions.
1085 will ask the user if he/she really wants to format the disk in question,
1086 and also if the default format command timeout is acceptable.
1088 will not be asked about the timeout if a timeout is specified on the
1092 Put ATA device into IDLE state. Optional parameter
1094 specifies automatic standby timer value in seconds. Value 0 disables timer.
1096 Put ATA device into STANDBY state. Optional parameter
1098 specifies automatic standby timer value in seconds. Value 0 disables timer.
1100 Put ATA device into SLEEP state. Note that the only way get device out of
1101 this state may be reset.
1103 Update or report security settings, using an ATA identify command (0xec).
1106 will print out the security support and associated settings of the device.
1109 command takes several arguments:
1113 Disable device security using the given password for the selected user according
1114 to the devices configured security level.
1117 Erase the device using the given password for the selected user.
1119 .Em WARNING! WARNING! WARNING!
1121 Issuing a secure erase will
1123 user data on the device and may take several hours to complete.
1125 When this command is used against an SSD drive all its cells will be marked as
1126 empty, restoring it to factory default write performance. For SSD's this action
1127 usually takes just a few seconds.
1130 Freeze the security configuration of the specified device.
1132 After command completion any other commands that update the device lock mode
1133 shall be command aborted. Frozen mode is disabled by power-off or hardware reset.
1136 Enhanced erase the device using the given password for the selected user.
1138 .Em WARNING! WARNING! WARNING!
1140 Issuing an enhanced secure erase will
1142 user data on the device and may take several hours to complete.
1144 An enhanced erase writes predetermined data patterns to all user data areas,
1145 all previously written user data shall be overwritten, including sectors that
1146 are no longer in use due to reallocation.
1149 Unlock the device using the given password for the selected user according to
1150 the devices configured security level.
1151 .It Fl l Ar high|maximum
1153 Specifies which security level to set when issuing a
1155 command. The security level determines device behavior when the master
1156 password is used to unlock the device. When the security level is set to high
1157 the device requires the unlock command and the master password to unlock.
1158 When the security level is set to maximum the device requires a secure erase
1159 with the master password to unlock.
1161 This option must be used in conjunction with one of the security action commands.
1167 Be quiet, do not print any status messages.
1168 This option will not disable the questions, however.
1169 To disable questions, use the
1174 Password the device (enable security) using the given password for the selected
1175 user. This option can be combined with other options such as
1178 A master password may be set in a addition to the user password. The purpose of
1179 the master password is to allow an administrator to establish a password that
1180 is kept secret from the user, and which may be used to unlock the device if the
1181 user password is lost.
1184 Setting the master password does not enable device security.
1186 If the master password is set and the drive supports a Master Revision Code
1187 feature the Master Password Revision Code will be decremented.
1190 Overrides the default timeout, specified in seconds, used for both
1194 this is useful if your system has problems processing long timeouts correctly.
1196 Usually the timeout is calculated from the information stored on the drive if
1197 present, otherwise it defaults to 2 hours.
1198 .It Fl U Ar user|master
1200 Specifies which user to set / use for the running action command, valid values
1201 are user or master and defaults to master if not set.
1203 This option must be used in conjunction with one of the security action commands.
1209 Confirm yes to dangerous options such as
1211 without prompting for confirmation.
1214 If the password specified for any action commands doesn't match the configured
1215 password for the specified user the command will fail.
1217 The password in all cases is limited to 32 characters, longer passwords will
1220 Update or report Host Protected Area details.
1223 will print out the HPA support and associated settings of the device.
1226 command takes several optional arguments:
1230 Freeze the HPA configuration of the specified device.
1232 After command completion any other commands that update the HPA configuration
1233 shall be command aborted.
1234 Frozen mode is disabled by power-off or hardware reset.
1237 Lock the HPA configuration of the device until a successful call to unlock or
1238 the next power-on reset occurs.
1241 Make the HPA max sectors persist across power-on reset or a hardware reset.
1242 This must be used in combination with
1243 .Fl s Ar max_sectors
1247 Set the HPA configuration password required for unlock calls.
1250 Be quiet, do not print any status messages.
1251 This option will not disable the questions.
1252 To disable questions, use the
1255 .It Fl s Ar max_sectors
1257 Configures the maximum user accessible sectors of the device.
1258 This will change the number of sectors the device reports.
1260 .Em WARNING! WARNING! WARNING!
1262 Changing the max sectors of a device using this option will make the data on
1263 the device beyond the specified value inaccessible.
1266 .Fl s Ar max_sectors
1267 call can be made without a power-on reset or a hardware reset of the device.
1270 Unlock the HPA configuration of the specified device using the given password.
1271 If the password specified doesn't match the password configured via
1273 the command will fail.
1275 After 5 failed unlock calls, due to password miss-match, the device will refuse
1276 additional unlock calls until after a power-on reset.
1279 Confirm yes to dangerous options such as
1281 without prompting for confirmation
1284 The password for all HPA commands is limited to 32 characters, longer passwords
1287 Program firmware of the named SCSI device using the image file provided.
1289 Current list of supported vendors:
1290 .Bl -bullet -offset indent -compact
1305 .Em WARNING! WARNING! WARNING!
1307 Little testing has been done to make sure that different device models from
1308 each vendor work correctly with the fwdownload command.
1309 A vendor name appearing in the supported list means only that firmware of at
1310 least one device type from that vendor has successfully been programmed with
1311 the fwdownload command.
1312 Extra caution should be taken when using this command since there is no
1313 guarantee it will not break a device from the listed vendors.
1314 Ensure that you have a recent backup of the data on the device before
1315 performing a firmware update.
1317 .It Fl f Ar fw_image
1318 Path to the firmware image file to be downloaded to the specified device.
1320 Do not ask for confirmation.
1322 Run in simulation mode.
1323 Packet sizes that will be sent are shown, but no actual packet is sent to the
1325 No confirmation is asked in simulation mode.
1327 Besides showing sense information in case of a failure, the verbose option
1330 to output a line for every firmware segment that is sent to the device by the
1332 -- the same as the ones shown in simulation mode.
1335 Print out verbose usage information.
1340 variable allows the user to specify an alternate mode page format file.
1344 variable determines which text editor
1346 starts when editing mode pages.
1348 .Bl -tag -width /usr/share/misc/scsi_modes -compact
1349 .It Pa /usr/share/misc/scsi_modes
1350 is the SCSI mode format database.
1352 is the transport layer device.
1354 are the CAM application passthrough devices.
1357 .Dl camcontrol eject -n cd -u 1 -v
1359 Eject the CD from cd1, and print SCSI sense information if the command
1362 .Dl camcontrol tur da0
1364 Send the SCSI test unit ready command to da0.
1367 utility will report whether the disk is ready, but will not display sense
1368 information if the command fails since the
1370 switch was not specified.
1371 .Bd -literal -offset indent
1372 camcontrol tur da1 -E -C 4 -t 50 -v
1375 Send a test unit ready command to da1.
1376 Enable kernel error recovery.
1377 Specify a retry count of 4, and a timeout of 50 seconds.
1381 flag) if the command fails.
1382 Since error recovery is turned on, the
1383 disk will be spun up if it is not currently spinning.
1386 utility will report whether the disk is ready.
1387 .Bd -literal -offset indent
1388 camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
1389 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
1392 Issue a READ BUFFER command (0x3C) to cd1.
1393 Display the buffer size of cd1,
1394 and display the first 10 bytes from the cache on cd1.
1396 information if the command fails.
1397 .Bd -literal -offset indent
1398 camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
1399 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
1402 Issue a WRITE BUFFER (0x3B) command to cd1.
1403 Write out 10 bytes of data,
1404 not including the (reserved) 4 byte header.
1405 Print out sense information if
1407 Be very careful with this command, improper use may
1408 cause data corruption.
1409 .Bd -literal -offset indent
1410 camcontrol modepage da3 -m 1 -e -P 3
1413 Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
1414 settings on the drive.
1415 Mode page 1 contains a disk drive's auto read and
1416 write reallocation settings, among other things.
1418 .Dl camcontrol rescan all
1420 Rescan all SCSI busses in the system for devices that have been added,
1423 .Dl camcontrol rescan 0
1425 Rescan SCSI bus 0 for devices that have been added, removed or changed.
1427 .Dl camcontrol rescan 0:1:0
1429 Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
1432 .Dl camcontrol tags da5 -N 24
1434 Set the number of concurrent transactions for da5 to 24.
1435 .Bd -literal -offset indent
1436 camcontrol negotiate -n da -u 4 -T disable
1439 Disable tagged queueing for da4.
1440 .Bd -literal -offset indent
1441 camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
1444 Negotiate a sync rate of 20MHz and an offset of 15 with da3.
1446 Test Unit Ready command to make the settings take effect.
1447 .Bd -literal -offset indent
1448 camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1"
1451 Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs
1453 Display SMP errors if the command fails.
1454 .Bd -literal -offset indent
1455 camcontrol security ada0
1458 Report security support and settings for ada0
1459 .Bd -literal -offset indent
1460 camcontrol security ada0 -u user -s MyPass
1463 Enable security on device ada0 with the password MyPass
1464 .Bd -literal -offset indent
1465 camcontrol security ada0 -u user -e MyPass
1468 Secure erase ada0 which has had security enabled with user password MyPass
1470 .Em WARNING! WARNING! WARNING!
1474 data from the device, so backup your data before using!
1476 This command can be used used against an SSD drive to restoring it to
1477 factory default write performance.
1478 .Bd -literal -offset indent
1482 Report HPA support and settings for ada0 (also reported via
1484 .Bd -literal -offset indent
1485 camcontrol hpa ada0 -s 10240
1488 Enables HPA on ada0 setting the maximum reported sectors to 10240.
1490 .Em WARNING! WARNING! WARNING!
1494 to all data on the device beyond this limit until HPA is disabled by setting
1495 HPA to native max sectors of the device, which can only be done after a
1496 power-on or hardware reset!
1499 use this on a device which has an active filesystem!
1502 .Xr cam_cdbparse 3 ,
1509 utility first appeared in
1512 The mode page editing code and arbitrary SCSI command code are based upon
1517 library, written by Julian Elischer and Peter Dufault.
1520 program first appeared in
1522 and first appeared in
1527 .An Kenneth Merry Aq ken@FreeBSD.org
1529 The code that parses the generic command line arguments does not know that
1530 some of the subcommands take multiple arguments.
1531 So if, for instance, you
1532 tried something like this:
1533 .Bd -literal -offset indent
1534 camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
1537 The sense information from the test unit ready command would not get
1538 printed out, since the first
1542 bails out when it sees the second argument to
1546 Fixing this behavior would take some gross code, or changes to the
1549 The best way to circumvent this problem is to always make sure
1552 arguments before any command-specific arguments.