Lines Matching +full:device +full:- +full:select
1 .TH SG_FORMAT "8" "February 2022" "sg3_utils\-1.48" SG3_UTILS
3 sg_format \- format, format with preset, resize SCSI disk; format tape
6 [\fI\-\-cmplst=\fR{0|1}] [\fI\-\-count=COUNT\fR] [\fI\-\-dcrt\fR]
7 [\fI\-\-dry\-run\fR] [\fI\-\-early\fR] [\fI\-\-ffmt=FFMT\fR]
8 [\fI\-\-fmtmaxlba\R] [\fI\-\-fmtpinfo=FPI\fR] [\fI\-\-format\fR]
9 [\fI\-\-help\fR] [\fI\-\-ip\-def\fR] [\fI\-\-long\fR] [\fI\-\-mode=MP\fR]
10 [\fI\-\-pfu=PFU\fR] [\fI\-\-pie=PIE\fR] [\fI\-\-pinfo\fR] [\fI\-\-poll=PT\fR]
11 [\fI\-\-preset=ID\fR] [\fI\-\-quick\fR] [\fI\-\-resize\fR] [\fI\-\-rto_req\fR]
12 [\fI\-\-security\fR] [\fI\-\-six\fR] [\fI\-\-size=LB_SZ\fR]
13 [\fI\-\-tape=FM\fR] [\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR]
14 [\fI\-\-verify\fR] [\fI\-\-version\fR] [\fI\-\-wait\fR] \fIDEVICE\fR
30 FORMAT UNIT and FORMAT WITH PRESET apply to disks (or disk\-like devices).
32 the 'Peripheral Device Type' (PDT) of each SCSI device. This utility uses
33 the PDT to check if there is a conflict between the \fIDEVICE\fR and the
34 given option (e.g. giving the \fI\-\-tape=FM\fR option when \fIDEVICE\fR is
42 the block size may not require a format operation. The SBC\-2 standard (see
43 www.t10.org) has obsoleted the "format device" mode page. Many of the low
49 \fIDEVICE\fR argument) it prints out the existing block size and block count
55 When this utility is used with either \fI\-\-format\fR, \fI\-\-preset=ID\fR
56 or \fI\-\-tape=FM\fR, it will attempt to format the given DEVICE. In the
57 absence of the \fI\-\-quick\fR option there is a 15 second pause during which
70 When the \fI\-\-tape=FM\fR option is given then the SCSI FORMAT MEDIUM
71 command is sent to the \fIDEVICE\fR. FORMAT MEDIUM is defined in the SSC
75 The FORMAT WITH PRESET was added in draft SBC\-4 revision 18. A preset
76 pattern, selected by the PRESET IDENTIFIER field (\fI\-\-id=FWPID\fR),
84 \fB\-C\fR, \fB\-\-cmplst\fR={0|1}
88 apart from when the \fI\-\-ffmt=FFMT\fR option's value is non\-zero in which
92 \fB\-c\fR, \fB\-\-count\fR=\fICOUNT\fR
94 resized to. Can be used with either \fI\-\-format\fR or \fI\-\-resize\fR.
95 With \fI\-\-format\fR this option need not be given in which case it is
98 With \fI\-\-format\fR the interpretation of \fICOUNT\fR is:
108 (\fICOUNT\fR = \-1) : use recommended maximum block count
110 (\fICOUNT\fR < \-1) : illegal
112 With \fI\-\-resize\fR this option must be given and \fICOUNT\fR has this
120 (\fICOUNT\fR = \-1) : after resize READ CAPACITY will report its
123 (\fICOUNT\fR < \-1) : illegal
129 \fB\-D\fR, \fB\-\-dcrt\fR
133 but \fI\-\-ffmt=FFMT\fR, if available, would probably be better. The default
143 \fB\-d\fR, \fB\-\-dry\-run\fR
147 MODE SELECT command that would do that is also bypassed when the dry
150 \fB\-e\fR, \fB\-\-early\fR
152 disk every 60 seconds (or every 10 seconds if \fIFFMT\fR is non\-zero) to
157 This option and \fI\-\-wait\fR are mutually exclusive.
159 \fB\-t\fR, \fB\-\-ffmt\fR=\fIFFMT\fR
161 UNIT cdb. The field was introduced in SBC\-4 revision 10. The default value
163 blocks on the \fIDEVICE\fR. That can take a long time (e.g. with hard disks
168 currently. These two values include this description: "The device server
176 command aborted. See draft SBC\-4 revision 16 section 4.34 for more details.
178 \fB\-b\fR, \fB\-\-fmtmaxlba\fR
180 \fI\-\-preset=ID\fR option. If so it sets the FMTMAXLBA field in the FORMAT
183 \fB\-f\fR, \fB\-\-fmtpinfo\fR=\fIFPI\fR
185 The default value is 0. The FMTPINFO field from SBC\-3 revision 16 is a 2
189 options "\-\-pinfo" and "\-\-rto\-req" represent the older usage. This
193 \fB\-F\fR, \fB\-\-format\fR
195 \fI\-\-preset=ID\fR and \fI\-\-tape=FM\fR options, the SCSI FORMAT UNIT
199 of the \fI\-\-quick\fR option, the user is given a 15 second count down to
200 ponder the wisdom of doing this, during which time control\-C (amongst other
203 When used three times (or more) the preliminary MODE SENSE and SELECT
205 commands. This is for emergency use (e.g. when the MODE SENSE/SELECT
215 \fB\-h\fR, \fB\-\-help\fR
218 \fB\-I\fR, \fB\-\-ip\-def\fR
222 option is not given. If this option is given then the \fI\-\-security\fR
223 option cannot be given. Also accepts \fI\-\-ip_def\fR for this option.
225 \fB\-l\fR, \fB\-\-long\fR
232 option is not given and READ CAPACITY (10) or MODE SELECT detects a disk
236 parameters (e.g. when '\-\-pie=PIE' is greater than zero).
238 \fB\-M\fR, \fB\-\-mode\fR=\fIMP\fR
240 reading and perhaps changing the device logical block size. The default
241 is 1 which is the Read\-Write Error Recovery mode page.
244 accept the SP bit set in the MODE SELECT command used when the logical
246 MODE SELECT if the SP=1 variant fails with a sense key of ILLEGAL REQUEST.
247 That retry will use the same MODE SELECT command but with SP=0 .
249 \fB\-P\fR, \fB\-\-pfu\fR=\fIPFU\fR
255 \fB\-q\fR, \fB\-\-pie\fR=\fIPIE\fR
258 \fIPIE\fR can only be non\-zero with protection types 2 and 3.
261 bytes of user data). A device may not support any non\-zero values. This
262 field first appeared in SBC\-3 revision 18.
264 \fB\-p\fR, \fB\-\-pinfo\fR
265 this option is deprecated, use the \fI\-\-fmtpinfo=FPI\fR option instead.
267 is equivalent to setting \fI\-\-fmtpinfo=2\fR. [So if \fI\-\-pinfo\fR is
268 used (plus \fI\-\-fmtpinfo=FPI\fR and \fI\-\-pfu=PFU\fR are not given or
271 \fB\-x\fR, \fB\-\-poll\fR=\fIPT\fR
277 \fB\-E\fR, \fB\-\-preset\fR=\fIID\fR
280 IMMED field in that cdb is also set unless the \fI\-\-wait\fR option is
283 \fB\-Q\fR, \fB\-\-quick\fR
285 15 seconds to reconsider doing a format operation on the \fIDEVICE\fR.
289 \fB\-r\fR, \fB\-\-resize\fR
291 number of blocks on the device reported by the READ CAPACITY command.
292 This option should be used with the \fI\-\-count=COUNT\fR option.
295 reversed. This option cannot be used together with either \fI\-\-format\fR
296 or a \fI\-\-size=LB_SZ\fR whose argument is different to the existing block
299 \fB\-R\fR, \fB\-\-rto_req\fR
300 The option is deprecated, use the \fI\-\-fmtpinfo=FPI\fR option instead.
303 \fB\-S\fR, \fB\-\-security\fR
306 to SBC\-3 the default initialization pattern "shall be written using a
308 SANITIZE command. If this option is given then the \fI\-\-ip_def\fR option
311 \fB\-6\fR, \fB\-\-six\fR
312 Use 6 byte variants of MODE SENSE and MODE SELECT. The default action
316 \fB\-s\fR, \fB\-\-size\fR=\fILB_SZ\fR
318 block) to format the device to. The default value is whatever is currently
320 given by this option is different from the current value then a MODE SELECT
326 use of '\-v' to decode sense data).
332 \fB\-T\fR, \fB\-\-tape\fR=\fIFM\fR
333 will send a FORMAT MEDIUM command to the \fIDEVICE\fR with its FORMAT field
338 \fB\-m\fR, \fB\-\-timeout\fR=\fISECS\fR
352 \fB\-v\fR, \fB\-\-verbose\fR
353 increase the level of verbosity, (i.e. debug output). "\-vvv" gives
356 \fB\-y\fR, \fB\-\-verify\fR
360 \fB\-V\fR, \fB\-\-version\fR
363 \fB\-w\fR, \fB\-\-wait\fR
365 command's (short) parameter header. If this option (i.e. \fI\-\-wait\fR) is
366 given then the "IMMED" bit is not set. If \fI\-\-wait\fR is given then the
369 hours on large disks. See the \fI\-\-timeout=SECS\fR option.
372 \fI\-\-ffmt=FFMT\fR (and \fIFFMT\fR greater than 0) since the fast format
375 The SBC\-3 draft (revision 20) defines PLIST, CLIST, DLIST and GLIST in
382 Read\-Write Error Recovery mode page (see sdparm(8))) and use of the
385 By the SBC\-3 standard (following draft revision 36) the CLIST and DLIST
387 in the SBC\-4 drafts.
389 The CMPLST bit (controlled by the \fI\-\-cmplst=\fR0|1 option) determines
412 The SBC\-3 standard have added several "protection types" to the PI
413 introduced in the SBC\-2 standard. SBC\-3 defines 4 protection types (types
414 0 to 3) with protection type 0 meaning no PI is maintained. While a device
416 of the 4. To change a device's protection type, it must be re\-formatted.
418 draft SBC\-4 revision 16.
420 A device that supports PI information (i.e. supports one or more protection
424 device supports PI type 1 only, SPT=1 implies the device supports PI types 1
425 and 2, and various other non\-obvious mappings up to SPT=7 which implies
430 the 'sg_readcap \-\-long' utility).
432 Given that a device supports a particular protection type, a user can
435 command. Those fields correspond to the \fI\-\-fmtpinfo=FPI\fR and the
436 \fI\-\-pfu=PFU\fR options in this utility. The list below shows the four
437 protection types followed by the options of this utility needed to select
440 \fB0\fR : \-\-fmtpinfo=0 \-\-pfu=0
442 \fB1\fR : \-\-fmtpinfo=2 \-\-pfu=0
444 \fB2\fR : \-\-fmtpinfo=3 \-\-pfu=0
446 \fB3\fR : \-\-fmtpinfo=3 \-\-pfu=1
448 The default value of \fIFPI\fR (in \fI\-\-fmtpinfo=FPI\fR) is 0 and the
449 default value of \fIPFU\fR (in \fI\-\-pfu=PFU\fR) is 0. So if neither
450 \fI\-\-fmtpinfo=FPI\fR nor \fI\-\-pfu=PFU\fR are given then protection
454 blocks on a disk, the operating system may need to be told to re\-initialize
457 echo 1 > /sys/block/sd{letter(s)}/device/rescan
462 The SBC\-2 standard states that the REQUEST SENSE command should be used
468 \fI\-\-poll=PT\fR option has been added to control this.
470 When the \fI\-\-format\fR, \fI\-\-preset=ID\fR or \fI\-\-tape=FM\fR option
471 is given without the \fI\-\-wait\fR option then the corresponding SCSI
473 return after it has started the format operation. The \fI\-\-early\fR option
474 will cause sg_format to exit at that point. Otherwise the \fIDEVICE\fR is
475 polled every 60 seconds or every 10 seconds if \fIFFMT\fR is non\-zero. The
481 control\-C) without affecting the format operation which continues. However
482 a target or device reset (or a power cycle) will probably cause the format
483 to cease and the \fIDEVICE\fR to become "format corrupt".
485 When the \fI\-\-format\fR (\fI\-\-preset=ID\fR or \fI\-\-tape\fR) and
486 \fI\-\-wait\fR options are both given then this utility may take a long time
496 nothing attempts to access a device while it is being formatted. Unmounting
497 in mounted file systems on a \fIDEVICE\fR prior to calling this utility
501 on a disk two SCSI commands must be sent: a MODE SELECT to change the block
502 size followed by a FORMAT command. If the MODE SELECT command succeeds and
507 the READ CAPACITY command may fail, reporting the device is not ready,
512 The SBC\-2 standard states that the block count can be set back to the
515 equivalent) in the appropriate block descriptor field to a MODE SELECT
517 to '\-1'. So a \-\-count=\-1 causes the block count to be set back to
519 commands are being executed and parameters passed add the "\-vvv" option to
524 parameter list will be sent to the \fIDEVICE\fR along with the cdb. It is set
528 hard disks. "Hard" disk is often used to mean a storage device with
530 the newer form of storage device that contains no moving parts. Hard disk
549 The SCSI SANITIZE command was introduced in SBC\-3 revision 27. It is closely
553 feature (see the \fI\-\-security\fR option) and in some cases much faster.
558 on the same disk (see the \fI\-\-ip_def\fR option). In either case format
563 Device Type [PDT=20 or 0x14] from normal disks. They can be considered
567 T10 standards: ZBC standard (INCITS 536\-2016) and draft ZBC\-2.
578 The VERIFY bit field is set with the \fI\-\-verify\fR option. The IMMED bit
579 is manipulated by the \fI\-\-wait\fR option in the same way it is for disks;
580 one difference is that if the \fI\-\-poll=PT\fR option is not given then it
584 The argument given to the \fI\-\-tape=FM\fR option is used to set the FORMAT
585 field. \fIFM\fR can take values from "\-1" to "15" where "\-1" (the default)
587 formats. The \fI\-\-early\fR option may also be used to set the IMMED
602 utility (e.g. 'mt \-f /dev/st0 rewind').
604 These examples use Linux device names. For suitable device names in
608 size derived from two sources: a block descriptor in a MODE SELECT command
615 The FORMAT UNIT command is executed in IMMED mode and the device is polled
618 # sg_format \-\-format /dev/sdm
623 # sg_format \-\-format \-\-wait /dev/sdm
629 # sg_format \-\-format \-\-size=520 /dev/sdm
634 # sg_format \-\-resize \-\-count=0x10000 /dev/sdm
638 # sg_format \-\-resize \-\-count=\-1 /dev/sdm
645 # sg_vpd \-p ei \-l /dev/sdb
657 # sg_format \-\-format \-\-fmtpinfo=2 /dev/sdm
662 # sg_readcap \-l /dev/sdm
674 # sg_format \-\-format \-\-fmtpinfo=3 \-\-pfu=1 /dev/sdm
684 # sg_format \-\-format \-\-ffmt=1 \-\-size=512 /dev/sdd
688 # sg_format \-\-format \-\-ffmt=1 \-\-size=4096 /dev/sdd
691 \-\-wait option may be appropriate.
695 # sg_format \-\-preset=1 \-\-fmtmaxlba /dev/sdd
699 zoned block device model with 512 bytes of user data in each logical block").
703 the sg3_utils(8) man page. Unless the \fI\-\-wait\fR option is given, the
710 \fI\-\-verbose\fR option once should supply enough additional output to
717 Copyright \(co 2005\-2022 Grant Grundler, James Bottomley and Douglas Gilbert
725 .B lsscsi(8), mt(mt\-st), sdparm(8), scsiformat (old), hdparm(8)