aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2013-08-25 21:30:30 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2013-08-25 21:30:30 +0000
commit81882618383974e469d24d53fea9b48ffdc972d4 (patch)
tree0b48f9807c4582c86ba5be6460390c796e989b46 /doc
parent7fcdff5b76190f43a549c038d846452057e5843a (diff)
downloadsg3_utils-81882618383974e469d24d53fea9b48ffdc972d4.tar.gz
SG_LIB_CAT_MISCOMPARE; changes to sg_verify and sg_compare_and_write
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@510 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'doc')
-rw-r--r--doc/sg3_utils.86
-rw-r--r--doc/sg_compare_and_write.8108
-rw-r--r--doc/sg_reset.825
-rw-r--r--doc/sg_verify.8101
4 files changed, 162 insertions, 78 deletions
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index c59a30b3..95e49f6a 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "July 2013" "sg3_utils\-1.37" SG3_UTILS
+.TH SG3_UTILS "8" "August 2013" "sg3_utils\-1.37" SG3_UTILS
.SH NAME
sg3_utils \- a package of utilities for sending SCSI commands
.SH SYNOPSIS
@@ -228,6 +228,10 @@ the \fIDEVICE\fR reports an aborted command. In some cases aborted
commands can be retried immediately (e.g. if the transport aborted
the command due to congestion).
.TP
+.B 14
+the \fIDEVICE\fR reports a miscompare sense key. VERIFY and COMPARE AND
+WRITE commands may report this.
+.TP
.B 15
the utility is unable to open, close or use the given \fIDEVICE\fR.
The given file name could be incorrect or there may be permission
diff --git a/doc/sg_compare_and_write.8 b/doc/sg_compare_and_write.8
index 2e85a195..401982df 100644
--- a/doc/sg_compare_and_write.8
+++ b/doc/sg_compare_and_write.8
@@ -1,34 +1,57 @@
-.TH "COMPARE AND WRITE" "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
+.TH "COMPARE AND WRITE" "8" "August 2013" "sg3_utils\-1.37" SG3_UTILS
.SH NAME
sg_compare_and_write \- send the SCSI COMPARE AND WRITE command
.SH SYNOPSIS
.B sg_compare_and_write
[\fI\-\-dpo\fR] [\fI\-\-fua\fR] [\fI\-\-fua_nv\fR] [\fI\-\-help\fR]
-\fI\-\-in=IF\fR \fI\-\-lba=LBA\fR [\fI\-\-num=NUM\fR] [\fI\-\-timeout=TO\fR]
-[\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-wrprotect=WP\fR]
-[\fI\-\-xferlen=LEN\fR] \fIDEVICE\fR
+\fI\-\-in=IF\fR [\fI\-\-inw=WF\fR] \fI\-\-lba=LBA\fR [\fI\-\-num=NUM\fR]
+[\fI\-\-quiet\fR] [\fI\-\-timeout=TO\fR] [\fI\-\-verbose\fR]
+[\fI\-\-version\fR] [\fI\-\-wrprotect=WP\fR] [\fI\-\-xferlen=LEN\fR]
+\fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
-Send the SCSI COMPARE AND WRITE command to \fIDEVICE\fR. This command receives
-a data buffer which contains a verify instance and a write instance each
-containing \fInum\fR blocks, the \fIDEVICE\fR will read \fInum\fR blocks
-starting at logical block address \fILBA\fR, compare the data read from
-the specified blocks to the verify instance and if they match, write the write
-instance to the \fIDEVICE\fR at the same logical block address \fILBA\fR.
-All of the above operations shall be performed as an uninterrupted series of
-actions.
+Send the SCSI COMPARE AND WRITE command to \fIDEVICE\fR. This utility
+reads a compare buffer and a write buffer from either one or two files. If
+the \fI\-\-inw=WF\fR option is not given then the concatenated compare
+and write buffers are read from the file indicated by the \fI\-\-in=IF\fR
+option. If the \fI\-\-inw=WF\fR option is given then the compare buffer
+is read from the file indicated by the \fI\-\-in=IF\fR while the write
+buffer is read from the file indicated by the \fI\-\-inw=WF\fR.
.PP
-The data buffer which contains the verify and write instances are obtained
-from the input file \fIIF\fR, this file is expected to be 2*\fInum\fR blocks
-long. If \fIbs\fR is not specified, then READ CAPACITY(10) is used to
-determine the block size. If not specified, the transfer size will be the
-2*\fInum\fR blocks.
+Those buffers are expected to each contain \fINUM\fR blocks of data. The
+compare starts at at logical block address \fILBA\fR on the \fIDEVICE\fR
+and if the comparison fails (i.e. the provided compare buffer does not
+equal at \fILBA\fR on the \fIDEVICE\fR) then the COMPARE AND WRITE command
+finishes with a sense key of MISCOMPARE. In this case this utility will
+completes and set an exit status of 14 (which happens to be the sense key
+value of MISCOMPARE).
.PP
-In case of a mismatch between the blocks read from \fIDEVICE\fR and the verify
-instance in the data buffer, a check condition will be returned with sense key
-set to miscompare.
+If the comparison succeeds then the provided write buffer is written to
+starting at \fILBA\fR for \fINUM\fR blocks on the \fIDEVICE\fR.
.PP
-This command is defined in SBC\-3 whose most recent revision is 35d. SBC\-3
+The actual number of bytes transferred in the data\-out buffer of the
+COMPARE AND WRITE command may need to be given by the user with the
+\fI\-\-xferlen=LEN\fR option. \fILEN\fR defaults to (2* \fINUM\fR * 512)
+which is 1024 for the default \fINUM\fR of 1. If the block size is
+other than 512 then the user will need to use \fI\-\-xferlen=LEN\fR option.
+If protection information is given (indicated by a value of \fIWP\fR
+other than 0 (the default)) then for a \fINUM\fR of 1 \fILEN\fR should
+be 1040 . Note that the SCSI READ CAPACITY command is not checked by
+this utility (e.g. to find the block size).
+.PP
+The definition of the SCSI COMPARE AND WRITE command requires that the
+\fIDEVICE\fR implement the compare and optional write as an uninterrupted
+series of actions. Depending on some other \fIDEVICE\fR settings a
+verify operation may occur prior to the compare.
+.PP
+When a mismatch occurs between the compare buffer and the blocks starting
+at \fILBA\fR read from the \fIDEVICE\fR the sense buffer containing the
+MISCOMPARE sense key causes several messages to be sent to stderr (including
+the offset of the first byte mismatch). To suppress these messages use the
+\fI\-\-quiet\fR option. With or without the \fI\-\-quiet\fR option the exit
+status will be set to 14.
+.PP
+This command is defined in SBC\-3 whose most recent revision is 35f. SBC\-3
and other SCSI documents can be found at http://www.t10.org .
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
@@ -48,19 +71,33 @@ SBC\-3 revision 35d and its position marked as "reserved".
output the usage message then exit.
.TP
\fB\-i\fR, \fB\-\-in\fR=\fIIF\fR
-read data (binary) from file named \fIIF\fR and use it as the data out
-buffer for the SCSI COMPARE AND WRITE command. The \fIIF\fR shall be at
-2*\fINUM\fR blocks.
+read data (binary) from file named \fIIF\fR. This will either be the combined
+compare and write buffers (when the \fI\-\-inw=WF\fR option is not given) or
+just the compare buffer (when the \fI\-\-inw=WF\fR option is given). If
+\fIIF\fR is '\-' then stdin (e.g. a pipe) is read.
+.TP
+\fB\-D\fR, \fB\-\-inw\fR=\fIWF\fR
+read data (binary) from file named \fIWF\fR. This will the write buffer
+that will become the second half of the data-out buffer sent to the
+\fIDEVICE\fR associated with the COMPARE AND WRITE command. Note that
+when this option is given then the \fI\-\-in=IF\fR is expected to hold
+the associated compare buffer.
.TP
\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
-where \fILBA\fR is the logical block address to start the COMPARE AND WRITE command.
-Assumed to be in decimal unless prefixed with '0x' or has a trailing 'h'.
+where \fILBA\fR is the logical block address to start the COMPARE AND WRITE
+command. Assumed to be in decimal unless prefixed with '0x' or has a
+trailing 'h'.
.TP
\fB\-n\fR, \fB\-\-num\fR=\fINUM\fR
where \fINUM\fR is the number of blocks, starting at \fILBA\fR, to read
and compare with the verify instance. And given a match, the \fINUM\fR of
blocks to write starting \fILBA\fR. The default value for \fINUM\fR is 1.
.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+suppress the sense buffer messages associated with a MISCOMPARE sense key
+that would otherwise be sent to stderr. Still set the exit status to 14
+which is the sense key value indicating a MISCOMPARE.
+.TP
\fB\-t\fR, \fB\-\-timeout\fR=\fITO\fR
where \fITO\fR is the command timeout value in seconds. The default value is
60 seconds. If \fINUM\fR is large (or zero) a WRITE SAME command may require
@@ -78,18 +115,27 @@ implies no protection information is sent (along with the user data) by this
utility.
.TP
\fB\-x\fR, \fB\-\-xferlen\fR=\fILEN\fR
-where \fILEN\fR is the data out buffer length. Defaults to 2*\fINUM\fR blocks.
+where \fILEN\fR is the data out buffer length in byte. It defaults to (2 *
+\fINUM\fR * 512) bytes. If the \fIDEVICE\fR block size is other than 512
+bytes or \fIWP\fR is non-zero (implying additional protection information)
+then this default will be incorrect; the use must supply the correct value
+for \fILEN\fR
.SH NOTES
Various numeric arguments (e.g. \fILBA\fR) may include multiplicative
suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" section
in the sg3_utils(8) man page.
.SH EXIT STATUS
-The exit status of sg_compare_and_write is 0 when it is successful. Otherwise
-see the sg3_utils(8) man page.
+The exit status of sg_compare_and_write is 0 when it is successful. If the
+compare step fails then the exit status is 14. For other exit status values
+see the EXIT STATUS section in the sg3_utils(8) man page.
+.PP
+Earlier versions of this utility set an exit status of 98 when there was a
+MISCOMPARE.
.SH AUTHORS
-Written by Shahar Salzman.
+Written by Shahar Salzman. Maintained by Douglas Gilbert. Additions by
+Eric Seppanen.
.SH "REPORTING BUGS"
-Report bugs to shahar.salzman@kaminario.com
+Report bugs to shahar.salzman@kaminario.com or dgilbert@interlog.com
.SH COPYRIGHT
Copyright \(co 2012\-2013 Kaminario Technologies LTD
diff --git a/doc/sg_reset.8 b/doc/sg_reset.8
index 4eaa8b26..66958074 100644
--- a/doc/sg_reset.8
+++ b/doc/sg_reset.8
@@ -1,4 +1,4 @@
-.TH SG_RESET "8" "February 2013" "sg3_utils\-1.36" SG3_UTILS
+.TH SG_RESET "8" "August 2013" "sg3_utils\-1.37" SG3_UTILS
.SH NAME
sg_reset \- sends SCSI device, target, bus or host reset; or checks reset
state
@@ -24,8 +24,12 @@ may send Low level Drivers (LLDs) the I_T NEXUS RESET task management
function. Alternatively it may use a transport mechanism to do the same
thing (e.g. a hard reset on the link containing a SAS target).
.PP
-In the Linux kernel 2.6 series this utility can be called on sd, sr (cd/dvd),
-st or sg device nodes; if the user has appropriate permissions.
+In the Linux kernel 2.6 and 3 series this utility can be called on sd,
+sr (cd/dvd), st or sg device nodes; if the user has appropriate permissions.
+.PP
+Users of this utility can check whether a reset recovery is already underway
+before trying to send a new reset with this utility. Calling this utility
+with no options, just the \fIDEVICE\fR, will do such a check.
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-bus\fR
@@ -69,15 +73,14 @@ The error recovery code within the Linux kernel (SCSI mid\-level) when faced
with a SCSI command timing out and no response from the device (LU) does the
following. First it tries a device reset and if that is not successful tries
a target reset. If that is not successful it tries a bus reset. If that is
-not successful it tries a host reset. Users of this utility can check whether
-such a recovery is already underway before trying to reset with this utility.
-Calling this utility with no options, just the \fIDEVICE\fR, will do such
-a check. The "device,target,bus,host" order is the reset escalation that the
-\fI\-\-no-esc\fR option attempts to stop. In large storage configurations
-th escalation may be (very) undesirable.
+not successful it tries a host reset. The "device,target,bus,host" order is
+the reset escalation that the \fI\-\-no-esc\fR option attempts to stop. In
+large storage configurations the escalation may be (very) undesirable.
.PP
-This utility calls the SG_SCSI_RESET ioctl and as of lk 3.8.0 the
-\fI\-\-no-esc\fR option is not supported but may be soon after.
+This utility calls the SG_SCSI_RESET ioctl and as of lk 3.10.7 the
+\fI\-\-no-esc\fR option is not supported. Patches to implement this
+functionality have not been accepted. If you want it, post your concern
+to linux-scsi@vger.kernel.org which is the linux-scsi list.
.PP
SAM\-4 and 5 define a hard reset, a LOGICAL UNIT RESET and a I_T NEXUS
RESET. A hard reset is defined to be a power on condition, a microcode
diff --git a/doc/sg_verify.8 b/doc/sg_verify.8
index 15c1c942..aa9e2e58 100644
--- a/doc/sg_verify.8
+++ b/doc/sg_verify.8
@@ -1,14 +1,13 @@
-.TH SG_VERIFY "8" "December 2012" "sg3_utils\-1.35" SG3_UTILS
+.TH SG_VERIFY "8" "August 2013" "sg3_utils\-1.37" SG3_UTILS
.SH NAME
sg_verify \- invoke SCSI VERIFY command(s) on a block device
.SH SYNOPSIS
.B sg_verify
-[\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-bytchk=NDO\fR]
-[\fI\-\-count=COUNT\fR] [\fI\-\-dpo\fR] [\fI\-\-ebytchk=BVAL\fR]
-[\fI\-\-group=GN\fR] [\fI\-\-help\fR] [\fI\-\-in=IF\fR]
-[\fI\-\-lba=LBA\fR] [\fI\-\-readonly\fR] [\fI\-\-verbose\fR]
-[\fI\-\-version\fR] [\fI\-\-vrprotect=VRP\fR]
-\fIDEVICE\fR
+[\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR] [\fI\-\-dpo\fR]
+[\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR] [\fI\-\-help\fR]
+[\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR] [\fI\-\-quiet\fR]
+[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
+[\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
.PP
@@ -16,19 +15,31 @@ Sends one or more SCSI VERIFY (10 or 16) commands to \fIDEVICE\fR. These SCSI
commands are defined in the SBC\-2 (draft) standard at http://www.t10.org and
SBC\-3 drafts.
.PP
-When \fI\-\-bytchk=NDO\fR is not given then the verify starts at the logical
+When \fI\-\-ndo=NDO\fR is not given then the verify starts at the logical
block address given by the \fI\-\-lba=LBA\fR option and continues for
\fI\-\-count=COUNT\fR blocks. No more than \fI\-\-bpc=BPC\fR blocks are
verified by each VERIFY command so if necessary multiple VERIFY commands are
-sent. No news is good news (i.e. if there are no verify errors detected then
-no messages are sent to stderr and the Unix return status is 0).
+sent. Medium verification operations are performed by the \fIDEVICE\fR (e.g.
+assuming each block has additional EEC data, check this against the logical
+block contents). No news is good news (i.e. if there are no verify errors
+detected then no messages are sent to stderr and the Unix exit status is 0).
.PP
-When \fI\-\-bytchk=NDO\fR is given then the \fI\-\-bpc=BPC\fR option is
-ignored. A single verify command is issued and it starts at the logical block
-address given by the \fI\-\-lba=LBA\fR option and continues for
+When \fI\-\-ndo=NDO\fR is given then the \fI\-\-bpc=BPC\fR option is
+ignored. A single VERIFY command is issued and a comparison starts at the
+logical block address given by the \fI\-\-lba=LBA\fR option and continues for
\fI\-\-count=COUNT\fR blocks. The VERIFY command has an associated data\-out
buffer that is \fINDO\fR bytes long. The contents of the data\-out buffer are
obtained from the \fIFN\fR file (if \fI\-\-in=FN\fR is given) or from stdin.
+A comparison takes place between data\-out buffer and the logical blocks
+on the \fIDEVICE\fR. If the comparison is good then no messages are sent to
+stderr and the Unix exit status is 0. If the comparison fails then a sense
+buffer with a sense key of MISCOMPARE is returned; in this case the Unix exit
+status will be 14. Messages will be sent to stderr associated with MISCOMPARE
+sense buffer unless the \fI\-\-quiet\fR option is given.
+.PP
+In SBC\-3 revision 34 the BYTCHK field in all SCSI VERIFY commands was
+expanded from one to two bits. That required some changes in the options
+of this utility, see the section below on OPTION CHANGES.
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
The options are arranged in alphabetical order based on the long
@@ -40,24 +51,16 @@ using an \fI\-\-lba=LBA\fR which is too large, will cause the utility
to issue a VERIFY(16) command.
.TP
\fB\-b\fR, \fB\-\-bpc\fR=\fIBPC\fR
-this option is ignored if \fI\-\-bytchk=NDO\fR is given. Otherwise \fIBPC\fR
+this option is ignored if \fI\-\-ndo=NDO\fR is given. Otherwise \fIBPC\fR
specifies the maximum number of blocks that will be verified by a single SCSI
VERIFY command. The default value is 128 blocks which equates to 64 KB for a
disk with 512 byte blocks. If \fIBPC\fR is less than \fICOUNT\fR then
-multiple SCSI VERIFY commands are sent to the device. For the default
+multiple SCSI VERIFY commands are sent to the \fIDEVICE\fR. For the default
VERIFY(10) \fIBPC\fR cannot exceed 0xffff (65,535) while for VERIFY(16)
\fIBPC\fR cannot exceed 0x7fffffff (2,147,483,647). For recent block
devices (disks) this value may be constrained by the maximum transfer length
field in the block limits VPD page.
.TP
-\fB\-B\fR, \fB\-\-bytchk\fR=\fINDO\fR
-sets the BYTCHK field to one in the VERIFY command. \fINDO\fR is the number
-of bytes to obtain from the \fIFN\fR file (if \fI\-\-in=FN\fR is given) or
-from stdin. Those bytes are placed in the data\-out buffer associated with
-the SCSI VERIFY command. The minimum value for \fINDO\fR is 1 and the
-maximum value is dependant on the OS. The actual value in the BYTCHK field
-in the VERIFY command may be modified by a \fI\-\-ebytchk=BVAL\fR option.
-.TP
\fB\-c\fR, \fB\-\-count\fR=\fICOUNT\fR
where \fICOUNT\fR specifies the number of blocks to verify. The default value
is 1 . If \fICOUNT\fR is greater than \fIBPC\fR (or its default value of 128)
@@ -73,11 +76,11 @@ disable page out changes the cache retention priority of blocks read on
the device's cache to the lowest priority. This means that blocks read by
other commands are more likely to remain in the device's cache.
.TP
-\fB\-E\fR, \fB\-\-ebytchk\fR=\fIBVAL\fR
-sets the BYTCHK field to \fIBVAL\fR overriding the value (1) set by the
-\fI\-\-bytchk=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBVAL\fR
+\fB\-E\fR, \fB\-\-ebytchk\fR=\fIBCH\fR
+sets the BYTCHK field to \fIBCH\fR overriding the value (1) set by the
+\fI\-\-ndo=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR
however sbc3r34 reserves the value 2. If this option is given then
-\fI\-\-bytchk=NDO\fR must also be given. If \fIBVAL\fR is 3 then \fICOUNT\fR
+\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fICOUNT\fR
must be 1 and \fINDO\fR should be the size of one logical block (plus the
size of some or all of the protection infomation if \fIVRP\fR is greater
than 0).
@@ -93,7 +96,7 @@ output the usage message then exit.
\fB\-i\fR, \fB\-\-in\fR=\fIIF\fR
where \fIIF\fR is the name of a file from which \fINDO\fR bytes will be read
and placed in the data\-out buffer. This is only done when the
-\fI\-\-bytchk=NDO\fR option is given. If this option is not given then stdin
+\fI\-\-ndo=NDO\fR option is given. If this option is not given then stdin
is read. If \fIIF\fR is "\-" then stdin is also used.
.TP
\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
@@ -101,6 +104,21 @@ where \fILBA\fR specifies the logical block address of the first block to
start the verify operation. \fILBA\fR is assumed to be decimal unless prefixed
by '0x' or a trailing 'h' (see below). The default value is 0 (i.e. the start
of the device).
+.TP
+\fB\-n\fR, \fB\-\-ndo\fR=\fINDO\fR
+\fINDO\fR is the number of bytes to obtain from the \fIFN\fR file (if
+\fI\-\-in=FN\fR is given) or from stdin. Those bytes are placed in the
+data\-out buffer associated with the SCSI VERIFY command and \fINDO\fR
+is placed in the verification length field in the cdb. The default value
+for \fINDO\fR is 0 and the maximum value is dependant on the OS. If the
+\fI\-\-ebytchk=BCH\fR option is not given then the BYTCHK field in the cdb
+is set to 1.
+.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+suppress the sense buffer messages associated with a MISCOMPARE sense key
+that would otherwise be sent to stderr. Still set the exit status to 14
+which is the sense key value indicating a MISCOMPARE .
+.TP
\fB\-r\fR, \fB\-\-readonly\fR
opens the DEVICE read\-only rather than read\-write which is the
default. The Linux sg driver needs read\-write access for the SCSI
@@ -120,14 +138,14 @@ zero.
BYTCHK is the name of a field (two bits wide) in the VERIFY(10) and
VERIFY(16) commands. When set to 1 or 3 (sbc3r34 reserves the value 2) it
indicates that associated with the SCSI VERIFY command, a data\-out buffer
-will be sent for the device (disk) to check. Using the \fI\-\-bytchk=NDO\fR
+will be sent for the device (disk) to check. Using the \fI\-\-ndo=NDO\fR
option sets the BYTCHK field to 1 and \fINDO\fR is the number of bytes
placed in the data\-out buffer. Those bytes are obtained from stdin or
-\fIIF\fR (from the \fI\-\-in=FN\fR option). The \fI\-\-ebytchk=BVAL\fR
-option may be used to override the BYTCHK field value of 1 with \fIBVAL\fR.
+\fIIF\fR (from the \fI\-\-in=FN\fR option). The \fI\-\-ebytchk=BCH\fR
+option may be used to override the BYTCHK field value of 1 with \fIBCH\fR.
.PP
The calculation of \fINDO\fR is left up to the user. Its value depends
-on the logical block size (which cab be found with the sg_readcap utility),
+on the logical block size (which can be found with the sg_readcap utility),
the \fICOUNT\fR and the \fIVRP\fR values. If the \fIVRP\fR is greater than
0 then each logical block will contain an extra 8 bytes (at least) of
protection information.
@@ -140,6 +158,14 @@ additional data also held on the disk.
Many Operating Systems put limits on the maximum size of the
data\-out (and data\-in) buffer. For Linux at one time the limit was
less than 1 MB but has been increased somewhat.
+.SH OPTION CHANGES
+Earlier versions of this utility had a \fI\-\-bytchk=NDO\fR option which
+set the BYTCHK bit and set the cdb verification length field to \fINDO\fR.
+The shorter form of that option was \fI\-B NDO\fR. For backward
+compatibility that option is still present but not documented. In its place
+is the \fI\-\-ndo=NDO\fR whose shorter form of \fI\-n NDO\fR.
+\fI\-\-ndo=NDO\fR sets the BYTCHK field to 1 unless that is overridden by
+the \fI\-\-ebytchk=BCH\fR.
.SH NOTES
Various numeric arguments (e.g. \fILBA\fR) may include multiplicative
suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" section
@@ -159,14 +185,19 @@ utility.
The SCSI VERIFY(6) command defined in the SSC\-2 standard and later (i.e.
for tape drive systems) is not supported by this utility.
.SH EXIT STATUS
-The exit status of sg_verify is 0 when it is successful. Otherwise see
-the sg3_utils(8) man page.
+The exit status of sg_verify is 0 when it is successful. When \fIBCH\fR is
+other than 0 then a comparison takes place and if it fails then the exit
+status is 14 which happens to be the sense key value of MISCOMPARE.
+Otherwise see the EXIT STATUS section in the sg3_utils(8) man page.
+.PP
+Earlier versions of this utility set an exit status of 98 when there was a
+MISCOMPARE.
.SH AUTHORS
Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2004\-2012 Douglas Gilbert
+Copyright \(co 2004\-2013 Douglas Gilbert
.br
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.