aboutsummaryrefslogtreecommitdiff
path: root/sg_format.8
diff options
context:
space:
mode:
Diffstat (limited to 'sg_format.8')
-rw-r--r--sg_format.8109
1 files changed, 63 insertions, 46 deletions
diff --git a/sg_format.8 b/sg_format.8
index e25d60be..be7842fe 100644
--- a/sg_format.8
+++ b/sg_format.8
@@ -1,13 +1,13 @@
-.TH SG_FORMAT "8" "January 2007" "sg3_utils\-1.23" SG3_UTILS
+.TH SG_FORMAT "8" "May 2007" "sg3_utils\-1.24" SG3_UTILS
.SH NAME
sg_format \- format or resize a SCSI disk (perhaps change its block size)
.SH SYNOPSIS
.B sg_format
-[\fI\-\-cmplst=\fR0|1] [\fI\-\-count=COUNT\fR] [\fI\-\-early\fR]
-[\fI\-\-format\fR] [\fI\-\-help\fR] [\fI\-\-long\fR] [\fI\-\-pfu=PFU\fR]
-[\fI\-\-pinfo\fR] [\fI\-\-resize\fR] [\fI\-\-rto_req\fR] [\fI\-\-six\fR]
-[\fI\-\-size=SIZE\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
-[\fI\-\-wait\fR] \fIDEVICE\fR
+[\fI\-\-cmplst=\fR0|1] [\fI\-\-count=COUNT\fR] [\fI\-\-dcrt\fR]
+[\fI\-\-early\fR] [\fI\-\-format\fR] [\fI\-\-help\fR] [\fI\-\-long\fR]
+[\fI\-\-pfu=PFU\fR] [\fI\-\-pinfo\fR] [\fI\-\-resize\fR] [\fI\-\-rto_req\fR]
+[\fI\-\-security\fR] [\fI\-\-six\fR] [\fI\-\-size=SIZE\fR] [\fI\-\-verbose\fR]
+[\fI\-\-version\fR] [\fI\-\-wait\fR] \fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
.PP
@@ -24,10 +24,10 @@ block size (if permitted) and the block count (i.e. number of accessible
blocks on the media also known as "resizing"). Resizing a disk to less
than the manufacturer's recommended block count is sometimes called "short
stroking" (see NOTES section). Resizing the block count while not changing
-the block size may not require a format operation. Recent changes to the
-SBC\-2 draft standard (see www.t10.org) have obsoleted the "format device"
-mode page. Many of the low level details found in that mode page are now
-left up to the discretion of the manufacturer.
+the block size may not require a format operation. The SBC\-2 standard (see
+www.t10.org) has obsoleted the "format device" mode page. Many of the low
+level details found in that mode page are now left up to the discretion of
+the manufacturer.
.PP
When this utility is used without options (apart from a device name)
then it prints out the existing block size and block count derived
@@ -36,25 +36,26 @@ to a MODE SENSE command and the response to a READ CAPACITY command.
The reason for this double check is to detect a "format corrupt"
state (see NOTES section).
.PP
-A recent addition in the SBC\-2 is "protection information". See
-the section of that name (section 4.16 in draft SBC\-2 rev 16). It adds
-an extra 8 bytes of protection information to each block (a 2 byte "logical
-block guard" (CRC), a 2 byte "logical block application guard", and a
-4 byte "logical block reference tag"). A device that supports
-protection information sets the "protect" bit in a standard INQUIRY
-response. The "FMTPINFO" and "RTO_REQ" bits in the FORMAT command cdb
-are associated with protection information and can be set by this
-utility.
+Recent SBC\-3 drafts add several "protection types" to the "protection
+information" introduced in the SBC\-2 standard. See the "protection
+information" section (section 4.17 in draft SBC\-3 rev 8). 8 bytes of
+protection information are added to each block (a 2 byte "logical block
+guard" (CRC), a 2 byte "logical block application guard", and a 4
+byte "logical block reference tag"). A device that supports protection
+information sets the "protect" bit in a standard INQUIRY response.
+The "FMTPINFO" and "RTO_REQ" bits in the FORMAT command cdb plus
+the "Protection Field Usage" in the parameter header are associated with
+protection information and can be set by this utility.
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
.TP
\fB\-C\fR, \fB\-\-cmplst\fR=0 | 1
sets the CMPLST ("complete list") bit in the FORMAT cdb to 0 or 1.
The default is 1 in which case the existing GLIST (grown list) is ignored.
-If the value is 0 then th existing GLIST is taken into account. See the
+If the value is 0 then the existing GLIST is taken into account. See the
LISTS section below. Active when the \fI\-\-format\fR option is given. In
most cases this bit should be left set; some MO disk drives need this bit
-cleared. The SCSI to ATA Translation (SAT) draft standard (sat\-r09)
+cleared. The SCSI to ATA Translation (SAT) standard (prior draft: sat\-r09)
requires this bit to be cleared.
.TP
\fB\-c\fR, \fB\-\-count\fR=\fICOUNT\fR
@@ -97,14 +98,23 @@ In both cases if the given \fICOUNT\fR exceeds the maximum number of
blocks (for the block size) then the disk reports an error.
See NOTES section below.
.TP
+\fB\-D\fR, \fB\-\-dcrt\fR
+this option sets the DCRT bit in the FORMAT command's parameter list header.
+It will "disable certification" which is the verification step used to check
+during the format process that blocks are usable. Using this option may
+speed the format. The default action of this utility (i.e. when this option
+is not given) is to clear the DCRT bit thereby requesting "media
+certification". When the DCRT bit is set, the FOV bit must also be set hence
+sg_format does that.
+.TP
\fB\-e\fR, \fB\-\-early\fR
this option is active when \fI\-\-format\fR is given. The default action of
this utility is to poll the disk every 30 seconds to determine the progress
of the format operation until it is finished. When this option is given this
utility will exit "early" as soon as the format has commenced. Then the
user can monitor the progress of the ongoing format operation with other
-utilities (e.g. sg_turs or sg_requests). This option and \fI\-\-wait\fR
-cannot both be given.
+utilities (e.g. sg_turs(8) or sg_requests(8)). This option and
+\fI\-\-wait\fR cannot both be given.
.TP
\fB\-F\fR, \fB\-\-format\fR
issue a SCSI FORMAT command.
@@ -130,8 +140,10 @@ supports "protection information" then this option may also be useful.
.TP
\fB\-P\fR, \fB\-\-pfu\fR=\fIPFU\fR
sets the "Protection Field Usage" field in the parameter block associated
-with a FORMAT command to \fIPFU\fR. The default value is 0, values in the
-range 0 to 7 may be given.
+with a FORMAT command to \fIPFU\fR. The default value is 0, the only other
+defined value currently is 1. Used together with \fI\-\-pinfo\fR and
+\fI\-\-rto_req\fR to specify the "protection type" to format the disk
+to (see SBC\-3).
.TP
\fB\-p\fR, \fB\-\-pinfo\fR
instructs a format operation to add an extra 8 bytes of protection
@@ -156,6 +168,12 @@ FORMAT cdb). The default action is to disable application client
ownership of that field. Has no action unless both \fI\-\-format\fR
and \fI\-\-pinfo\fR are given.
.TP
+\fB\-S\fR, \fB\-\-security\fR
+sets the "Security Initialization" (SI) bit in the FORMAT command's
+initialization pattern descriptor within the parameter list. According
+to SBC\-3 the default initialization pattern "shall be written using a
+security erasure write technique".
+.TP
\fB\-6\fR, \fB\-\-six\fR
Use 6 byte variants of MODE SENSE and MODE SELECT. The default action
is to use the 10 byte variants. Some MO drives need this option set
@@ -190,15 +208,15 @@ until the format operation completes before returning its response. This
can be several hours on large disks. This utility sets a four hour timeout
on such a FORMAT UNIT command.
.SH LISTS
-The SBC\-3 draft (revision 6) defines PLIST, CLIST, DLIST and GLIST in
+The SBC\-3 draft (revision 8) defines PLIST, CLIST, DLIST and GLIST in
section 4.8 on "Medium defects". Briefly, the PLIST is the "primary"
list of manufacturer detected defects, the CLIST ("certification" list)
-are those detected during the format operation, the DLIST is a list
-of defects that can be given to the format operation. The GLIST
-is the grown list which starts in the format process as CLIST+DLIST
-and can "grow" later due to automatic reallocation (see the
-ARRE and AWRE bits in the read\-write error recovery mode page (see
-sdparm)) and use of the SCSI REASSIGN BLOCKS command (see sg_reassign).
+are those detected during the format operation, the DLIST is a list of
+defects that can be given to the format operation. The GLIST is the grown
+list which starts in the format process as CLIST+DLIST and can "grow" later
+due to automatic reallocation (see the ARRE and AWRE bits in the
+read\-write error recovery mode page (see sdparm(8))) and use of the
+SCSI REASSIGN BLOCKS command (see sg_reassign(8)).
.PP
The CMPLST bit (controlled by the \fI\-\-cmplst=\fR0|1 option) determines
whether the existing GLIST, when the format operation is invoked,
@@ -210,13 +228,12 @@ The sg_format utility does not permit a user to provide a defect
list (i.e. DLIST). All protection information options are
defaulted to off.
.SH NOTES
-The SBC\-2 draft standard (revision 16) says that the REQUEST SENSE command
-should be used for obtaining a progress indication when the format
-command returns prior to the completion of the format operation.
-However, tests on a selection of recent disks shows that TEST UNIT READY
-commands yield progress indications (but not REQUEST SENSE commands). A
-new option may be required to handle this when disks catch up to the current
-draft.
+The SBC\-2 standard states that the REQUEST SENSE command should be used
+for obtaining a progress indication when the format command returns prior
+to the completion of the format operation. However, tests on a selection
+of recent disks shows that TEST UNIT READY commands yield progress
+indications (but not REQUEST SENSE commands). A new option may be required
+to handle this when disks catch up.
.PP
When the \fI\-\-format\fR option is given then there is a 10 second window
during which the user is invited to abort sg_format. This is just prior the
@@ -236,7 +253,7 @@ corrupt".
.PP
When the \fI\-\-format\fR and \fI\-\-wait\fR options are both given then
this utility may take a long time to return. In this case care should be
-taken not to send any other SCSI commands to the disk as it may not respon
+taken not to send any other SCSI commands to the disk as it may not respond
leaving those commands queued behind the active format command. This may
cause a timeout in the OS driver (in a lot shorter period than 4 hours
applicable to the format command). This may result in the OS resetting
@@ -256,7 +273,7 @@ potentially requiring a format. The solution to this situation is to
do a format again (and this time the new block size does not have to
be given) or change the block size back to the original size.
.PP
-The draft SBC\-2 standard states that the block count can be set back
+The SBC\-2 standard states that the block count can be set back
to the manufacturer's maximum recommended value in a format or resize
operation. This can be done by placing an address of 0xffffffff (or the
64 bit equivalent) in the appropriate block descriptor field to a MODE
@@ -272,9 +289,9 @@ logical block addresses) so by resizing or reformatting a disk to
a smaller capacity, average performance will usually be increased.
.PP
Other utilities may be useful in finding information associated with
-formatting. These include sg_inq to fetch standard INQUIRY
+formatting. These include sg_inq(8) to fetch standard INQUIRY
information (e.g. the PROTECT bit) and to fetch the extended INQUIRY
-VPD page (e.g. RTO and GRD_CHK bits). The sdparm (or sginfo) utility can be
+VPD page (e.g. RTO and GRD_CHK bits). The sdparm(8) utility can be
used to access and potentially change the now obsolete format mode page.
.PP
scsiformat is another utility available for formatting SCSI disks
@@ -328,7 +345,7 @@ Now resize the disk back to its normal (maximum) block count:
The exit status of sg_format is 0 when it is successful. Otherwise see
the sg3_utils(8) man page. Unless the \fI\-\-wait\fR option is given, the
exit status may not reflect to success of otherwise of the format.
-Using sg_turs and sg_readcap after the format operation may be wise.
+Using sg_turs(8) and sg_readcap(8) after the format operation may be wise.
.SH AUTHORS
Written by Grant Grundler, James Bottomley and Douglas Gilbert.
.SH "REPORTING BUGS"
@@ -339,5 +356,5 @@ Copyright \(co 2005\-2007 Grant Grundler, James Bottomley and Douglas Gilbert
This software is distributed under the GPL version 2. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
-.B sg_turs, sg_requests, sg_inq, sg_modes, sginfo, sg_reassign
-.B (all in sg3_utils), sdparm, scsiformat, setblocksize
+.B sg_turs(8), sg_requests(8), sg_inq(8), sg_modes(8), sg_vpd(8)
+.B sg_reassign(8) [all in sg3_utils], sdparm(8), scsiformat (old)