1SG_TURS(8)                         SG3_UTILS                        SG_TURS(8)
2
3
4

NAME

6       sg_turs - send one or more SCSI TEST UNIT READY commands
7

SYNOPSIS

9       sg_turs   [--delay=MS]   [--help]  [--low]  [--num=NUM]  [--number=NUM]
10       [--progress] [--time] [--verbose] [--version] DEVICE
11
12       sg_turs [-d=MS] [-n=NUM] [-p]  [-t] [-v] [-V] DEVICE
13

DESCRIPTION

15       This utility sends one or more SCSI TEST UNIT READY commands to the DE‐
16       VICE.  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 op‐
23       tions.
24

OPTIONS

26       Arguments to long options are mandatory for short options as well.
27
28       -d, --delay=MS
29              this option causes a delay of MS milliseconds  to  occur  before
30              each TEST UNIT READY command is issued.
31
32       -h, --help
33              print out the usage message then exit.
34
35       -l, --low
36              when  [--progress] is not being used, this utility tries to com‐
37              plete the SCSI TEST UNIT READY command(s) as quickly  as  possi‐
38              ble.  Usually  it  calls  a  library  function  to  do  each TUR
39              (sg_ll_test_unit_ready). With this  option  it  uses  the  lower
40              level  sg_pt  interface  (see  sg_pt.h) to save a little time on
41              each TUR.
42
43       -n, --num=NUM
44              performs TEST UNIT READY NUM times. If not given defaults to  1.
45              These  suffix  multipliers  are  permitted:  c C *1; w W *2; b B
46              *512; k K  KiB  *1,024;  KB  *1,000;  m  M  MiB  *1,048,576;  MB
47              *1,000,000; g G GiB *1,073,741,824; and GB *1,000,000,000 . Also
48              a suffix of the form "x<n>" multiplies  the  leading  number  by
49              <n>. Alternatively a hex number may be given, prefixed by either
50              '0x' or has a trailing 'h'.
51
52       --number=NUM
53              same as --num=NUM. Added for compatibility with sg_requests  and
54              other  utilities  in  this  package.  The sg_request utility has
55              taken over the role of polling the progress indication which was
56              originally  assigned  to  the TEST UNIT READY command. This is a
57              change by T10.
58
59       -O, --old
60              Switch to older style options. Please use as first option.
61
62       -p, --progress
63              show  progress  indication  (a  percentage)  if  available.   If
64              --num=NUM  is  given,  NUM  is  greater  than  1  and an initial
65              progress indication was detected then this utility waits 30 sec‐
66              onds  before  subsequent  checks.   If  the --delay=MS option is
67              given then it will wait for that number of milliseconds  instead
68              of  30  seconds.  Exits when NUM is reached or there are no more
69              progress indications.  Ignores --time option. See NOTES  section
70              below.
71
72       -t, --time
73              after  completing  the  requested number of TEST UNIT READY com‐
74              mands, outputs the total duration and the average number of com‐
75              mands executed per second.
76
77       -v, --verbose
78              increase level or verbosity.
79
80       -V, --version
81              print version string then exit.
82

NOTES

84       The  progress  indication  is optionally part of the sense data. When a
85       prior command that takes a long time to complete  (and  typically  pre‐
86       cludes other media access commands) is still underway, the progress in‐
87       dication can be used to determine how long before the device returns to
88       its  normal  state.  Around SPC-3 T10 changed the preferred command for
89       polling the progress indication from TEST UNIT READY to  REQUEST  SENSE
90       (see the sg_requests utility).
91
92       The SCSI FORMAT command for disks used with the IMMED bit set is an ex‐
93       ample of an operation that takes a significant amount of time and  pre‐
94       cludes other media access during that time. The IMMED bit set instructs
95       the FORMAT command to return control to the application client once the
96       format  has  commenced (see SBC-3). Several long duration SCSI commands
97       associated with tape drives  also  use  the  progress  indication  (see
98       SSC-3).
99
100       The  DEVICE  is  opened  with  a  read-only flag (e.g. in Unix with the
101       O_RDONLY flag).
102
103       Early standards suggested that the SCSI TEST UNIT READY command be used
104       for polling the progress indication. More recent standards seem to sug‐
105       gest the SCSI REQUEST SENSE command should be used instead.
106

EXIT STATUS

108       The exit status of sg_turs is 0 when it is successful (e.g. in the case
109       of  a mechanical disk, it is spun up and ready to accept commands). For
110       this utility the other exit status of interest is  2  corresponding  to
111       the  "not  ready"  sense  key.  For  other  exit  status values see the
112       sg3_utils(8) man page.
113

OLDER COMMAND LINE OPTIONS

115       The options in this section were  the  only  ones  available  prior  to
116       sg3_utils  version 1.23 . Since then this utility defaults to the newer
117       command line options which can be overridden by using --old (or -O)  as
118       the first option. See the ENVIRONMENT VARIABLES section for another way
119       to force the use of these older command line options.
120
121       -d, --delay=MS
122              this option causes a delay of MS milliseconds  to  occur  before
123              each TEST UNIT READY command is issued.
124
125       -n=NUM performs  TEST UNIT READY NUM times. If not given defaults to 1.
126              Equivalent to --num=NUM in the main description.
127
128       -N, --new
129              Switch to the newer style options.
130
131       -p     show progress indication (a percentage) if  available.   Equiva‐
132              lent to --progress in the main description.
133
134       -t     after  completing  the  requested number of TEST UNIT READY com‐
135              mands, outputs the total duration and the average number of com‐
136              mands executed per second.  Equivalent to --time in the main de‐
137              scription.
138
139       -v     increase level of verbosity.
140
141       -V     print out version string then exit.
142

ENVIRONMENT VARIABLES

144       Since    sg3_utils    version    1.23    the    environment    variable
145       SG3_UTILS_OLD_OPTS  can  be given. When it is present this utility will
146       expect the older command line options. So the presence of this environ‐
147       ment variable is equivalent to using --old (or -O) as the first command
148       line option.
149

AUTHORS

151       Written by D. Gilbert
152
154       Copyright © 2000-2020 Douglas Gilbert
155       This software is distributed under the GPL version 2. There is NO  war‐
156       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
157       POSE.
158

SEE ALSO

160       sg_inq, sg_requests (sg3_utils)
161
162
163
164sg3_utils-1.46                     July 2020                        SG_TURS(8)
Impressum