1SG_START(8)                        SG3_UTILS                       SG_START(8)
2
3
4

NAME

6       sg_start  -  send  SCSI START STOP UNIT command to start, stop, load or
7       eject medium
8

SYNOPSIS

10       sg_start  [0]  [1]  [--eject]  [--help]  [--fl=FL]  [--immed]  [--load]
11       [--loej] [--pc=PC] [--start] [--stop] [--verbose] [--version] DEVICE
12
13       sg_start   [--eject]   [--fl=FL]  [-i]  [--imm=0|1]  [--load]  [--loej]
14       [--pc=PC] [--start] [--stop] [-v] [-V] [0|1] DEVICE
15

DESCRIPTION

17       sg_start sends a SCSI START STOP UNIT command to the  DEVICE  with  the
18       selected  options. The most used options are --stop to spin down a disk
19       and --start to spin up a disk. Using --start on a disk that is  already
20       spinning  is  harmless.  There  is also finer grain control with "power
21       conditions": active, idle and standby. This is  set  with  the  --pc=PC
22       option.  In  some  contexts the "stop" state can be considered an addi‐
23       tional power condition.
24
25       Devices that contain removable media such as cd/dvds can use the --loej
26       option  to  load the medium when used in conjunction with --start (i.e.
27       load medium then spin up). Alternatively --loej may be  used  to  eject
28       the  medium  when  used in conjunction with --stop (i.e. spin down then
29       eject medium). More simply, the loading  or  ejecting  of  a  removable
30       medium can be requested with the --load or --eject' option.
31
32       If  no  option  or  argument is given then a --start is assumed; as the
33       utility's name suggests.
34
35       This utility supports two command line syntaxes, the preferred  one  is
36       shown first in the synopsis and explained in this section. A later sec‐
37       tion on the old command  line  syntax  outlines  the  second  group  of
38       options.
39

OPTIONS

41       Arguments to long options are mandatory for short options as well.
42
43       0      same action as --stop.
44
45       1      same action as --start.
46
47       -e, --eject
48              stop  the  medium  and eject it from the drive. Only appropriate
49              for a device with  removable  medium.  Might  be  ignored  (pre‐
50              vented), see below.
51
52       -h, --help
53              print out the usage message then exit.
54
55       -f, --fl=FL
56              sets  the format layer number for the disc to "jump" to (defined
57              in MMC-5).  Values of FL can be 0 to 3. When this option is cho‐
58              sen,  the FL, LoEj and Start bits are set in the cdb as required
59              by MMC-5; thus the user does not need to set the --start  and/or
60              --load options.
61
62       -i, --immed
63              sets  the IMM bit on the START STOP UNIT command so this utility
64              will return immediately and not wait for the media  to  complete
65              the  requested action. The default is to wait until the media to
66              complete the requested action before returning.
67
68       -l, --load
69              load the medium in the drive and start it. Only appropriate  for
70              a removable medium.
71
72       -L, --loej
73              sets the LOEJ bit on the START STOP UNIT command. This loads the
74              media when the unit is started or eject  it  when  the  unit  is
75              stopped (i.e.  works in conjunction with START bit in cdb). This
76              option is ignored if 'pc >  0'.   Default  is  off  (i.e.  don't
77              attempt  to load or eject media). If a start/start indication is
78              not given (i.e. neither --start nor --stop) and this  option  is
79              given then a load and start action is assumed.
80
81       -O, --old
82              switch to older style options.
83
84       -p, --pc=PC
85              where  PC  is  the 'power conditions' value. 0 to 15 (inclusive)
86              are valid.  Default value is  0.  When  '--pc=0'  then  --eject,
87              --load,  --loej, --start and --stop are active. Some common val‐
88              ues are 1 for the "active" power condition (SBC); 2 for the idle
89              power  condition; 3 for the standby power condition; 5 for sleep
90              power condition (MMC); 7 for LU_CONTROL (SBC), 0xa (decimal  10)
91              for  FORCE_IDLE_0 (SBC) and 0xb (decimal 11) for FORCE_STANDBY_0
92              (SBC). See recent SBC-3, MMC-5 and SAS drafts at www.t10.org for
93              more information.
94
95       -s, --start
96              start  (spin-up) the device. This sets the START bit in the cdb.
97              Using this option on an already started device is  harmless.  In
98              the absence of other options, this option defaults (i.e. set the
99              START cdb bit).
100
101       -S, --stop
102              stop (spin-down) the device. This clears the START  bit  in  the
103              cdb.
104
105       -v, --verbose
106              increase the level of verbosity. Can be used multiple times.
107
108       -V, --version
109              print out version string then exit.
110

NOTES

