MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


SG3UTILS                                            SGSTART(1M)



NAME
     sgstart - send SCSI START STOP UNIT command to start, stop,
     load or eject medium

SYNOPSIS
     sgstart [0]  [1]  [--eject]  [--help]  [--fl=FL]  [--immed]
     [--load]   [--loej]   [--mod=PCMOD]  [--noflush]  [--pc=PC]
     [--start] [--stop] [--verbose] [--version] DEVICE

     sgstart  [--eject]  [--fl=FL]  [-i]  [--imm=01]   [--load]
     [--loej]   [--mod=PCMOD]  [--noflush]  [--pc=PC]  [--start]
     [--stop] [-v] [-V] [01] DEVICE

DESCRIPTION
     sgstart sends a SCSI START STOP UNIT command to the  DEVICE
     with  the selected options. The most used options are --stop
     to spin down a disk and --start to spin  up  a  disk.  Using
     --start  on  a  disk  that  is already spinning is harmless.
     There is also finer grain control  with  "power  condition":
     active,  idle  or  standby.  This  is  set  with the --pc=PC
     option. In some contexts the "stop" state can be  considered
     an additional power condition.

     Devices that contain removable media such as cd/dvds can use
     the  --loej  option to load the medium when used in conjunc-
     tion with --start (i.e. load medium then spin up).  Alterna-
     tively  --loej  may be used to eject the medium when used in
     conjunction with --stop (i.e. spin down then eject  medium).
     More  simply,  the loading or ejecting of a removable medium
     can be requested with the --load or --eject' option.

     If no option or argument is given then a --start is assumed;
     as the utility's name suggests.

     This utility supports two command line  syntaxes,  the  pre-
     ferred  one  is shown first in the synopsis and explained in
     this section. A later section on the old command line syntax
     outlines the second group of options.

OPTIONS
     Arguments to long options are mandatory for short options as
     well.

     0    same action as --stop.

     1    same action as --start.

     -e, --eject
          stop the medium and  eject  it  from  the  drive.  Only
          appropriate  for  a device with removable medium. Might
          be ignored (prevented), see below.




sg3utils-1.26       Last change: March 2008                    1






SG3UTILS                                            SGSTART(1M)



     -h, --help
          print out the usage message then exit.

     -f, --fl=FL
          sets the format layer number for the disc to "jump"  to
          (defined  in  MC-5).  Values of FL can be 0 to 3. When
          this option is chosen, the FL, LoEj and Start bits  are
          set in the cdb as required by MC-5; thus the user does
          not need to set the --start and/or --load options.

     -i, --immed
          sets the IM bit on the START STOP UNIT command so this
          utility  will  return  immediately and not wait for the
          media to complete the requested action. The default  is
          to  wait  until  the  media  to  complete the requested
          action before returning.

     -l, --load
          load the  medium  in  the  drive  and  start  it.  Only
          appropriate for a removable medium.

     -L, --loej
          sets the LOEJ bit on the START STOP UNIT command.  This
          loads  the  media  when the unit is started or eject it
          when the unit is stopped (i.e.   works  in  conjunction
          with START bit in cdb). This option is ignored if 'pc >
          0'.  Default is off (i.e.  don't  attempt  to  load  or
          eject  media). If a start/start indication is not given
          (i.e. neither --start nor --stop) and  this  option  is
          given then a load and start action is assumed.

     -m, --mod=PCMOD
          where PCMOD is the 'power condition modifier' value. 0
          to  15 (inclusive) are valid and 0 is the default. This
          'power condition modifier' field in the cdb  was  added
          after sbc3r13.

     -n, --noflush
          do not perform a flush to media (e.g. like  SYNCHRONIZE
          CACHE  does) before a variant of this utility that lim-
          its access to the media. Using the --stop option is  an
          example  of  something that limits access to the media.
          This  'noflush'  field  in  the  cdb  was  added  after
          sbc3r13.

     -O, --old
          switch to older style options.

     -p, --pc=PC
          where PC is the  'power  conditions'  value.  0  to  15
          (inclusive)  are  valid.   Default  value  is  0.  When
          '--pc=0' then  --eject,  --load,  --loej,  --start  and



sg3utils-1.26       Last change: March 2008                    2






SG3UTILS                                            SGSTART(1M)



          --stop  are  active.  Some  common values are 1 for the
          "active" power condition (SBC); 2 for  the  idle  power
          condition;  3  for  the  standby power condition; 5 for
          sleep power condition (MC); 7  for  LUCONTROL  (SBC),
          0xa   (decimal  10)  for  FORCEIDLE0  (SBC)  and  0xb
          (decimal 11)  for  FORCESTANDBY0  (SBC).  See  recent
          SBC-3,  MC-5  and  SAS  drafts at www.t10.org for more
          information.

     -s, --start
          start (spin-up) the device. This sets the START bit  in
          the cdb. Using this option on an already started device
          is harmless. In the  absence  of  other  options,  this
          option defaults (i.e. set the START cdb bit).

     -S, --stop
          stop (spin-down) the device. This clears the START  bit
          in the cdb.

     -v, --verbose
          increase the level of verbosity. Can be  used  multiple
          times.

     -V, --version
          print out version string then exit.

