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]   [--mod=PC_MOD]   [--noflush]  [--pc=PC]  [--start]  [--stop]
12       [--verbose] [--version] DEVICE
13
14       sg_start  [--eject]  [--fl=FL]  [-i]  [--imm=0|1]   [--load]   [--loej]
15       [--mod=PC_MOD] [--noflush] [--pc=PC] [--start] [--stop] [-v] [-V] [0|1]
16       DEVICE
17

DESCRIPTION

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

OPTIONS

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

NOTES

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

EXIT STATUS

157       The  exit  status of sg_start is 0 when it is successful. Otherwise see
158       the sg3_utils(8) man page.
159

OLDER COMMAND LINE OPTIONS

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

AUTHOR

243       Written by K. Garloff and D. Gilbert
244

REPORTING BUGS

246       Report bugs to <dgilbert at interlog dot com>.
247
249       Copyright © 2002-2008 Kurt Garloff, Douglas Gilbert
250       This software is distributed under the GPL version 2. There is NO  war‐
251       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
252       POSE.
253

SEE ALSO

255       sg_prevent(sg3_utils),    sg_requests(sg3_utils),    sg_turs(sg3_utils)
256       sdparm(sdparm)
257
258
259
260sg3_utils-1.26                    March 2008                       SG_START(8)
Impressum