1SG_TURS(8) SG3_UTILS SG_TURS(8)
2
3
4
6 sg_turs - send one or more SCSI TEST UNIT READY commands
7
9 sg_turs [--help] [--low] [--number=NUM] [--num=NUM] [--progress]
10 [--time] [--verbose] [--version] DEVICE
11
12 sg_turs [-n=NUM] [-p] [-t] [-v] [-V] DEVICE
13
15 This utility sends one or more SCSI TEST UNIT READY commands to the
16 DEVICE. This may be useful for timing the per command overhead. Note
17 that TEST UNIT READY has no associated data, just a 6 byte command
18 (with each byte a zero) and a returned SCSI status value.
19
20 This utility supports two command line syntaxes, the preferred one is
21 shown first in the synopsis and explained in this section. A later sec‐
22 tion on the old command line syntax outlines the second group of
23 options.
24
26 Arguments to long options are mandatory for short options as well.
27
28 -h, --help
29 print out the usage message then exit.
30
31 -l, --low
32 when [--progress] is not being used, this utility tries to com‐
33 plete the SCSI TEST UNIT READY command(s) as quickly as possi‐
34 ble. Usually it calls a library function to do each TUR
35 (sg_ll_test_unit_ready). With this option it uses the lower
36 level sg_pt interface (see sg_pt.h) to save a little time on
37 each TUR.
38
39 -n, --number=NUM
40 performs TEST UNIT READY NUM times. If not given defaults to 1.
41 These suffix multipliers are permitted: c C *1; w W *2; b B
42 *512; k K KiB *1,024; KB *1,000; m M MiB *1,048,576; MB
43 *1,000,000; g G GiB *1,073,741,824; and GB *1,000,000,000 . Also
44 a suffix of the form "x<n>" multiplies the leading number by
45 <n>. Alternatively a hex number may be given, prefixed by either
46 '0x' or has a trailing 'h'.
47
48 --num=NUM
49 same as --number=NUM. Added for compatibility with sg_requests
50 which has taken over the role of polling the progress indica‐
51 tion.
52
53 -O, --old
54 Switch to older style options. Please use as first option.
55
56 -p, --progress
57 show progress indication (a percentage) if available. If --num‐
58 ber=NUM is given, NUM is greater than 1 and an initial progress
59 indication was detected then this utility waits 30 seconds
60 before subsequent checks. Exits when NUM is reached or there
61 are no more progress indications. Ignores --time option. See
62 NOTES section below.
63
64 -t, --time
65 after completing the requested number of TEST UNIT READY com‐
66 mands, outputs the total duration and the average number of com‐
67 mands executed per second.
68
69 -v, --verbose
70 increase level or verbosity.
71
72 -V, --version
73 print version string then exit.
74
76 The progress indication is optionally part of the sense data. When a
77 prior command that takes a long time to complete (and typically pre‐
78 cludes other media access commands) is still underway, the progress
79 indication can be used to determine how long before the device returns
80 to its normal state. Around SPC-3 T10 changed the preferred command for
81 polling the progress indication from TEST UNIT READY to REQUEST SENSE
82 (see the sg_requests utilty).
83
84 The SCSI FORMAT command for disks used with the IMMED bit set is an
85 example of an operation that takes a significant amount of time and
86 precludes other media access during that time. The IMMED bit set
87 instructs the FORMAT command to return control to the application
88 client once the format has commenced (see SBC-3). Several long duration
89 SCSI commands associated with tape drives also use the progress indica‐
90 tion (see SSC-3).
91
92 The DEVICE is opened with a read-only flag (e.g. in Unix with the
93 O_RDONLY flag).
94
95 Early standards suggested that the SCSI TEST UNIT READY command be used
96 for polling the progress indication. More recent standards seem to sug‐
97 gest the SCSI REQUEST SENSE command should be used instead.
98
100 The exit status of sg_turs is 0 when it is successful (e.g. in the case
101 of a mechanical disk, it is spun up and ready to accept commands). For
102 this utility the other exit status of interest is 2 corresponding to
103 the "not ready" sense key. For other exit status values see the
104 sg3_utils(8) man page.
105
107 The options in this section were the only ones available prior to
108 sg3_utils version 1.23 . Since then this utility defaults to the newer
109 command line options which can be overridden by using --old (or -O) as
110 the first option. See the ENVIRONMENT VARIABLES section for another way
111 to force the use of these older command line options.
112
113 -n=NUM performs TEST UNIT READY NUM times. If not given defaults to 1.
114 Equivalent to --number=NUM in the main description.
115
116 -N, --new
117 Switch to the newer style options.
118
119 -p show progress indication (a percentage) if available. Equiva‐
120 lent to --progress in the main description.
121
122 -t after completing the requested number of TEST UNIT READY com‐
123 mands, outputs the total duration and the average number of com‐
124 mands executed per second. Equivalent to --time in the main
125 description.
126
127 -v increase level of verbosity.
128
129 -V print out version string then exit.
130
132 Since sg3_utils version 1.23 the environment variable
133 SG3_UTILS_OLD_OPTS can be given. When it is present this utility will
134 expect the older command line options. So the presence of this environ‐
135 ment variable is equivalent to using --old (or -O) as the first command
136 line option.
137
139 Written by D. Gilbert
140
142 Copyright © 2000-2018 Douglas Gilbert
143 This software is distributed under the GPL version 2. There is NO war‐
144 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
145 POSE.
146
148 sg_inq, sg_requests (sg3_utils)
149
150
151
152sg3_utils-1.43 March 2018 SG_TURS(8)