{
    "mode": "man",
    "parameter": "sg_reset",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sg_reset/8/json",
    "generated": "2026-06-16T06:17:37Z",
    "synopsis": "sgreset  [--bus]  [--device] [--help] [--host] [--no-esc] [--target] [--verbose] [--version]\nDEVICE",
    "sections": {
        "NAME": {
            "content": "sgreset - sends SCSI device, target, bus or host reset; or checks reset state\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sgreset  [--bus]  [--device] [--help] [--host] [--no-esc] [--target] [--verbose] [--version]\nDEVICE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The sgreset utility with no options (just a DEVICE) reports on the reset state  (e.g.  if  a\nreset  is underway) of the DEVICE. When given a --device, --target, --bus or --host option it\nrequests a device, target, bus or host reset respectively.\n\nA device reset is applied to the Logical Unit (LU) corresponding to DEVICE. It is most likely\nimplemented  by  a  Low  level  Driver (LLD) in Linux as a LOGICAL UNIT RESET task management\nfunction.\n\nThe ability to reset a SCSI target was added in Linux kernel 2.6.27 .  A  LLD  may  send  Low\nlevel Drivers (LLDs) the IT NEXUS RESET task management function. Alternatively it may use a\ntransport mechanism to do the same thing (e.g. a hard reset on the link containing a SAS tar‐\nget).\n\nIn  the Linux kernel 2.6 and 3 series this utility can be called on sd, sr (cd/dvd), st or sg\ndevice nodes; if the user has appropriate permissions.\n\nUsers of this utility can check whether a reset recovery is already underway before trying to\nsend  a  new  reset with this utility. Calling this utility with no options, just the DEVICE,\nwill do such a check.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-b --bus",
                    "content": "attempt a SCSI bus reset. A bus reset is a SCSI Parallel Interface (SPI)  concept  not\nfound  in  modern  transports.  A recent LLD may implement it as a series of resets on\ntargets that might be considered as siblings to the target on the DEVICE path.\n",
                    "flag": "-b",
                    "long": "--bus"
                },
                {
                    "name": "-d --device",
                    "content": "attempt a SCSI device reset. This would typically involve sending a LOGICAL UNIT RESET\ntask management function to DEVICE.\n",
                    "flag": "-d",
                    "long": "--device"
                },
                {
                    "name": "-z --help",
                    "content": "print the usage message then exit.\n",
                    "flag": "-z",
                    "long": "--help"
                },
                {
                    "name": "-H --host",
                    "content": "attempt  a  host  reset. The \"host\" in this context is often called a Host Bus Adapter\n(HBA) and contains one or more SCSI initiators.\n",
                    "flag": "-H",
                    "long": "--host"
                },
                {
                    "name": "-N --no-esc",
                    "content": "without this option, if a device reset (--device) fails then it  will  escalate  to  a\ntarget  reset.  And  if a target reset (--target) fails then it will escalate to a bus\nreset. And if a bus reset (--bus) fails then it will escalate to a  host  reset.  With\nthis  option  only the requested reset is attempted. An alternate option name of --no-\nescalate is also accepted.\n",
                    "flag": "-N",
                    "long": "--no-esc"
                },
                {
                    "name": "--no-escalate",
                    "content": "The same as -N, --no-esc.\n",
                    "long": "--no-escalate"
                },
                {
                    "name": "-t --target",
                    "content": "attempt a SCSI target reset. A SCSI target contains one or more LUs. This would  typi‐\ncally  involve  sending a IT NEXUS RESET task management function to DEVICE There may\nbe a transport action that is equivalent (e.g.  in SAS a hard reset on the  link  that\ncontains the target).\n",
                    "flag": "-t",
                    "long": "--target"
                },
                {
                    "name": "-v --verbose",
                    "content": "increase the degree of verbosity (debug messages).\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-V --version",
                    "content": "prints the version string then exits.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "NOTES": {
            "content": "The  error recovery code within the Linux kernel (SCSI mid-level) when faced with a SCSI com‐\nmand timing out and no response from the device (LU) does the following. First it tries a de‐\nvice  reset  and if that is not successful tries a target reset. If that is not successful it\ntries a bus reset. If that is  not  successful  it  tries  a  host  reset.  The  \"device,tar‐\nget,bus,host\"  order  is  the  reset escalation that the --no-esc option attempts to stop. In\nlarge storage configurations the escalation may be (very) undesirable.\n\nThis utility calls the SGSCSIRESET ioctl and as of lk 3.10.7 the  --no-esc  option  is  not\nsupported. Patches to implement this functionality may be accepted in lk 3.18 or 3.19 .\n\nSAM-4  and 5 define a hard reset, a LOGICAL UNIT RESET and a IT NEXUS RESET. A hard reset is\ndefined to be a power on condition, a microcode change or a transport  reset  event.  LOGICAL\nUNIT  RESET  and  IT NEXUS RESET can be requested via task management functions (and support\nfor LOGICAL UNIT RESET is mandatory). In Linux the SCSI subsystem leaves it up to the LLDs as\nto exactly what type (if any) of reset is performed.  The \"bus reset\" is SCSI Parallel Inter‐\nface (SPI) concept that may not map well to recent SCSI transports so it may be a dummy oper‐\nation.  A  \"host  reset\" attempts to re-initialize the HBA that the request passes through en\nroute to the DEVICE. Note that a \"host reset\" and a \"bus reset\" may cause collateral damage.\n\nThis utility does not allow individual SCSI commands to be aborted. SAM-4 defines ABORT  TASK\nand ABORT TASK SET task management functions for that.\n\nPrior  to SAM-3 there was a TARGET RESET task management function. And in SAM-4 IT NEXUS RE‐\nSET appeared which seems closely related: the \"IT\" stands for Initiator-Target.\n\nTransports may have their own types of resets not supported by this utility.  For example SAS\nhas  a  link  reset in which both ends of a physical link (e.g.  between a SAS expander and a\nSAS tape drive) renegotiate their connection.\n\nPrior to version 0.57 of this utility the command line had short options only  (e.g.  -d  but\nnot  --device). Also -h invoked a host reset while in the current version -h is equivalent to\n--help and both -H and --host invoke a host reset. For backward compatibility define the  en‐\nvironment  variable  SG3UTILSOLDOPTS  or SGRESETOLDOPTS . In this case -h will invoke a\nhost reset and the output will be verbose as it  was  previously  (equivalent  to  using  the\n--verbose option now).  For example:\n\nSGRESETOLDOPTS=1 sgreset -h /dev/sg1\nsgreset: starting host reset\nsgreset: completed host reset\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "Since   sg3utils  version  1.23  the  environment  variables  SG3UTILSOLDOPTS  or  SGRE‐\nSETOLDOPTS can be given. When either is present this utility will expect the older  command\nline options as outlined in the NOTES section.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Written by Douglas Gilbert.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 1999-2017 Douglas Gilbert\nThis software is distributed under the GPL version 2. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n\n\nsg3utils-1.43                              October 2017                                 SGRESET(8)",
            "subsections": []
        }
    },
    "summary": "sgreset - sends SCSI device, target, bus or host reset; or checks reset state",
    "flags": [
        {
            "flag": "-b",
            "long": "--bus",
            "arg": null,
            "description": "attempt a SCSI bus reset. A bus reset is a SCSI Parallel Interface (SPI) concept not found in modern transports. A recent LLD may implement it as a series of resets on targets that might be considered as siblings to the target on the DEVICE path."
        },
        {
            "flag": "-d",
            "long": "--device",
            "arg": null,
            "description": "attempt a SCSI device reset. This would typically involve sending a LOGICAL UNIT RESET task management function to DEVICE."
        },
        {
            "flag": "-z",
            "long": "--help",
            "arg": null,
            "description": "print the usage message then exit."
        },
        {
            "flag": "-H",
            "long": "--host",
            "arg": null,
            "description": "attempt a host reset. The \"host\" in this context is often called a Host Bus Adapter (HBA) and contains one or more SCSI initiators."
        },
        {
            "flag": "-N",
            "long": "--no-esc",
            "arg": null,
            "description": "without this option, if a device reset (--device) fails then it will escalate to a target reset. And if a target reset (--target) fails then it will escalate to a bus reset. And if a bus reset (--bus) fails then it will escalate to a host reset. With this option only the requested reset is attempted. An alternate option name of --no- escalate is also accepted."
        },
        {
            "flag": "",
            "long": "--no-escalate",
            "arg": null,
            "description": "The same as -N, --no-esc."
        },
        {
            "flag": "-t",
            "long": "--target",
            "arg": null,
            "description": "attempt a SCSI target reset. A SCSI target contains one or more LUs. This would typi‐ cally involve sending a IT NEXUS RESET task management function to DEVICE There may be a transport action that is equivalent (e.g. in SAS a hard reset on the link that contains the target)."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "increase the degree of verbosity (debug messages)."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "prints the version string then exits."
        }
    ],
    "examples": [],
    "see_also": []
}