1SG_RESET(8) SG3_UTILS SG_RESET(8)
2
3
4
6 sg_reset - sends SCSI device, target, bus or host reset; or checks
7 reset state
8
10 sg_reset [-b] [-d] [-h] [-t] [-V] DEVICE
11
13 The sg_reset utility with no options (just a DEVICE) reports on the
14 reset state (e.g. if a reset is underway) of DEVICE. When given a -d,
15 -t, -b or -h option it requests a device, target, bus or host reset
16 respectively.
17
18 The ability to reset a SCSI target (often called a "hard reset" at the
19 transport level) was added in linux kernel 2.6.27 . Low level drivers
20 that support target reset hopefully reset a logical unit only when
21 given the device reset (i.e. -d) option. This should removed the ambi‐
22 guity of whether "device" meant LU or target that we have had in the
23 past.
24
25 In the linux kernel 2.6 series this utility can be called on sd, sr
26 (cd/dvd), st or sg device nodes; if the user has appropriate permis‐
27 sions.
28
29 In the linux kernel 2.4 series support for this utility first appeared
30 in lk 2.4.19 and could only be called on sg device nodes. Various ven‐
31 dors made this capability available in their kernels prior to lk
32 2.4.19.
33
35 -b attempt a SCSI bus reset. This would normally be tried if the
36 device reset (i.e. option -d) was not successful.
37
38 -d attempt a SCSI device reset. If the device seems stuck, this is
39 the first reset that should be tried. This assumes the linux
40 scsi mid level error handler is not already in the process of
41 resetting DEVICE.
42
43 -h attempt a host adapter reset. This would normally be tried if
44 both device reset (i.e. option -d) and bus reset (i.e. option
45 -b) were not successful.
46
47 -t attempt a SCSI target reset. This assumes the linux scsi mid
48 level error handler is not already in the process of resetting
49 the target that contains the given DEVICE.
50
51 -V prints the version string then exits.
52
54 The error recovery code within the linux kernel when faced with a SCSI
55 command timing out and no response from the device (LU), first tries a
56 device reset and if that is not successful tries a target reset. If
57 that is not successful it tries a bus reset. If that is not successful
58 it tries a host reset. Users of this utility should check whether such
59 a recovery is already underway before trying to reset with this util‐
60 ity. The "device,target,bus,host" order is also recommended (i.e. first
61 start with the smallest hammer). The above is a generalization and
62 exact details will vary depending on the transport and the low level
63 driver concerned.
64
65 SAM-4 defines a hard reset, a logical unit reset and a I_T nexus reset.
66 A hard reset is defined to be a power on condition, a microcode change
67 or a transport reset event. A LU reset and an I_T nexus reset can be
68 requested via task management function (and support for LU reset is
69 mandatory). In Linux the SCSI subsystem leaves it up to the low level
70 drivers as to whether a "device reset" is only for the addressed LU or
71 all the LUs in the device that contains the addressed LU (i.e. a target
72 reset). The additional of the target reset (i.e. option -t) should give
73 more control in this area. The "bus reset" is a transport reset and
74 may be a dummy operation, depending on the transport. A "host reset"
75 attempts to re-initialize the HBA that the request passes through en
76 route to the DEVICE. Note that a "host reset" and a "bus reset" may
77 cause collateral damage.
78
79 This utility does not allow individual SCSI commands (or tasks as they
80 are called in SAM-4) to be aborted. SAM-4 defines ABORT TASK and ABORT
81 TASK SET task management functions for that.
82
83 Prior to SAM-3 there was a TARGET RESET task management function. Sev‐
84 eral transports still support that function and many associated linux
85 low level drivers map the -t option to it.
86
88 Written by Douglas Gilbert.
89
91 Copyright © 1999-2009 Douglas Gilbert
92 This software is distributed under the GPL version 2. There is NO war‐
93 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
94 POSE.
95
96
97
98sg3_utils-1.28 July 2009 SG_RESET(8)