1SG_RESET(8) SG3_UTILS SG_RESET(8)
2
3
4
6 sg_reset - sends SCSI device, bus or host reset; or checks reset state
7
9 sg_reset [-b] [-d] [-h] [-V] DEVICE
10
12 The sg_reset utility with no options (other than DEVICE) reports on the
13 reset state (e.g. if a reset is underway) of DEVICE. When given a -d,
14 -b, or -h option it requests a device, bus or host reset respectively.
15
16 In the linux kernel 2.6 series this utility can be called on sd, sr
17 (cd/dvd), st or sg device nodes; if the user has appropriate permis‐
18 sions.
19
20 In the linux kernel 2.4 series support for this utility first appeared
21 in lk 2.4.19 and could only be called on sg device nodes. Various ven‐
22 dors made this capability available in their kernels prior to lk
23 2.4.19.
24
26 -b attempt a SCSI bus reset. This would normally be tried if the
27 device reset (i.e. option -d) was not successful.
28
29 -d attempt a SCSI device reset. If the device seems stuck, this is
30 the first reset that should be tried. This assumes the linux
31 scsi mid level error handler is not already in the process of
32 resetting DEVICE.
33
34 -h attempt a host adapter reset. This would normally be tried if
35 both device reset (i.e. option -d) and bus reset (i.e. option
36 -b) were not successful.
37
38 -V prints the version string then exits.
39
41 The error recovery code within the linux kernel when faced with SCSI
42 commands timing out and no response from the device (LU), first tries a
43 device reset and if that is not successful tries a bus reset. If that
44 is not successful it tries a host reset. Users of this utility should
45 check whether such a recovery is already underway before trying to
46 reset with this utility. The "device,bus,host" order is also recom‐
47 mended (i.e. first start with the smallest hammer).
48
49 SAM-4 defines a hard reset (which includes a device power on and a
50 transport reset), a logical unit reset and a I_T nexus reset. A LU
51 reset and an I_T nexus reset can be requested via task management func‐
52 tion (and support for LU reset is mandatory). In Linux the SCSI sub‐
53 system leaves it up to the low level drivers as to whether a "device
54 reset" is only for the addressed LU or all the LUs in the device that
55 contains the addressed LU. The "bus reset" is a transport reset. A
56 "host reset" attempts to re-initialize the HBA that the request passes
57 through on route to the DEVICE. Obviously a "host reset" and a "bus
58 reset" can cause collateral damage.
59
60 This utility does not allow individual SCSI commands (or tasks as they
61 are called in SAM-4) to be aborted. SAM-4 defines ABORT TASK and ABORT
62 TASK SET task management functions for that.
63
65 Written by Douglas Gilbert.
66
68 Copyright © 1999-2006 Douglas Gilbert
69 This software is distributed under the GPL version 2. There is NO war‐
70 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
71 POSE.
72
73
74
75sg3_utils-1.23 December 2006 SG_RESET(8)