112       To  avoid  confusion,  only  one  of  0, 1 --eject, --load, --start and
113       --stop should be given.
114
115       There is an associated "power condition"  mode  page  (0x1a)  in  which
116       timer  values  can  be  set for transitioning to either idle or standby
117       state after a period of inactivity. The sdparm utility can be  used  to
118       view  the  power  condition  mode  page and if required change it. If a
119       device is in either idle  or  standby  power  condition  state  then  a
120       REQUEST  SENSE  command  (see  the  sg_requests utility) should yield a
121       sense key of "no sense" and an additional sense code of "Low power con‐
122       dition on" on recent SCSI devices.
123
124       Ejection of removable media (e.g. 'sg_start --eject /dev/hdd' where the
125       device is an ATAPI cd/dvd drive) may be prevented by a prior SCSI  PRE‐
126       VENT  ALLOW  MEDIUM REMOVAL command (see sg_prevent). In this case this
127       utility should fail with an error  generated  by  the  device:  illegal
128       request  /  medium  removal  prevented.  This  can  be overridden using
129       sg_prevent or, for example, 'sdparm --command=unlock /dev/hdd'.
130
131       The SCSI TEST UNIT READY command can be used  to  find  out  whether  a
132       device is ready to transfer data. If rotating media is stopped or still
133       coming up to speed, then the TEST UNIT READY command will yield a  "not
134       ready" sense key and an more informative additional sense code. See the
135       sg_turs utility.
136
137       In the 2.4 series of Linux kernels the DEVICE must be  a  SCSI  generic
138       (sg)  device.  In the 2.6 series block devices (e.g. SCSI disks and DVD
139       drives) can also be specified. For example "sg_start 0  /dev/sda"  will
140       work in the 2.6 series kernels.
141

EXIT STATUS

143       The  exit  status of sg_start is 0 when it is successful. Otherwise see
144       the sg3_utils(8) man page.
145

OLDER COMMAND LINE OPTIONS

147       The options in this section were  the  only  ones  available  prior  to
148       sg3_utils  version  1.23  .  In  sg3_utils version 1.23 and later these
149       older options can be selected by either setting the  SG3_UTILS_OLD_OPTS
150       environment variable or using '--old' (or '-O) as the first option.
151
152       Note  that  the  action  of  --loej  is slightly different in the older
153       interface: when neither --start nor --stop (nor proxies for  them)  are
154       given,  --loej  performs  an eject operation. In the same situation the
155       newer interface will perform a load operation.
156
157       Earlier versions of sg_start had a '-s' option to perform a SYNCHRONIZE
158       CACHE  command before the START STOP UNIT command was issued. According
159       to recent SBC-2 drafts this is done implicitly if required.  Hence  the
160       '-s' option has been dropped.
161
162       All  options, other than '-v' and '-V', can be given with a single "-".
163       For example: "sg_start -stop /dev/sda" and "sg_start  --stop  /dev/sda"
164       are equivalent. The single "-" form is for backward compatibility.
165
166       0      stop (spin-down) DEVICE.
167
168       1      start (spin-up) DEVICE.
169
170       --eject
171              stop the medium and eject it from the drive.
172
173       --fl=FL
174              sets  the format layer number for the disc to "jump" to (defined
175              in MMC-5).
176
177       -i     sets the IMM bit on the START STOP UNIT command so this  utility
178              will return immediately and not wait for the media to spin down.
179              Same effect as  '--imm=1'.  The  default  action  (without  this
180              option  or  a '--imm=1' option) is to wait until the media spins
181              down before returning.
182
183       --imm=0|1
184              when the immediate bit is 1 then this  utility  returns  immedi‐
185              ately  after  the  device  has  received  the command. When this
186              option is 0 (the default) then the utility returns once the com‐
187              mand has completed its action (i.e. it waits until the device is
188              started or stopped).
189
190       --load load the medium in the drive and start it.
191
192       --loej sets the LOEJ bit in the START STOP UNIT  cdb.  When  a  "start"
193              operation is indicated, then a load and start is performed. When
194              a "stop" operation is indicated, then a stop and eject  is  per‐
195              formed.  When neither a "start" or "stop" operation is indicated
196              does a stop and eject. [Note that the last action  differs  from
197              the  new  interface in which the option of this name defaults to
198              load and start.]
199
200       -N     switch to the newer style options.
201
202       --pc=PC
203              where PC is the 'power  conditions'  value  (in  hex).  0  to  f
204              (inclusive) are valid. Default value is 0.
205
206       --start
207              start (spin-up) DEVICE.
208
209       --stop stop (spin-down) DEVICE. Same meaning as "0" argument.
210
211       -v     verbose: outputs SCSI command in hex to console before with exe‐
212              cuting it. '-vv' and '-vvv' are also accepted  yielding  greater
213              verbosity.
214
215       -V     print out version string then exit.
216

AUTHOR

218       Written by K. Garloff and D. Gilbert
219

REPORTING BUGS

221       Report bugs to <dgilbert at interlog dot com>.
222
224       Copyright © 2002-2007 Kurt Garloff, Douglas Gilbert
225       This  software is distributed under the GPL version 2. There is NO war‐
226       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
227       POSE.
228

SEE ALSO

230       sg_prevent(sg3_utils),    sg_requests(sg3_utils),    sg_turs(sg3_utils)
231       sdparm(sdparm)
232
233
234
235sg3_utils-1.23                   January 2007                      SG_START(8)
Impressum