# phpman > man > scsiformat(8)

[scsiformat(8)](https://www.chedong.com/phpMan.php/man/scsiformat/8/markdown)                           Scsiinfo User's Guide                          [scsiformat(8)](https://www.chedong.com/phpMan.php/man/scsiformat/8/markdown)



## NAME
       scsiformat - low level format an scsi disk device

## SYNOPSIS
       **scsiformat** **[-**_options..._**]** _device_

## DESCRIPTION
       Low level formats the SCSI device identified by the scsi disk or generic scsi device node _de__‐
       _vice_.  You must be root to perform this operation.  **scsiformat** will ask a simple question  to
       get your confirmation and check if partitions on _device_ are still mounted. Possible swap spa‐
       ces on _device_ are [**swapoff**(8)](https://www.chedong.com/phpMan.php/man/swapoff/8/markdown)'ed prior to formatting.

       During formatting a file like _/tmp/scsiformat.xx:xx:xx:xx:xxxxxxxx_ is used to hold some  sta‐
       tus information.


## OPTIONS
       **scsiformat** supports the following option switches:


### a) Controlling a/synchronous operation
### -b
              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!


### -T
              _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.


### -t -t0
              displaying progress.


### b) Interleave factor
### -i
              fault **-i0** which selects a vendor specific default.


### c) Initialisation pattern
       By  default the target will initialise the formatted sectors with a vendor specific test pat‐
       tern.


### -I
              the bytes given in hex characters are repeated and used to init all blocks on the  de‐
              vice.


### -L

### -P
              will occur in.


### c) Defect management
### -e
              grown defect list nevertheless and media certification may add defects too.


### -p
              bly had a reason to specify these primary defects.


### -c
              not recommended.


### -s
              target device. When not given, formatting continues but returns a recovered error upon
              completion. (Which is probably not well supported by **scsiformat**).


### -S
              [**info**(8)](https://www.chedong.com/phpMan.php/man/info/8/markdown) or [**scsi-config**(8)](https://www.chedong.com/phpMan.php/man/scsi-config/8/markdown).


### -d
              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.


### -D
              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.


### -B
              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!


### d) Simple partitioning
       For  your  convenience,  **scsiformat** allow to preset the partition table in a simple way which
       often suffices for removable medias.  This is not intended  as  a  replacement  for  [**fdisk**(8)](https://www.chedong.com/phpMan.php/man/fdisk/8/markdown)
       though.


### -f -fdos
              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.


### -G
              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).


### -y
              set the type for the  partition  to  set.   _type_  is  a  two  digit  hex  number.  See
              [**fdisk**(8)](https://www.chedong.com/phpMan.php/man/fdisk/8/markdown),**command** **t** **for** **a** **list.** **Defaults** **to** **83** (Linux native).


### -M
              Create a primary partition number 1 of maximal size _size_MB.  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**.


### e) Miscellaneous
### -H

### -v


### -F
              **'Ene** **Mene** **Meck,** **und** **Du** **bist** **weg!'**   with  proper spaces and capitalisation. (this is a
              German child rhyme kissing someone goodbye...)


### -V


### -X
              Also  makes all operations non blocking. (By forking of a child process for those scsi
              operations which would block).


### -o -c -p -s -S -I -L -P
              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.


## RETURN CODES
       Apart  from  the codes returned by the **-T** flag, **scsiformat** will generally return 1 for system
       errors, 2 for user errors, and 0 for successful operation.


## BUGS
       Old status files in _/tmp_ will confuse the **-T** option.  However,  they  are  removed  after  48
       hours.

       I was unable to get hold of a disk supporting querying the progress status (and which I could
       stand to lose all data on). Therefore I commented out the support for this  from  the  source
       code using a **BLOCKING**___**ONLY**#define.  You are welcome to try and make this work.

       Restrictions of the **SCSI**___**IOCTL**___**SEND**___**COMMAND** [**ioctl**(2)](https://www.chedong.com/phpMan.php/man/ioctl/2/markdown) call for the [**sd**(4)](https://www.chedong.com/phpMan.php/man/sd/4/markdown) device make it impos‐
       sible to issue a **FORMAT**___**UNIT** command with more than 4096 bytes of arguments.  This  could  be
       avoided  by  using the proper generic scsi device _/dev/sg*_ instead, at least where the kernel
       is compiled to support it. Most of the time this is not needed though and thus I'm myself  to
       lazy to do it.

## FILES
       _/tmp/scsiformat.xx:xx:xx:xx:xxxxxxxx_
       _/dev/sd*_
       _/dev/sg*_


## SEE ALSO
       **tk**___**[scsiformat**(8)](https://www.chedong.com/phpMan.php/man/scsiformat/8/markdown), [**scsiinfo**(8)](https://www.chedong.com/phpMan.php/man/scsiinfo/8/markdown), [**scsi-config**(8)](https://www.chedong.com/phpMan.php/man/scsi-config/8/markdown), [**fdisk**(8)](https://www.chedong.com/phpMan.php/man/fdisk/8/markdown), [**sd**(4)](https://www.chedong.com/phpMan.php/man/sd/4/markdown).


## AUTHOR
       Michael Weller <<eowmob@exp-math.uni-essen.de>>



scsiinfo 1.7                               23 August 1997                              [scsiformat(8)](https://www.chedong.com/phpMan.php/man/scsiformat/8/markdown)
