SG_START(8)

NAME
sg_start - starts (spins-up) or stops (spins down) SCSI devices

SYNOPSIS
sg_start [-imm=0|1] [-loej] [-pc=<n>] [-v] [-V] 0|1 <scsi_device>

DESCRIPTION

sg_start sends a START STOP UNIT SCSI command to the given device with the selected options. The most used options are "0" to spin down a disk and "1" to spin up a disk. Using "sg_start 1 /dev/sg0" on a disk that is already spinning is harmless. There is also finer grain control with "power conditions": active, idle and standby. 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' flag to load the media when used in conjunction with "1" (i.e. load media then spin up). Alternatively '-loej' may be used to eject the media when used alone or when used in conjunction with "0" (i.e. spin down then eject media).

0   stop (spin-down) given device. Active when '-pc=0' or is not given.

1   start (spin-up) given device. Active when '-pc=0' or is not given.

-imm=0|1
    when the immediate bit is 1 (default) then this command (and hence this utility) return immediately after the device has received the command. When this switch is 0 then the command returns when the action it requests has been completed.

-loej
    load the media when the unit is started or eject it when the unit is stopped. 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 (neither "0" nor "1") and this option is given then a stop and eject action is assumed.

-pc=<n>
    set the 'power conditions' value (in hex); 0 to f (inclusive) are valid. Default value is 0. When '-pc=0' then the start value (i.e. 0 or 1) and '-loej' are active. Some common values are 1 for the active power condition; 2 for the idle power condition; 3 for the standby power condition, 7 for LU_CONTROL, a (hex == decimal 10) for FORCE_IDLE_0 and b (hex) for FORCE_STANDBY_0. See recent SBC-2 or SAS drafts at www.t10.org for more information.

-v  verbose: outputs SCSI command in hex to console before with executing it.

-V  print out version string then exit.

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 sg_modes utility can be used to view the power condition mode page and the sginfo utility can view and change it. If a device is in either idle or standby power condition state then a REQUEST SENSE command (se the sg_requests utility) should yield a sense key of "no sense" and an additional sense code of "Low power condition on".

Ejection of removable media (e.g. 'sg_start 0 -loej /dev/hdd' where the device is an ATAPI cd/dvd drive) may be prevented by a prior PREVENT ALLOW MEDIUM REMOVAL SCSI command (see sg_prevent). In this case this utility should fail with an error generated by the device: illegal request / medium removal prevented.

In the 2.4 series of Linux kernels the given device must be a SCSI generic (sg) device. In the 2.6 series block devices (e.g. disks and SCSI DVDs) can also be specified. For example "sg_start 0 /dev/sda" will work in the 2.6 series kernels.

NOTE
Earlier versions 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.

AUTHOR
Written by K. Garloff and D. Gilbert

REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.

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

SEE ALSO
sg_prevent(sg3_utils), sg_requests(sg3_utils), sg_modes(sg3_utils), sginfo(sg3_utils)