Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Let The Music Play: Join EFF Today

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 80 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

scsiformat



SYNOPSIS

       scsiformat [-options...] device


DESCRIPTION

       Low  level  formats the SCSI device identified by the scsi
       disk or generic scsi device node device.  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 spaces on
       device are swapoff(8)'ed prior to formatting.

       During    formatting    a    file    like    /tmp/scsifor­
       mat.xx:xx:xx:xx:xxxxxxxx  is  used  to  hold  some  status
       information.


OPTIONS

       scsiformat supports the following option switches:

   a) Controlling a/synchronous operation
       -b n   block during the format operation. This  makes  any
              display  of  real  progress  indicators impossible.
              However, cheesy SCSI devices   will need it.  Scsi­
              format 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  formatting
              completes.

              Read the BUGS section below!

       -T     just  check for a running format command and output
              statistics.  A file /tmp/scsiformat.*  is  used  to
              hold  the starting time of the format operation. If
              formatting completed, this file is removed  by  the
              formatting  scsiformat call (which forks of a child
              just for this purpose).  The exit state of scsifor­
              mat  is  true  as  long  as the format operation is
              still in progress. A  left  over  /tmp/scsiformat.*
              file  will  make  scsiformat  think a program still
              runs. It will not accept  and  remove  files  older
              than 48h nevertheless.

       -t n   check progress every n seconds (default is 5).  -t0
              makes   scsiformat   return   without    displaying
              progress.

   b) Interleave factor

       -L     The  first four bytes of each logical block are set
              to the number of the logical block.

       -P     The first four bytes of each physical block are set
              to the number of logical block, it will occur in.

   c) Defect management
       -e     Erase  the  grown  defect list prior to formatting.
              You can issue new defects for the grown defect list
              nevertheless   and   media  certification  may  add
              defects too.

       -p     Ignore the vendor's primary defect  list.  This  is
              not recommended as the vendor probably had a reason
              to specify these primary defects.

       -c     Do not perform a media surface certification.  This
              may  speed  up  formatting  but  is also not recom­
              mended.

       -s     Stop when unable to access primary or grown defects
              due  to  some  internal error in the target device.
              When not given, formatting continues but returns  a
              recovered error upon completion. (Which is probably
              not well supported by scsiformat).

       -S     Erase MODE SELECT settings stored in  NVRAM.  These
              are those you can set with scsiinfo(8) or scsi-con­
              fig(8).

       -d int, ...
              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 int:int:int, ...
              A comma separated list of expressions of  the  form
              C:H:S  specifying  a  defect  at  physical location
              hexadecimal notation.

       You can specify more than one of the -d,  -D,  -B  options
       but you must stick to one defect format!

   d) Simple partitioning
       For  your convenience, scsiformat allow to preset the par­
       tition table in a simple  way  which  often  suffices  for
       removable  medias.   This is not intended as a replacement
       for fdisk(8) though.

       -f arg perform simple partitioning.  -fdos sets  up  begin
              and  start of the partition on cylinder 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 headsxsectors
              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 type
              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).

       -M size
              Create a primary partition number 1 of maximal size
              sizeMB.  When size is 0, no partition  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) Miscanellous
       -X     all  output  is printed in numerics, useful for GUI
              interfaces like tk_scsiformat(8).  Also  makes  all
              operations  non  blocking.  (By  forking of a child
              process  for  those  scsi  operations  which  would
              block).

       -o     The  settings  of the flags -c, -p, -s, -S, -I, -L,
              -P are obeyed.  If you specify one of these, -o  is
              silently  added.  Without  -o or one of these flags
              some  factory  default  is  used.   Specifying   -o
              explictly  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. How­
       ever, they are removed after 48 hours.

       I were unable to get hold of a  disk  supporting  querying
       the  progress status (and which I could stand to loose 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)  call
       for  the  sd(4)  device make it impossible to issue a FOR­
       MAT_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 com­
       piled  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), scsiinfo(8),  scsi-config(8),  fdisk(8),
       sd(4).


AUTHOR


  




Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.07 Seconds