{
    "mode": "man",
    "parameter": "scsiformat",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/scsiformat/8/json",
    "generated": "2026-06-12T05:11:44Z",
    "synopsis": "scsiformat [-options...] device",
    "sections": {
        "NAME": {
            "content": "scsiformat - low level format an scsi disk device\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "scsiformat [-options...] device\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Low level formats the SCSI device identified by the scsi disk or generic scsi device node de‐\nvice.  You must be root to perform this operation.  scsiformat will ask a simple question  to\nget your confirmation and check if partitions on device are still mounted. Possible swap spa‐\nces on device are swapoff(8)'ed prior to formatting.\n\nDuring formatting a file like /tmp/scsiformat.xx:xx:xx:xx:xxxxxxxx is used to hold some  sta‐\ntus information.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "scsiformat supports the following option switches:\n\n",
            "subsections": [
                {
                    "name": "a) Controlling a/synchronous operation",
                    "content": ""
                },
                {
                    "name": "-b",
                    "content": "impossible. However, cheesy SCSI devices   will need it. Scsiformat assumes  that  the\noperation will need about n seconds and provides some progress indication according to\nthat.  -b0 does not print any process indication, just sits and blocks  until  format‐\nting completes.\n\nRead the BUGS section below!\n\n",
                    "flag": "-b"
                },
                {
                    "name": "-T",
                    "content": "mat.*  is used to hold the starting time of the format operation. If  formatting  com‐\npleted, this file is removed by the formatting scsiformat call (which forks of a child\njust for this purpose).  The exit state of scsiformat is true as long  as  the  format\noperation is still in progress. A left over /tmp/scsiformat.*  file will make scsifor‐\nmat think a program still runs. It will not accept and remove  files  older  than  48h\nnevertheless.\n\n",
                    "flag": "-T"
                },
                {
                    "name": "-t -t0",
                    "content": "displaying progress.\n\n",
                    "flag": "-t"
                },
                {
                    "name": "b) Interleave factor",
                    "content": ""
                },
                {
                    "name": "-i",
                    "content": "fault -i0 which selects a vendor specific default.\n\n",
                    "flag": "-i"
                },
                {
                    "name": "c) Initialisation pattern",
                    "content": "By  default the target will initialise the formatted sectors with a vendor specific test pat‐\ntern.\n\n"
                },
                {
                    "name": "-I",
                    "content": "the bytes given in hex characters are repeated and used to init all blocks on the  de‐\nvice.\n\n",
                    "flag": "-I"
                },
                {
                    "name": "-L",
                    "content": "",
                    "flag": "-L"
                },
                {
                    "name": "-P",
                    "content": "will occur in.\n\n",
                    "flag": "-P"
                },
                {
                    "name": "c) Defect management",
                    "content": ""
                },
                {
                    "name": "-e",
                    "content": "grown defect list nevertheless and media certification may add defects too.\n\n",
                    "flag": "-e"
                },
                {
                    "name": "-p",
                    "content": "bly had a reason to specify these primary defects.\n\n",
                    "flag": "-p"
                },
                {
                    "name": "-c",
                    "content": "not recommended.\n\n",
                    "flag": "-c"
                },
                {
                    "name": "-s",
                    "content": "target device. When not given, formatting continues but returns a recovered error upon\ncompletion. (Which is probably not well supported by scsiformat).\n\n",
                    "flag": "-s"
                },
                {
                    "name": "-S",
                    "content": "info(8) or scsi-config(8).\n\n",
                    "flag": "-S"
                },
                {
                    "name": "-d",
                    "content": "A comma separated list of logical blocks to mark as defect. Using this  defect  format\nis  discouraged  as there no clear concept of what a logical block is here because the\nformat command may move around logical blocks  and  change  the  number  of  available\nblocks.\n\nThe number can be preceded by 0 or 0x for octal or hexadecimal notation.\n\n",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "A  comma separated list of expressions of the form C:H:S specifying a defect at physi‐\ncal location Cylinder:Head:Sector. A Sector S of -1 marks the whole track as bad.\n\nThe number can be preceded by 0 or 0x for octal or hexadecimal notation.\n\n",
                    "flag": "-D"
                },
                {
                    "name": "-B",
                    "content": "A comma separated list of expressions of the from C:H:B specifying defects  at  Cylin‐\nder:Head:Bytes  from  Index.  Again,  a Bytes from Index value B of -1 marks the whole\ntrack as bad.\n\nThe number can be preceded by 0 or 0x for octal or hexadecimal notation.\n\nYou can specify more than one of the -d, -D, -B options but you must stick to one defect for‐\nmat!\n\n",
                    "flag": "-B"
                },
                {
                    "name": "d) Simple partitioning",
                    "content": "For  your  convenience,  scsiformat allow to preset the partition table in a simple way which\noften suffices for removable medias.  This is not intended  as  a  replacement  for  fdisk(8)\nthough.\n\n"
                },
                {
                    "name": "-f -fdos",
                    "content": "der boundaries.  -ftight does use as much of the disk as  possible  (but  may  confuse\nOS's other than Linux).\n\nIf  you  do not specify -f at all, scsiformat will not initialise the partition table.\nAs it has to tell the kernel that the disk was reformatted and the kernel will try  to\nto read the partition table, you are like to get some kernel warnings then.\n\n",
                    "flag": "-f"
                },
                {
                    "name": "-G",
                    "content": "set  the  disk  geometry (Heads x Sectors) as DOS will see it for use in the partition\ntable. If you don't specify it, scsiformat will ask the kernel what it thinks DOS will\nget  from the adapters BIOS. This call might fail or return bogus data though. A wrong\nsetting will not affect linux, but other OS's and esp. DOS and the BIOS (for booting).\n\n",
                    "flag": "-G"
                },
                {
                    "name": "-y",
                    "content": "set the type for the  partition  to  set.   type  is  a  two  digit  hex  number.  See\nfdisk(8),command t for a list. Defaults to 83 (Linux native).\n\n",
                    "flag": "-y"
                },
                {
                    "name": "-M",
                    "content": "Create a primary partition number 1 of maximal size sizeMB.  When size is 0, no parti‐\ntion is created, and thus the partition table is simply initialised to be  valid  (but\nempty).  If  the  size  exceeds the disk capacity, a partition as large as possible is\nmade. Defaults to 99999.\n\n",
                    "flag": "-M"
                },
                {
                    "name": "e) Miscellaneous",
                    "content": ""
                },
                {
                    "name": "-H",
                    "content": "",
                    "flag": "-H"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-F",
                    "content": "'Ene Mene Meck, und Du bist weg!'   with  proper spaces and capitalisation. (this is a\nGerman child rhyme kissing someone goodbye...)\n\n",
                    "flag": "-F"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-X",
                    "content": "Also  makes all operations non blocking. (By forking of a child process for those scsi\noperations which would block).\n\n",
                    "flag": "-X"
                },
                {
                    "name": "-o -c -p -s -S -I -L -P",
                    "content": "of  these, -o is silently added. Without -o or one of these flags some factory default\nis used.  Specifying -o explicitly will allow you to not  use  any  of  these  options\nwhich might not be the default chosen by the target device otherwise.\n\n",
                    "flag": "-P"
                }
            ]
        },
        "RETURN CODES": {
            "content": "Apart  from  the codes returned by the -T flag, scsiformat will generally return 1 for system\nerrors, 2 for user errors, and 0 for successful operation.\n\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Old status files in /tmp will confuse the -T option.  However,  they  are  removed  after  48\nhours.\n\nI was unable to get hold of a disk supporting querying the progress status (and which I could\nstand to lose all data on). Therefore I commented out the support for this  from  the  source\ncode using a BLOCKINGONLY#define.  You are welcome to try and make this work.\n\nRestrictions of the SCSIIOCTLSENDCOMMAND ioctl(2) call for the sd(4) device make it impos‐\nsible to issue a FORMATUNIT command with more than 4096 bytes of arguments.  This  could  be\navoided  by  using the proper generic scsi device /dev/sg* instead, at least where the kernel\nis compiled to support it. Most of the time this is not needed though and thus I'm myself  to\nlazy to do it.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/tmp/scsiformat.xx:xx:xx:xx:xxxxxxxx\n/dev/sd*\n/dev/sg*\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "tkscsiformat(8), scsiinfo(8), scsi-config(8), fdisk(8), sd(4).\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Michael Weller <eowmob@exp-math.uni-essen.de>\n\n\n\nscsiinfo 1.7                               23 August 1997                              scsiformat(8)",
            "subsections": []
        }
    },
    "summary": "scsiformat - low level format an scsi disk device",
    "flags": [
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "impossible. However, cheesy SCSI devices will need it. Scsiformat assumes that the operation will need about n seconds and provides some progress indication according to that. -b0 does not print any process indication, just sits and blocks until format‐ ting completes. Read the BUGS section below!"
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "mat.* is used to hold the starting time of the format operation. If formatting com‐ pleted, this file is removed by the formatting scsiformat call (which forks of a child just for this purpose). The exit state of scsiformat is true as long as the format operation is still in progress. A left over /tmp/scsiformat.* file will make scsifor‐ mat think a program still runs. It will not accept and remove files older than 48h nevertheless."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "displaying progress."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "fault -i0 which selects a vendor specific default."
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": "the bytes given in hex characters are repeated and used to init all blocks on the de‐ vice."
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "will occur in."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "grown defect list nevertheless and media certification may add defects too."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "bly had a reason to specify these primary defects."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "not recommended."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "target device. When not given, formatting continues but returns a recovered error upon completion. (Which is probably not well supported by scsiformat)."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "info(8) or scsi-config(8)."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "A comma separated list of logical blocks to mark as defect. Using this defect format is discouraged as there no clear concept of what a logical block is here because the format command may move around logical blocks and change the number of available blocks. The number can be preceded by 0 or 0x for octal or hexadecimal notation."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "A comma separated list of expressions of the form C:H:S specifying a defect at physi‐ cal location Cylinder:Head:Sector. A Sector S of -1 marks the whole track as bad. The number can be preceded by 0 or 0x for octal or hexadecimal notation."
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "A comma separated list of expressions of the from C:H:B specifying defects at Cylin‐ der:Head:Bytes from Index. Again, a Bytes from Index value B of -1 marks the whole track as bad. The number can be preceded by 0 or 0x for octal or hexadecimal notation. You can specify more than one of the -d, -D, -B options but you must stick to one defect for‐ mat!"
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "der boundaries. -ftight does use as much of the disk as possible (but may confuse OS's other than Linux). If you do not specify -f at all, scsiformat will not initialise the partition table. As it has to tell the kernel that the disk was reformatted and the kernel will try to to read the partition table, you are like to get some kernel warnings then."
        },
        {
            "flag": "-G",
            "long": null,
            "arg": null,
            "description": "set the disk geometry (Heads x Sectors) as DOS will see it for use in the partition table. If you don't specify it, scsiformat will ask the kernel what it thinks DOS will get from the adapters BIOS. This call might fail or return bogus data though. A wrong setting will not affect linux, but other OS's and esp. DOS and the BIOS (for booting)."
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "set the type for the partition to set. type is a two digit hex number. See fdisk(8),command t for a list. Defaults to 83 (Linux native)."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "Create a primary partition number 1 of maximal size sizeMB. When size is 0, no parti‐ tion is created, and thus the partition table is simply initialised to be valid (but empty). If the size exceeds the disk capacity, a partition as large as possible is made. Defaults to 99999."
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "'Ene Mene Meck, und Du bist weg!' with proper spaces and capitalisation. (this is a German child rhyme kissing someone goodbye...)"
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": "Also makes all operations non blocking. (By forking of a child process for those scsi operations which would block)."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "of these, -o is silently added. Without -o or one of these flags some factory default is used. Specifying -o explicitly will allow you to not use any of these options which might not be the default chosen by the target device otherwise."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "tkscsiformat",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tkscsiformat/8/json"
        },
        {
            "name": "scsiinfo",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/scsiinfo/8/json"
        },
        {
            "name": "scsi-config",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/scsi-config/8/json"
        },
        {
            "name": "fdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/fdisk/8/json"
        },
        {
            "name": "sd",
            "section": "4",
            "url": "https://www.chedong.com/phpMan.php/man/sd/4/json"
        }
    ]
}