aboutsummaryrefslogtreecommitdiff
path: root/sg_reassign.8
diff options
context:
space:
mode:
Diffstat (limited to 'sg_reassign.8')
-rw-r--r--sg_reassign.8119
1 files changed, 60 insertions, 59 deletions
diff --git a/sg_reassign.8 b/sg_reassign.8
index cbe7a6fb..649227e3 100644
--- a/sg_reassign.8
+++ b/sg_reassign.8
@@ -1,53 +1,55 @@
-.TH SG_REASSIGN "8" "October 2006" "sg3_utils-1.22" SG3_UTILS
+.TH SG_REASSIGN "8" "January 2007" "sg3_utils\-1.23" SG3_UTILS
.SH NAME
-sg_reassign \- reassign defective blocks on the given (disk) device
+sg_reassign \- sends a SCSI REASSIGN BLOCKS command
.SH SYNOPSIS
.B sg_reassign
-[\fI--address=<n>,<n>...\fR] [\fI--dummy\fR] [\fI--eight=0|1\fR]
-[\fI--grown\fR] [\fI--help\fR] [\fI--longlist=0|1\fR] [\fI--primary\fR]
-[\fI--verbose\fR] [\fI--version\fR] \fI<scsi_device>\fR
+[\fI\-\-address=A,A...\fR] [\fI\-\-dummy\fR] [\fI\-\-eight=0|1\fR]
+[\fI\-\-grown\fR] [\fI\-\-help\fR] [\fI\-\-longlist=0|1\fR]
+[\fI\-\-primary\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
.PP
-Send a REASSIGN BLOCKS SCSI command to the given device. Alternatively
+Send a SCSI REASSIGN BLOCKS command to \fIDEVICE\fR. Alternatively
this utility can find the number of element in a "grown" or "primary"
-defect list with a READ DEFECT DATA (10) SCSI command. These SCSI commands
-are defined in SBC-2 for direct access devices (e.g. a disk). Reassign
+defect list with a SCSI READ DEFECT DATA (10) command. These SCSI commands
+are defined in SBC\-2 for direct access devices (e.g. a disk). Reassign
blocks is designed to change the physical location of a logical block
that is known or suspected to be defective to another area on the
media. Disks are typically formatted with blocks held in reserve
for this situation.
.PP
-If neither the '--grown' nor '--primary' option is supplied then one
-or more addresses need to be given. If the address (or all of
-the addresses) fit into 4 bytes and '--eight=1' is not given then
-the parameter block passed to the given device is made up of
-4 byte logical block addresses. If any of the addresses need
-more than 4 bytes to represent (i.e. >= 2**32) or '--eight=1' is given
-then the parameter block passed to the given device is made up of
-8 byte logical block addresses.
+If neither the \fI\-\-grown\fR nor \fI\-\-primary\fR option is supplied
+then one or more addresses need to be given. If the address (or all of
+the addresses) fit into 4 bytes and '\-\-eight=1' is not given then the
+parameter block passed to \fIDEVICE\fR is made up of 4 byte logical block
+addresses. If any of the addresses need more than 4 bytes to
+represent (i.e. >= 2**32) or '\-\-eight=1' is given then the parameter block
+passed to \fIDEVICE\fR is made up of 8 byte logical block addresses.
+.SH OPTIONS
+Arguments to long options are mandatory for short options as well.
.TP
---address=<n>,<n>... | -a <n>,<n>...
-string of comma separated numbers. Each number is interpreted as decimal
-unless prefixed by '0x' or '0X' (or it has a trailing 'h' or 'H'). If
-multiple logical block addresses are given they must be separated by a
-comma. At least one address must be given.
+\fB\-a\fR, \fB\-\-address\fR=\fIA,A...\fR
+where \fIA,A...\fR is a string of comma separated numbers. Each number
+is interpreted as decimal unless prefixed by '0x' or '0X' (or it has a
+trailing 'h' or 'H'). If multiple logical block addresses are given they
+must be separated by a comma. At least one address must be given.
.TP
---address=- | -a -
+\fB\-a\fR, \fB\-\-address\fR=\-
reads one or more logical block addresses from stdin. These may be comma,
space, tab or linefeed (newline) separated. If a line contains "#" then
the remaining characters on that line are ignored. Otherwise each non
-separator character should resolve to a decimal number unless prefixed
-by '0x' or '0X'. At least one address must be given.
+separator sequence of characters should resolve to a decimal number
+unless prefixed by '0x' or '0X' (or has a trailing 'h'). At least one
+address must be given.
.TP
---dummy | -d
-prepare for but do not execute the REASSIGN BLOCKS SCSI command. Since
-the REASSIGN BLOCKS SCSI command is essentially irreversible, paranoid
+\fB\-d\fR, \fB\-\-dummy\fR
+prepare for but do not execute the SCSI REASSIGN BLOCKS command. Since
+the REASSIGN BLOCKS command is essentially irreversible, paranoid
users may wish to check the invocation of this utility before reassigning
-defective blocks on a disk. Useful with '-v -v' for those who wish to
+defective blocks on a disk. Useful with '\-vv' for those who wish to
view the parameter block that will accompany the command.
.TP
---eight=0|1 | -e 0|1
+\fB\-e\fR, \fB\-\-eight\fR=0 | 1
when value is 1 then it sets the 'LONGLBA' flag in the command indicating
that the addresses in the associated parameter block are 8 byte quantities.
When value is 0 then it clears the 'LONGLBA' flag in the command indicating
@@ -55,53 +57,52 @@ that the addresses in the associated parameter block are 4 byte quantities.
If this option is not given then 4 byte quantities are assumed unless one
of the address is too large.
.TP
---grown | -g
-use the READ DEFECT DATA (10) SCSI command to determine the number of
+\fB\-g\fR, \fB\-\-grown\fR
+use the SCSI READ DEFECT DATA (10) command to determine the number of
elements in the "grown defect list". When this option is given there
is no reassignment of blocks (i.e. this utility is passive). When this
-option is given then the '--address=' option is not permitted. See
+option is given then the \fI\-\-address=\fR option is not permitted. See
the discussion below concerning the relationship between reassigned blocks
and the grown defect list. This list is sometimes referred to as the GLIST.
.TP
---help | -h
+\fB\-h\fR, \fB\-\-help\fR
output the usage message then exit.
.TP
---longlist=0|1 | -l 0|1
+\fB\-l\fR, \fB\-\-longlist\fR=0 | 1
sets the REASSIGN BLOCKS cdb field of the same name to the given value.
Only 1000 addresses are permitted so there should be no need to specify
a value of 1. The short list variant restricts the parameter block
length to 2 ** 16 bytes (i.e. about 16000 4 byte addresses or 8000
8 byte addresses). Added for completeness.
.TP
---primary | -p
-use the READ DEFECT DATA (10) SCSI command to determine the number of
+\fB\-p\fR, \fB\-\-primary\fR
+use the SCSI READ DEFECT DATA (10) command to determine the number of
elements in the "primary defect list" which is established during the
manufacturing process. When this option is given there is no reassignment
of blocks (i.e. this utility is passive). When this option is given then
-the '--address=' option is not permitted. This list is sometimes referred
-to as the PLIST.
+the \fI\-\-address=\fR option is not permitted. This list is sometimes
+referred to as the PLIST.
.TP
---verbose | -v
+\fB\-v\fR, \fB\-\-verbose\fR
increase the level of verbosity, (i.e. debug output).
.TP
---version | -V
+\fB\-V\fR, \fB\-\-version\fR
print the version string and then exit.
-.PP
-Note that if the ARRE field (for reads) and/or the AWRE field (for
-writes) are set in the "Read Write Error Recovery" mode page then
-recoverable read and/or write errors cause automatic reassignment
-of the defective block. The PER bit in the same mode page controls
-whether a RECOVERED ERROR sense key is reported on not (PER=1 implies
-do report). Irrespective of the ARRE, AWRE or PER field settings,
-the error counter log pages reflect any errors (recovered or otherwise).
-Whenever a block is reassigned, a new entry is added in the "grown"
-defect list. Apart from doing selftests (see sg_senddiag or
-smartmontools) regularly, monitoring the grown defect list of a disk is
+.SH NOTES
+Note that if the ARRE field (for reads) and/or the AWRE field (for writes)
+are set in the "Read Write Error Recovery" mode page then recoverable read
+and/or write errors cause automatic reassignment of the defective block. The
+PER bit in the same mode page controls whether a RECOVERED ERROR sense key
+is reported on not (PER=1 implies do report). Irrespective of the ARRE, AWRE
+or PER field settings, the error counter log pages reflect any
+errors (recovered or otherwise). Whenever a block is reassigned, a new entry
+is added in the "grown" defect list. Apart from doing selftests (see
+sg_senddiag or smartmontools) regularly, monitoring the grown defect list of a disk is
a reasonable metric of its health. If the grown list starts growing
quickly that is an ominous sign. The best grown defect lists are empty
ones. The number of elements in the grown defect list can be viewed with
-the '--grown' option. The contents of the grown defect list can be
-viewed with the 'sginfo -G' utility.
+the \fI\-\-grown\fR option. The contents of the grown defect list can be
+viewed with the 'sginfo \-G' utility.
.PP
If an unrecoverable error is detected at a logical block address then
REASSIGN BLOCKS is needed to reassign the block. Also if the ARRE and/or
@@ -117,11 +118,11 @@ is exhausted subsequent invocations of this utility may result in
a sense key of hardware error and an additional sense of 'No defect
spare location available'. The next step would be to reformat the
disk (or get a replacement).
-.SH NOTES
-The SBC-2 draft standard (revision 16) notes that when multiple addresses
-are given to the REASSIGN BLOCKS SCSI command and there is some failure
+.PP
+The SBC\-2 draft standard (revision 16) notes that when multiple addresses
+are given to the SCSI REASSIGN BLOCKS command and there is some failure
at one of the later addresses then all addresses prior to that have already
-be reassigned. Care should be taken in such a case. Re-executing the command
+be reassigned. Care should be taken in such a case. Re\-executing the command
with the same addresses will cause the earlier addresses to be reassigned
again. At some stage the disk will run out of reserved locations.
So unless a large number of addresses are involved it may be safer to
@@ -134,10 +135,10 @@ Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2005-2006 Douglas Gilbert
+Copyright \(co 2005\-2007 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.
.SH "SEE ALSO"
-.B sg_format(sg3_utils), sdparm(sdparm), sginfo(sg3_utils)
+.B sg_format,sginfo,sg_senddiag(all in sg3_utils), sdparm(sdparm),
.B smartmontools(internet, sourceforge)