|
NAMEsg_start - send SCSI START STOP UNIT command: start, stop, load or eject mediumSYNOPSISsg_start [0] [1] [--eject] [--help] [--fl=FL] [--immed] [--load] [--loej] [--mod=PC_MOD] [--noflush] [--pc=PC] [--readonly] [--start] [--stop] [--verbose] [--version] DEVICEsg_start [--eject] [--fl=FL] [-i] [--imm=0|1] [--load] [--loej] [--mod=PC_MOD] [--noflush] [--pc=PC] [-r] [--start] [--stop] [-v] [-V] [0|1] DEVICE DESCRIPTIONsg_start 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 conjunction with --start (i.e. load medium then spin up). Alternatively --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 preferred 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. OPTIONSArguments to long options are mandatory for short options as well.
NOTESTo 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 sg_requests 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. 'sg_start --eject /dev/hdd' where the DEVICE is an ATAPI cd/dvd drive) may be prevented by a prior SCSI PREVENT ALLOW MEDIUM REMOVAL command (see sg_prevent). In this case this utility should fail with an error generated by the device: illegal request / medium removal prevented. This can be overridden using sg_prevent 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 UNIT READY command will yield a "not ready" sense key and an more informative additional sense code. See the sg_turs 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 example "sg_start 0 /dev/sda" will work in the 2.6 series kernels. In the Linux 2.6 series, especially with ATA disks, using this utility to stop (spin down) a disk may not be sufficient and other mechanisms will start the disk again some time later. The user might additionally mark the disk as "offline" with 'echo offline > /sys/block/sda/device/state' where sda is the block name of the disk. To restart the disk "offline" can be replaced with "running". Note that once the 'state' is set to offline, no SCSI commands can be sent to the device until it is set back to running. Also stopping a disk via a pass-through interface (e.g. /dev/sg1 or /dev/bsg/1:0:0:0) may reduce unwanted side effects (such as restarting it again when this utility completes). EXIT STATUSThe exit status of sg_start is 0 when it is successful. Otherwise see the sg3_utils(8) man page.OLDER COMMAND LINE OPTIONSThe options in this section were the only ones available prior to sg3_utils version 1.23 . Since then this utility defaults to the newer command line options which can be overridden by using --old (or -O) as the first option. See the ENVIRONMENT VARIABLES section for another way to force the use of these older command line options.Note that the action of --loej is slightly different in the older interface: when neither --start nor --stop (nor proxies for them) are given, --loej performs an eject operation. In the same situation the newer interface will perform a load operation. Earlier versions of sg_start 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: "sg_start -stop /dev/sda" and "sg_start --stop /dev/sda" are equivalent. The single "-" form is for backward compatibility.
ENVIRONMENT VARIABLESSince sg3_utils version 1.23 the environment variable SG3_UTILS_OLD_OPTS can be given. When it is present this utility will expect the older command line options. So the presence of this environment variable is equivalent to using --old (or -O) as the first command line option.AUTHORWritten by K. Garloff and D. GilbertREPORTING BUGSReport bugs to <dgilbert at interlog dot com>.COPYRIGHTCopyright © 2002-2017 Kurt Garloff, Douglas GilbertThis software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSOsg_prevent(sg3_utils), sg_requests(sg3_utils), sg_turs(sg3_utils) sdparm(sdparm)
Visit the GSP FreeBSD Man Page Interface. |