Usage:
sg_format [--cappid] [--cmplst=0|1] [--count=COUNT] [--dcrt] [--dry-run]
[--early] [--ffmt=FFMT] [--fmtmaxlba] [--fmtpinfo=FPI]
[--format] [--help] [--ip-def] [--long] [--mode=MP] [--pfu=PFU]
[--pie=PIE] [--pinfo] [--poll=PT] [--preset=ID] [--quick]
[--resize] [--rto_req] [--security] [--six] [--size=LB_SZ]
[--tape=FM] [--timeout=SECS] [--verbose] [--verify] [--version]
[--wait] DEVICE
where:
--cappid|-a set CAPPID bit in Mode Select if count change
--cmplst=0|1
-C 0|1 sets CMPLST bit in format cdb (def: 1; if FFMT: 0)
--count=COUNT|-c COUNT number of blocks to report after format or
resize. Format default is same as current
--dcrt|-D disable certification (doesn't verify media)
use twice to enable certification and set FOV bit
--dry-run|-d bypass device modifying commands (i.e. don't format)
--early|-e exit once format started (user can monitor progress)
--ffmt=FFMT|-t FFMT fast format (def: 0 -> slow, may visit every
block). 1 and 2 are fast formats; 1: after
format, unwritten data read without error
--fmtmaxlba|-b sets FMTMAXLBA field in FORMAT WITH PRESET
--fmtpinfo=FPI|-f FPI FMTPINFO field value (default: 0)
--format|-F do FORMAT UNIT (default: report current count and size)
use thrice for FORMAT UNIT command only
--help|-h prints out this usage message
--ip-def|-I use default initialization pattern
--long|-l allow for 64 bit lbas (default: assume 32 bit lbas)
--mode=MP|-M MP mode page (def: 1 -> RW error recovery mpage)
--pie=PIE|-q PIE Protection Information Exponent (default: 0)
--pinfo|-p set upper bit of FMTPINFO field
(deprecated, use '--fmtpinfo=FPI' instead)
--poll=PT|-x PT PT is poll type, 0 for test unit ready
1 for request sense (def: 0 (1 for tape and
format with preset))
--preset=ID|-E ID do FORMAT WITH PRESET command with PRESET
IDENTIFIER field set to ID
--quick|-Q start format without pause for user intervention
(i.e. no time to reconsider)
--resize|-r resize (rather than format) to COUNT value
--rto_req|-R set lower bit of FMTPINFO field
(deprecated use '--fmtpinfo=FPI' instead)
--security|-S set security initialization (SI) bit
--six|-6 use 6 byte MODE SENSE/SELECT to probe disk
(def: use 10 byte MODE SENSE/SELECT)
--size=LB_SZ|-s LB_SZ bytes per logical block, defaults to DEVICE's
current logical block size. Only needed to
change current logical block size
--tape=FM|-T FM request FORMAT MEDIUM with FORMAT field set
to FM (def: 0 --> default format)
--timeout=SECS|-m SECS FORMAT UNIT/MEDIUM command timeout in seconds
--verbose|-v increase verbosity, can use multiple times
--verify|-y sets VERIFY bit in FORMAT MEDIUM (tape)
--version|-V print version details and exit
--wait|-w format commands wait until format operations complete
(default: set IMMED=1 and poll with Test Unit Ready)
Example: sg_format --format /dev/sdc
This utility formats a SCSI disk [FORMAT UNIT] or resizes it. Alternatively
if '--tape=FM' is given formats a tape [FORMAT MEDIUM]. Another alternative
is doing the FORMAT WITH PRESET command when '--preset=ID' is given.
WARNING: This utility will destroy all the data on the DEVICE when
'--format', '--tape=FM' or '--preset=ID' is given. Double check
that you have specified the correct DEVICE.
Options (32)
| Option | Description | Source |
|---|---|---|
--cmplst 0|1 | help | |
-C 0|1 | sets the CMPLST ("complete list") bit in the FORMAT UNIT cdb to 0 or 1. | help + man |
--count, -c COUNT|-c | where COUNT is the number of blocks to be formatted or media to be resized to. | help + man |
--ffmt, -t FFMT|-t | FFMT (fast format) is placed in a field of the same name in the FORMAT UNIT cdb. | help + man |
--fmtpinfo, -f FPI|-f | sets the FMTPINFO field in the FORMAT UNIT cdb to a value between 0 and 3. | help + man |
--mode, -M MP|-M | MP is a mode page number (0 to 62 inclusive) that will be used for reading and perhaps changing the device logical block size. | help + man |
--pie, -q PIE|-q | sets the "Protection Interval Exponent" field in the parameter block associated with a FORMAT UNIT command to PIE. | help + man |
--poll, -x PT|-x | PT is poll type, 0 for test unit ready 1 for request sense (def: 0 (1 for tape and format with preset)) | help + man |
--preset, -E ID|-E | this option instructs this utility to issue a SCSI FORMAT WITH PRESET command. | help + man |
--size, -s LB_SZ|-s | where LB_SZ is the logical block size (i.e. number of user bytes in each block) to format the device to. | help + man |
--tape, -T FM|-T | will send a FORMAT MEDIUM command to the DEVICE with its FORMAT field set to FM. | help + man |
--timeout, -m SECS|-m | where SECS is the FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command timeout in seconds. | help + man |
-a, --cappid | this option sets the CAPPID bit in the MODE SELECT header which is part of that command's parameter list. (in the manual page but not in --help) | man |
-D, --dcrt | this option sets the DCRT bit in the FORMAT UNIT command's parameter list header. (in the manual page but not in --help) | man |
-d, --dry-run | this option will parse the command line, do all the preparation but bypass the actual FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command. (in the manual page but not in --help) | man |
-e, --early | during a format operation, The default action of this utility is to poll the disk every 60 seconds (or every 10 seconds if FFMT is non-zero) to determine the progress of the format operation until it… (in the manual page but not in --help) | man |
-b, --fmtmaxlba | This option is only active if it is given together with the --preset=ID option. (in the manual page but not in --help) | man |
-F, --format | issue one of the three SCSI "format" commands. (in the manual page but not in --help) | man |
-h, --help | print out the usage information then exit. (in the manual page but not in --help) | man |
-I, --ip-def | sets the default Initialization Pattern. (in the manual page but not in --help) | man |
-l, --long | the default action of this utility is to assume 32 bit logical block addresses. (in the manual page but not in --help) | man |
-P, --pfu PFU | sets the "Protection Field Usage" field in the parameter block associated with a FORMAT UNIT command to PFU. (in the manual page but not in --help) | man |
-p, --pinfo | this option is deprecated, use the --fmtpinfo=FPI option instead. (in the manual page but not in --help) | man |
-Q, --quick | the default action (i.e. when the option is not given) is to give the user 15 seconds to reconsider doing a format operation on the DEVICE. (in the manual page but not in --help) | man |
-r, --resize | rather than format the disk, it can be resized. (in the manual page but not in --help) | man |
-R, --rto_req | The option is deprecated, use the --fmtpinfo=FPI option instead. (in the manual page but not in --help) | man |
-S, --security | sets the "Security Initialization" (SI) bit in the FORMAT UNIT command's initialization pattern descriptor within the parameter list. (in the manual page but not in --help) | man |
-6, --six | Use 6 byte variants of MODE SENSE and MODE SELECT. (in the manual page but not in --help) | man |
-v, --verbose | increase the level of verbosity, (i.e. debug output). (in the manual page but not in --help) | man |
-y, --verify | set the VERIFY bit in the FORMAT MEDIUM cdb. (in the manual page but not in --help) | man |
-V, --version | print the version string and then exit. (in the manual page but not in --help) | man |
-w, --wait | the default format action is to set the "IMMED" bit in the FORMAT UNIT command's (short) parameter header. (in the manual page but not in --help) | man |
Exit status (1) from the manual page
0 | it is successful |