NOTES
     To avoid confusion,  only  one  of  0,  1  --eject,  --load,
     --start and --stop should be given.

     There is an associated "power condition" mode page (0x1a) in
     which  timer  values  can be set for transitioning to either
     idle or standby state after  a  period  of  inactivity.  The
     sdparm  utility can be used to view the power condition mode
     page and if required change it. If a  device  is  in  either
     idle  or  standby power condition state then a REQUEST SENSE
     command (see the sgrequests utility) should yield  a  sense
     key of "no sense" and an additional sense code of "Low power
     condition on" on recent SCSI devices.

     Ejection  of  removable  media   (e.g.   'sgstart   --eject
     /dev/hdd'  where the device is an ATAPI cd/dvd drive) may be
     prevented by a prior SCSI PREVENT ALOW MEDIUM REMOVAL  com-
     mand (see sgprevent). In this case this utility should fail
     with an error generated by the device:   illegal  request  /
     medium  removal  prevented.  This  can  be  overridden using
     sgprevent  or,  for   example,   'sdparm   --command=unlock
     /dev/hdd'.

     The SCSI TEST UNIT READY command can be  used  to  find  out
     whether  a  device  is  ready  to transfer data. If rotating
     media is stopped or still coming up to speed, then the  TEST



sg3utils-1.26       Last change: March 2008                    3






SG3UTILS                                            SGSTART(1M)



     UNIT READY command will yield a "not ready" sense key and an
     more informative additional  sense  code.  See  the  sgturs
     utility.

     In the 2.4 series of Linux kernels the DEVICE must be a SCSI
     generic  (sg)  device. In the 2.6 series block devices (e.g.
     SCSI disks and DVD drives) can also be specified. For  exam-
     ple  "sgstart  0 /dev/sda" will work in the 2.6 series ker-
     nels.

EXIT STATUS
     The exit status of sgstart is 0 when it is successful. Oth-
     erwise see the sg3utils(1M) man page.

OLDER COMAND LINE OPTIONS
     The options in this section were  the  only  ones  available
     prior  to sg3utils version 1.23 . In sg3utils version 1.23
     and later these older options can be selected by either set-
     ting  the  SG3UTILSOLDOPTS  environment variable or using
     '--old' (or '-O) as the first option.

     Note that the action of --loej is slightly different in  the
     older  interface: when neither --start nor --stop (nor prox-
     ies for them) are given, --loej performs an eject operation.
     In  the  same  situation  the newer interface will perform a
     load operation.

     Earlier versions of sgstart had a '-s' option to perform  a
     SYNCHRONIZE CACHE command before the START STOP UNIT command
     was issued. According to recent SBC-2 drafts  this  is  done
     implicitly  if  required.  Hence  the  '-s'  option has been
     dropped.

     All options, other than '-v' and '-V', can be given  with  a
     single  "-".   For  example:  "sgstart  -stop /dev/sda" and
     "sgstart --stop /dev/sda" are equivalent.  The  single  "-"
     form is for backward compatibility.

     0    stop (spin-down) DEVICE.

     1    start (spin-up) DEVICE.

     --eject
          stop the medium and eject it from the drive.

     --fl=FL
          sets the format layer number for the disc to "jump"  to
          (defined in MC-5).

     -i   sets the IM bit on the START STOP UNIT command so this
          utility  will  return  immediately and not wait for the
          media to spin  down.  Same  effect  as  '--imm=1'.  The



sg3utils-1.26       Last change: March 2008                    4






SG3UTILS                                            SGSTART(1M)



          default  action  (without  this  option  or a '--imm=1'
          option) is to wait until the media  spins  down  before
          returning.

     --imm=01
          when the immediate bit is 1 then this  utility  returns
          immediately  after the device has received the command.
          When this option is 0 (the default)  then  the  utility
          returns once the command has completed its action (i.e.
          it waits until the device is started or stopped).

     --load
          load the medium in the drive and start it.

     --loej
          sets the LOEJ bit in the START STOP UNIT  cdb.  When  a
          "start"  operation  is indicated, then a load and start
          is performed. When a  "stop"  operation  is  indicated,
          then  a  stop  and  eject  is performed. When neither a
          "start" or "stop" operation is indicated  does  a  stop
          and  eject. [Note that the last action differs from the
          new interface in which the option of this name defaults
          to load and start.]

     -N   switch to the newer style options.

     --mod=PCMOD
          where PCMOD is the 'power condition modifier' value. 0
          to  15 (inclusive) are valid and 0 is the default. This
          field was added after sbc3r13.

     --noflush
          do not perform a flush to media (e.g. like  SYNCHRONIZE
          CACHE  does) before a variant of this utility that lim-
          its access to the media. Using the --stop option is  an
          example  of  something that limits access to the media.
          This field was added after sbc3r13.

     --pc=PC
          where PC is the 'power condition' value (in hex). 0  to
          f (inclusive) are valid. Default value is 0.

     --start
          start (spin-up) DEVICE.

     --stop
          stop (spin-down) DEVICE. Same meaning as "0" argument.

     -v   verbose: outputs SCSI command in hex to console  before
          with  executing  it. '-vv' and '-vvv' are also accepted
          yielding greater verbosity.




sg3utils-1.26       Last change: March 2008                    5






SG3UTILS                                            SGSTART(1M)



     -V   print out version string then exit.

AUTHOR
     Written by K. Garloff and D. Gilbert

REPORTING BUGS
     Report bugs to .

COPYRIGHT
     Copyright O 2002-2008 Kurt Garloff, Douglas Gilbert
     This software is distributed under the GPL version 2.  There
     is  NO warranty; not even for MERCHANTABILITY or FITNES FOR
     A PARTICULAR PURPOSE.

SEE ALSO
     sgprevent(sg3utils),               sgrequests(sg3utils),
     sgturs(sg3utils) sdparm(sdparm)

ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     
       ATRIBUTE TYPE     ATRIBUTE VALUE
    
     Availability         SUNWsg3utilsu  
    
     Interface Stability  Committed      
    

NOTES
     Source for sg3utils is available on http:/opensolaris.org.























sg3utils-1.26       Last change: March 2008                    6



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™