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] [--readonly] [--start]
12       [--stop] [--verbose] [--version] DEVICE
13
14       sg_start  [--eject]  [--fl=FL]  [-i]  [--imm=0|1]   [--load]   [--loej]
15       [--mod=PC_MOD]  [--noflush] [--pc=PC] [-r] [--start] [--stop] [-v] [-V]
16       [0|1] 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       -r, --readonly
110              open  the  DEVICE  in read-only mode. Maybe required in Linux to
111              stop a nuisance spin-up if the DEVICE is an ATA disk.  The  nui‐
112              sance  spin-up may occur at the end of this command negating the
113              effect of the --stop option.
114
115       -s, --start
116              start (spin-up) the DEVICE. This sets the START bit in the  cdb.
117              Using  this  option on an already started device is harmless. In
118              the absence of other options, this option defaults (i.e. set the
119              START cdb bit).
120
121       -S, --stop
122              stop  (spin-down)  the  DEVICE. This clears the START bit in the
123              cdb.
124
125       -v, --verbose
126              increase the level of verbosity. Can be used multiple times.
127
128       -V, --version
129              print out version string then exit.
130

NOTES

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

EXIT STATUS

163       The exit status of sg_start is 0 when it is successful.  Otherwise  see
164       the sg3_utils(8) man page.
165

OLDER COMMAND LINE OPTIONS

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

AUTHOR

251       Written by K. Garloff and D. Gilbert
252

REPORTING BUGS

254       Report bugs to <dgilbert at interlog dot com>.
255
257       Copyright © 2002-2010 Kurt Garloff, Douglas Gilbert
258       This  software is distributed under the GPL version 2. There is NO war‐
259       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
260       POSE.
261

SEE ALSO

263       sg_prevent(sg3_utils),    sg_requests(sg3_utils),    sg_turs(sg3_utils)
264       sdparm(sdparm)
265
266
267
268sg3_utils-1.29                   February 2010                     SG_START(8)
Impressum