summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-07-02 21:45:06 +0000
committerru <ru@FreeBSD.org>2004-07-02 21:45:06 +0000
commit46fddaa54b09baa407fa66a14d46c0cc3a906e60 (patch)
tree602e903272257a1c5b455a48800dcaa680741026 /sbin/camcontrol
parent20fbd172b22ab587e9d796f4cb8664a235cebe78 (diff)
downloadFreeBSD-src-46fddaa54b09baa407fa66a14d46c0cc3a906e60.zip
FreeBSD-src-46fddaa54b09baa407fa66a14d46c0cc3a906e60.tar.gz
Mechanically kill hard sentence breaks.
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/camcontrol.8297
1 files changed, 197 insertions, 100 deletions
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index 84c3bf9..04eac548 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -152,38 +152,44 @@ CAM subsystem.
The
.Nm
utility
-can cause a loss of data and/or system crashes if used improperly. Even
+can cause a loss of data and/or system crashes if used improperly.
+Even
expert users are encouraged to exercise caution when using this command.
Novice users should stay away from this utility.
.Pp
The
.Nm
utility has a number of primary functions, many of which support an optional
-device identifier. A device identifier can take one of three forms:
+device identifier.
+A device identifier can take one of three forms:
.Bl -tag -width 14n
.It deviceUNIT
Specify a device name and unit number combination, like "da5" or "cd3".
-Note that character device node names (e.g. /dev/da0) are
+Note that character device node names (e.g.\& /dev/da0) are
.Em not
allowed here.
.It bus:target
-Specify a bus number and target id. The bus number can be determined from
+Specify a bus number and target id.
+The bus number can be determined from
the output of
.Dq camcontrol devlist .
The lun defaults to 0.
.It bus:target:lun
-Specify the bus, target and lun for a device. (e.g. 1:2:0)
+Specify the bus, target and lun for a device.
+(e.g.\& 1:2:0)
.El
.Pp
The device identifier, if it is specified,
.Em must
come immediately after the function name, and before any generic or
-function-specific arguments. Note that the
+function-specific arguments.
+Note that the
.Fl n
and
.Fl u
arguments described below will override any device name or unit number
-specified beforehand. The
+specified beforehand.
+The
.Fl n
and
.Fl u
@@ -196,24 +202,28 @@ Most of the
primary functions support these generic arguments:
.Bl -tag -width 14n
.It Fl C Ar count
-SCSI command retry count. In order for this to work, error recovery
+SCSI command retry count.
+In order for this to work, error recovery
.Pq Fl E
must be turned on.
.It Fl E
Instruct the kernel to perform generic SCSI error recovery for the given
-command. This is needed in order for the retry count
+command.
+This is needed in order for the retry count
.Pq Fl C
-to be honored. Other than retrying commands, the generic error recovery in
+to be honored.
+Other than retrying commands, the generic error recovery in
the code will generally attempt to spin up drives that are not spinning.
It may take some other actions, depending upon the sense code returned from
the command.
.It Fl n Ar dev_name
-Specify the device type to operate on, e.g. "da", "cd".
+Specify the device type to operate on, e.g.\& "da", "cd".
.It Fl t Ar timeout
-SCSI command timeout in seconds. This overrides the default timeout for
+SCSI command timeout in seconds.
+This overrides the default timeout for
any given command.
.It Fl u Ar unit_number
-Specify the device unit number, e.g. "1", "5".
+Specify the device unit number, e.g.\& "1", "5".
.It Fl v
Be verbose, print out sense information for failed SCSI commands.
.El
@@ -236,16 +246,19 @@ The
.Nm
utility will report whether the device is ready or not.
.It Ic inquiry
-Send a SCSI inquiry command (0x12) to a device. By default,
+Send a SCSI inquiry command (0x12) to a device.
+By default,
.Nm
will print out the standard inquiry data, device serial number, and
-transfer rate information. The user can specify that only certain types of
+transfer rate information.
+The user can specify that only certain types of
inquiry data be printed:
.Bl -tag -width 4n
.It Fl D
Get the standard inquiry data.
.It Fl S
-Print out the serial number. If this flag is the only one specified,
+Print out the serial number.
+If this flag is the only one specified,
.Nm
will not print out "Serial Number" before the value returned by the drive.
This is to aid in script writing.
@@ -268,8 +281,10 @@ start bit cleared and the load/eject bit set.
Tell the kernel to scan all busses in the system (with the
.Ar all
argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
-(XPT_SCAN_LUN) for new devices or devices that have gone away. The user
-may specify a scan of all busses, a single bus, or a lun. Scanning all luns
+(XPT_SCAN_LUN) for new devices or devices that have gone away.
+The user
+may specify a scan of all busses, a single bus, or a lun.
+Scanning all luns
on a target isn't supported.
.It Ic reset
Tell the kernel to reset all busses in the system (with the
@@ -292,9 +307,13 @@ to print out the list as logical blocks,
.Em bfi ,
to print out the list in bytes from index format, and
.Em phys ,
-to print out the list in physical sector format. The format argument is
-required. Most drives support the physical sector format. Some drives
-support the logical block format. Many drives, if they don't support the
+to print out the list in physical sector format.
+The format argument is
+required.
+Most drives support the physical sector format.
+Some drives
+support the logical block format.
+Many drives, if they don't support the
requested format, return the data in an alternate format, along with sense
information indicating that the requested data format isn't supported.
The
@@ -306,7 +325,8 @@ support the requested format,
.Nm
will probably see the error as a failure to complete the request.
.It Fl G
-Print out the grown defect list. This is a list of bad blocks that have
+Print out the grown defect list.
+This is a list of bad blocks that have
been remapped since the disk left the factory.
.It Fl P
Print out the primary defect list.
@@ -321,7 +341,8 @@ is specified,
will print out the number of defects given in the READ DEFECT DATA header
returned from the drive.
.It Ic modepage
-Allows the user to display and optionally edit a SCSI mode page. The mode
+Allows the user to display and optionally edit a SCSI mode page.
+The mode
page formats are located in
.Pa /usr/share/misc/scsi_modes .
This can be overridden by specifying a different file in the
@@ -336,24 +357,28 @@ Disable block descriptors for mode sense.
.It Fl b
Displays mode page data in binary format.
.It Fl e
-This flag allows the user to edit values in the mode page. The user may
+This flag allows the user to edit values in the mode page.
+The user may
either edit mode page values with the text editor pointed to by his
.Ev EDITOR
environment variable, or supply mode page values via standard input, using
the same format that
.Nm
-uses to display mode page values. The editor will be invoked if
+uses to display mode page values.
+The editor will be invoked if
.Nm
detects that standard input is terminal.
.It Fl l
Lists all available mode pages.
.It Fl m Ar mode_page
This specifies the number of the mode page the user would like to view
-and/or edit. This argument is mandatory unless
+and/or edit.
+This argument is mandatory unless
.Fl l
is specified.
.It Fl P Ar pgctl
-This allows the user to specify the page control field. Possible values are:
+This allows the user to specify the page control field.
+Possible values are:
.Bl -tag -width xxx -compact
.It 0
Current values
@@ -371,8 +396,10 @@ The
.Ic cmd
function requires the
.Fl c
-argument to specify the CDB. Other arguments are optional, depending on
-the command type. The command and data specification syntax is documented
+argument to specify the CDB.
+Other arguments are optional, depending on
+the command type.
+The command and data specification syntax is documented
in
.Xr cam_cdbparse 3 .
NOTE: If the CDB specified causes data to be transfered to or from the
@@ -382,7 +409,8 @@ or
.Fl o .
.Bl -tag -width 17n
.It Fl c Ar cmd Op args
-This specifies the SCSI CDB. CDBs may be 6, 10, 12 or 16 bytes.
+This specifies the SCSI CDB.
+CDBs may be 6, 10, 12 or 16 bytes.
.It Fl i Ar len Ar fmt
This specifies the amount of data to read, and how it should be displayed.
If the format is
@@ -391,15 +419,19 @@ If the format is
bytes of data will be read from the device and written to standard output.
.It Fl o Ar len Ar fmt Op args
This specifies the amount of data to be written to a device, and the data
-that is to be written. If the format is
+that is to be written.
+If the format is
.Sq - ,
.Ar len
bytes of data will be read from standard input and written to the device.
.El
.It Ic debug
-Turn on CAM debugging printfs in the kernel. This requires options CAMDEBUG
-in your kernel config file. WARNING: enabling debugging printfs currently
-causes an EXTREME number of kernel printfs. You may have difficulty
+Turn on CAM debugging printfs in the kernel.
+This requires options CAMDEBUG
+in your kernel config file.
+WARNING: enabling debugging printfs currently
+causes an EXTREME number of kernel printfs.
+You may have difficulty
turning off the debugging printfs once they start, since the kernel will be
busy printing messages and unable to service other requests quickly.
The
@@ -417,46 +449,57 @@ Enable CAM_DEBUG_SUBTRACE printfs.
.It Fl X
Enable CAM_DEBUG_XPT printfs.
.It Fl c
-Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the
+Enable CAM_DEBUG_CDB printfs.
+This will cause the kernel to print out the
SCSI CDBs sent to the specified device(s).
.It all
Enable debugging for all devices.
.It off
Turn off debugging for all devices
.It bus Ns Op :target Ns Op :lun
-Turn on debugging for the given bus, target or lun. If the lun or target
-and lun are not specified, they are wildcarded. (i.e., just specifying a
+Turn on debugging for the given bus, target or lun.
+If the lun or target
+and lun are not specified, they are wildcarded.
+(i.e., just specifying a
bus turns on debugging printfs for all devices on that bus.)
.El
.It Ic tags
Show or set the number of "tagged openings" or simultaneous transactions
-we attempt to queue to a particular device. By default, the
+we attempt to queue to a particular device.
+By default, the
.Ic tags
-command, with no command-specific arguments (i.e. only generic arguments)
+command, with no command-specific arguments (i.e., only generic arguments)
prints out the "soft" maximum number of transactions that can be queued to
-the device in question. For more detailed information, use the
+the device in question.
+For more detailed information, use the
.Fl v
argument described below.
.Bl -tag -width 7n
.It Fl N Ar tags
-Set the number of tags for the given device. This must be between the
-minimum and maximum number set in the kernel quirk table. The default for
+Set the number of tags for the given device.
+This must be between the
+minimum and maximum number set in the kernel quirk table.
+The default for
most devices that support tagged queueing is a minimum of 2 and a maximum
-of 255. The minimum and maximum values for a given device may be
+of 255.
+The minimum and maximum values for a given device may be
determined by using the
.Fl v
-switch. The meaning of the
+switch.
+The meaning of the
.Fl v
switch for this
.Nm
subcommand is described below.
.It Fl q
-Be quiet, and don't report the number of tags. This is generally used when
+Be quiet, and don't report the number of tags.
+This is generally used when
setting the number of tags.
.It Fl v
The verbose flag has special functionality for the
.Em tags
-argument. It causes
+argument.
+It causes
.Nm
to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
.Bl -tag -width 13n
@@ -465,55 +508,68 @@ This is the amount of capacity for transactions queued to a given device.
.It dev_active
This is the number of transactions currently queued to a device.
.It devq_openings
-This is the kernel queue space for transactions. This count usually mirrors
+This is the kernel queue space for transactions.
+This count usually mirrors
dev_openings except during error recovery operations when
the device queue is frozen (device is not allowed to receive
commands), the number of dev_openings is reduced, or transaction
replay is occurring.
.It devq_queued
This is the number of transactions waiting in the kernel queue for capacity
-on the device. This number is usually zero unless error recovery is in
+on the device.
+This number is usually zero unless error recovery is in
progress.
.It held
The held count is the number of CCBs held by peripheral drivers that have
either just been completed or are about to be released to the transport
-layer for service by a device. Held CCBs reserve capacity on a given
+layer for service by a device.
+Held CCBs reserve capacity on a given
device.
.It mintags
This is the current "hard" minimum number of transactions that can be
-queued to a device at once. The
+queued to a device at once.
+The
.Ar dev_openings
-value above cannot go below this number. The default value for
+value above cannot go below this number.
+The default value for
.Ar mintags
is 2, although it may be set higher or lower for various devices.
.It maxtags
This is the "hard" maximum number of transactions that can be queued to a
-device at one time. The
+device at one time.
+The
.Ar dev_openings
-value cannot go above this number. The default value for
+value cannot go above this number.
+The default value for
.Ar maxtags
is 255, although it may be set higher or lower for various devices.
.El
.El
.It Ic negotiate
-Show or negotiate various communication parameters. Some controllers may
-not support setting or changing some of these values. For instance, the
+Show or negotiate various communication parameters.
+Some controllers may
+not support setting or changing some of these values.
+For instance, the
Adaptec 174x controllers do not support changing a device's sync rate or
offset.
The
.Nm
utility
will not attempt to set the parameter if the controller indicates that it
-does not support setting the parameter. To find out what the controller
+does not support setting the parameter.
+To find out what the controller
supports, use the
.Fl v
-flag. The meaning of the
+flag.
+The meaning of the
.Fl v
flag for the
.Ic negotiate
-command is described below. Also, some controller drivers don't support
+command is described below.
+Also, some controller drivers don't support
setting negotiation parameters, even if the underlying controller supports
-negotiation changes. Some controllers, such as the Advansys wide
+negotiation changes.
+Some controllers, such as the Advansys wide
controllers, support enabling and disabling synchronous negotiation for
a device, but do not support setting the synchronous negotiation rate.
.Bl -tag -width 17n
@@ -521,41 +577,51 @@ a device, but do not support setting the synchronous negotiation rate.
Attempt to make the negotiation settings take effect immediately by sending
a Test Unit Ready command to the device.
.It Fl c
-Show or set current negotiation settings. This is the default.
+Show or set current negotiation settings.
+This is the default.
.It Fl D Ar enable|disable
Enable or disable disconnection.
.It Fl O Ar offset
Set the command delay offset.
.It Fl q
-Be quiet, don't print anything. This is generally useful when you want to
+Be quiet, don't print anything.
+This is generally useful when you want to
set a parameter, but don't want any status information.
.It Fl R Ar syncrate
-Change the synchronization rate for a device. The sync rate is a floating
-point value specified in MHz. So, for instance,
+Change the synchronization rate for a device.
+The sync rate is a floating
+point value specified in MHz.
+So, for instance,
.Sq 20.000
is a legal value, as is
.Sq 20 .
.It Fl T Ar enable|disable
Enable or disable tagged queueing for a device.
.It Fl U
-Show or set user negotiation settings. The default is to show or set
+Show or set user negotiation settings.
+The default is to show or set
current negotiation settings.
.It Fl v
The verbose switch has special meaning for the
.Ic negotiate
-subcommand. It causes
+subcommand.
+It causes
.Nm
to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
controller driver.
.It Fl W Ar bus_width
-Specify the bus width to negotiate with a device. The bus width is
-specified in bits. The only useful values to specify are 8, 16, and 32
-bits. The controller must support the bus width in question in order for
+Specify the bus width to negotiate with a device.
+The bus width is
+specified in bits.
+The only useful values to specify are 8, 16, and 32
+bits.
+The controller must support the bus width in question in order for
the setting to take effect.
.El
.Pp
In general, sync rate and offset settings will not take effect for a
-device until a command has been sent to the device. The
+device until a command has been sent to the device.
+The
.Fl a
switch above will automatically send a Test Unit Ready to the device so
negotiation parameters will take effect.
@@ -566,27 +632,36 @@ FORMAT UNIT command to the named device.
.Pp
.Em WARNING! WARNING! WARNING!
.Pp
-Low level formatting a disk will destroy ALL data on the disk. Use
-extreme caution when issuing this command. Many users low-level format
-disks that do not really need to be low-level formatted. There are
+Low level formatting a disk will destroy ALL data on the disk.
+Use
+extreme caution when issuing this command.
+Many users low-level format
+disks that do not really need to be low-level formatted.
+There are
relatively few scenarios that call for low-level formatting a disk.
One reason for
low-level formatting a disk is to initialize the disk after changing
-its physical sector size. Another reason for low-level formatting a disk
+its physical sector size.
+Another reason for low-level formatting a disk
is to revive the disk if you are getting "medium format corrupted" errors
from the disk in response to read and write requests.
.Pp
-Some disks take longer than others to format. Users should specify a
-timeout long enough to allow the format to complete. The default format
-timeout is 3 hours, which should be long enough for most disks. Some hard
+Some disks take longer than others to format.
+Users should specify a
+timeout long enough to allow the format to complete.
+The default format
+timeout is 3 hours, which should be long enough for most disks.
+Some hard
disks will complete a format operation in a very short period of time
-(on the order of 5 minutes or less). This is often because the drive
+(on the order of 5 minutes or less).
+This is often because the drive
doesn't really support the FORMAT UNIT command -- it just accepts the
command, waits a few minutes and then returns it.
.Pp
The
.Sq format
-subcommand takes several arguments that modify its default behavior. The
+subcommand takes several arguments that modify its default behavior.
+The
.Fl q
and
.Fl y
@@ -594,21 +669,27 @@ arguments can be useful for scripts.
.Pp
.Bl -tag -width 6n
.It Fl q
-Be quiet, don't print any status messages. This option will not disable
-the questions, however. To disable questions, use the
+Be quiet, don't print any status messages.
+This option will not disable
+the questions, however.
+To disable questions, use the
.Fl y
argument, below.
.It Fl w
-Issue a non-immediate format command. By default,
+Issue a non-immediate format command.
+By default,
.Nm
-issues the FORMAT UNIT command with the immediate bit set. This tells the
+issues the FORMAT UNIT command with the immediate bit set.
+This tells the
device to immediately return the format command, before the format has
-actually completed. Then,
+actually completed.
+Then,
.Nm
gathers
.Tn SCSI
sense information from the device every second to determine how far along
-in the format process it is. If the
+in the format process it is.
+If the
.Fl w
argument is specified,
.Nm
@@ -616,10 +697,12 @@ will issue a non-immediate format command, and will be unable to print any
information to let the user know what percentage of the disk has been
formatted.
.It Fl y
-Don't ask any questions. By default,
+Don't ask any questions.
+By default,
.Nm
will ask the user if he/she really wants to format the disk in question,
-and also if the default format command timeout is acceptable. The user
+and also if the default format command timeout is acceptable.
+The user
will not be asked about the timeout if a timeout is specified on the
command line.
.El
@@ -665,11 +748,14 @@ switch was not specified.
camcontrol tur da1 -E -C 4 -t 50 -v
.Ed
.Pp
-Send a test unit ready command to da1. Enable kernel error recovery.
-Specify a retry count of 4, and a timeout of 50 seconds. Enable sense
+Send a test unit ready command to da1.
+Enable kernel error recovery.
+Specify a retry count of 4, and a timeout of 50 seconds.
+Enable sense
printing (with the
.Fl v
-flag) if the command fails. Since error recovery is turned on, the
+flag) if the command fails.
+Since error recovery is turned on, the
disk will be spun up if it is not currently spinning.
The
.Nm
@@ -679,8 +765,10 @@ camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
-i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
.Ed
.Pp
-Issue a READ BUFFER command (0x3C) to cd1. Display the buffer size of cd1,
-and display the first 10 bytes from the cache on cd1. Display SCSI sense
+Issue a READ BUFFER command (0x3C) to cd1.
+Display the buffer size of cd1,
+and display the first 10 bytes from the cache on cd1.
+Display SCSI sense
information if the command fails.
.Pp
.Bd -literal -offset indent
@@ -688,9 +776,12 @@ camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
-o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
.Ed
.Pp
-Issue a WRITE BUFFER (0x3B) command to cd1. Write out 10 bytes of data,
-not including the (reserved) 4 byte header. Print out sense information if
-the command fails. Be very careful with this command, improper use may
+Issue a WRITE BUFFER (0x3B) command to cd1.
+Write out 10 bytes of data,
+not including the (reserved) 4 byte header.
+Print out sense information if
+the command fails.
+Be very careful with this command, improper use may
cause data corruption.
.Pp
.Bd -literal -offset indent
@@ -698,7 +789,8 @@ camcontrol modepage da3 -m 1 -e -P 3
.Ed
.Pp
Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
-settings on the drive. Mode page 1 contains a disk drive's auto read and
+settings on the drive.
+Mode page 1 contains a disk drive's auto read and
write reallocation settings, among other things.
.Pp
.Dl camcontrol rescan all
@@ -729,7 +821,8 @@ Disable tagged queueing for da4.
camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
.Ed
.Pp
-Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a
+Negotiate a sync rate of 20MHz and an offset of 15 with da3.
+Then send a
Test Unit Ready command to make the settings take effect.
.Sh SEE ALSO
.Xr cam 3 ,
@@ -748,7 +841,8 @@ code in the old
.Xr scsi 8
utility and
.Xr scsi 3
-library, written by Julian Elischer and Peter Dufault. The
+library, written by Julian Elischer and Peter Dufault.
+The
.Xr scsi 8
program first appeared in
.Bx 386 0.1.2.4 ,
@@ -760,7 +854,8 @@ in
.An Kenneth Merry Aq ken@FreeBSD.org
.Sh BUGS
The code that parses the generic command line arguments doesn't know that
-some of the subcommands take multiple arguments. So if, for instance, you
+some of the subcommands take multiple arguments.
+So if, for instance, you
tried something like this:
.Bd -literal -offset indent
camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
@@ -774,9 +869,11 @@ call in
bails out when it sees the second argument to
.Fl c
(0x00),
-above. Fixing this behavior would take some gross code, or changes to the
+above.
+Fixing this behavior would take some gross code, or changes to the
.Xr getopt 3
-interface. The best way to circumvent this problem is to always make sure
+interface.
+The best way to circumvent this problem is to always make sure
to specify generic
.Nm
arguments before any command-specific arguments.
OpenPOWER on IntegriCloud