{
    "content": [
        {
            "type": "text",
            "text": "# sg_sat_set_features (man)\n\n## NAME\n\nsgsatsetfeatures - use ATA SET FEATURES command via a SCSI to ATA Translation (SAT) layer\n\n## SYNOPSIS\n\nsgsatsetfeatures    [--count=CO]   [--ckcond]   [--extended]   [--feature=FEA]   [--help]\n[--lba=LBA] [--len={16|12}] [--readonly] [--verbose] [--version] DEVICE\n\n## DESCRIPTION\n\nThis utility sends an ATA SET FEATURES command to the DEVICE.  This command is used to change\nsettings  of ATA non-packet (i.e. disks) and packet devices (e.g. cd/dvd drives). Rather than\nsend the SET FEATURES command directly to the device it is sent via a SCSI transport which is\nassumed  to contain a SCSI to ATA Translation (SAT) Layer (SATL). The SATL may be in an oper‐\nating system driver, in host bus adapter firmware or in some external enclosure.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (10 subsections)\n- **NOTES**\n- **EXIT STATUS**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "sg_sat_set_features",
        "section": "",
        "mode": "man",
        "summary": "sgsatsetfeatures - use ATA SET FEATURES command via a SCSI to ATA Translation (SAT) layer",
        "synopsis": "sgsatsetfeatures    [--count=CO]   [--ckcond]   [--extended]   [--feature=FEA]   [--help]\n[--lba=LBA] [--len={16|12}] [--readonly] [--verbose] [--version] DEVICE",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-c",
                "long": "--count",
                "arg": null,
                "description": "the number CO is placed in the \"count\" field in the ATA SET FEATURES command. Only some subcommands (a term used for the value placed in the \"feature\" field) require the count field to be set. The default value placed in the \"count\" field is 0."
            },
            {
                "flag": "-C",
                "long": "--ck",
                "arg": null,
                "description": "sets the CKCOND bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear (i.e. 0). When set the SATL should yield a sense buffer containing a ATA Result de‐ scriptor irrespective of whether the ATA command succeeded or failed. When clear the SATL should only yield a sense buffer containing a ATA Result descriptor if the ATA command failed."
            },
            {
                "flag": "-e",
                "long": "--extended",
                "arg": null,
                "description": "allow for extended LBA numbers (i.e. larger than 32 bits). This value is enabled au‐ tomatically for large LBA numbers, but can be enabled explicitly even for low LBA num‐ bers with this option."
            },
            {
                "flag": "-f",
                "long": "--feature",
                "arg": null,
                "description": "the value FEA is placed in the \"feature\" field in the ATA SET FEATURES command. The term \"subcommand\" is sometimes used for this value. The default value placed in the \"feature\" field is 0 which is reserved and hence should not change anything. Two com‐ mon examples are 2h to enable the write cache and 82h to disable it."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "outputs the usage message summarizing command line options then exits. Ignores DEVICE if given."
            },
            {
                "flag": "-L",
                "long": "--lba",
                "arg": null,
                "description": "the number LBA is placed in the \"lba\" field of the ATA SET FEATURES command. Only some sub-commands (a term used for the value placed in the \"feature\" field) require the lba field to be set. This value is typically not a \"logical block address\" as the acronym might imply. The default value placed in the \"lba\" field is 0. The maximum value al‐ lowed for LBA is 0xfffffffe (or 0xffffff if --len=12)."
            },
            {
                "flag": "-l",
                "long": "--len",
                "arg": null,
                "description": "this is the length of the SCSI cdb used for the ATA PASS-THROUGH commands. The argu‐ ment can either be 16 or 12. The default is 16. Some SCSI transports cannot convey SCSI commands longer than 12 bytes."
            },
            {
                "flag": "-r",
                "long": "--readonly",
                "arg": null,
                "description": "causes the DEVICE to be opened with the read-only flag (ORDONLY in Unix). The default action is to open DEVICE with the read-write flag (ORDWR in Unix). In some cases sending power management commands to ATA disks are defeated by OS actions on the close() if the DEVICE was opened with the read-write flag (e.g. the OS might think it needs to flush something to disk)."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "increases the level or verbosity."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "print out version string"
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "sgsatidentify",
                "section": "sg3utils",
                "url": "https://www.chedong.com/phpMan.php/man/sgsatidentify/sg3utils/json"
            },
            {
                "name": "sginq",
                "section": "sg3utils",
                "url": "https://www.chedong.com/phpMan.php/man/sginq/sg3utils/json"
            },
            {
                "name": "sdparm",
                "section": "sdparm",
                "url": "https://www.chedong.com/phpMan.php/man/sdparm/sdparm/json"
            },
            {
                "name": "hdparm",
                "section": "hdparm",
                "url": "https://www.chedong.com/phpMan.php/man/hdparm/hdparm/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-c --count",
                        "lines": 4,
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "-C --ck",
                        "lines": 6,
                        "flag": "-C",
                        "long": "--ck"
                    },
                    {
                        "name": "-e --extended",
                        "lines": 4,
                        "flag": "-e",
                        "long": "--extended"
                    },
                    {
                        "name": "-f --feature",
                        "lines": 5,
                        "flag": "-f",
                        "long": "--feature"
                    },
                    {
                        "name": "-h --help",
                        "lines": 3,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-L --lba",
                        "lines": 6,
                        "flag": "-L",
                        "long": "--lba"
                    },
                    {
                        "name": "-l --len",
                        "lines": 4,
                        "flag": "-l",
                        "long": "--len"
                    },
                    {
                        "name": "-r --readonly",
                        "lines": 6,
                        "flag": "-r",
                        "long": "--readonly"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "sgsatsetfeatures - use ATA SET FEATURES command via a SCSI to ATA Translation (SAT) layer\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "sgsatsetfeatures    [--count=CO]   [--ckcond]   [--extended]   [--feature=FEA]   [--help]\n[--lba=LBA] [--len={16|12}] [--readonly] [--verbose] [--version] DEVICE\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This utility sends an ATA SET FEATURES command to the DEVICE.  This command is used to change\nsettings  of ATA non-packet (i.e. disks) and packet devices (e.g. cd/dvd drives). Rather than\nsend the SET FEATURES command directly to the device it is sent via a SCSI transport which is\nassumed  to contain a SCSI to ATA Translation (SAT) Layer (SATL). The SATL may be in an oper‐\nating system driver, in host bus adapter firmware or in some external enclosure.\n\nThe SAT standard (SAT ANSI INCITS 431-2007, prior draft: sat-r09.pdf at www.t10.org)  defines\ntwo  SCSI \"ATA PASS-THROUGH\" commands: one using a 16 byte \"cdb\" and the other with a 12 byte\ncdb. This utility defaults to using the 16 byte cdb variant. SAT-2 is also a standard:  SAT-2\nANSI  INCITS  465-2010  and  the  draft  prior to that is sat2r09.pdf . The SAT-3 project has\nstarted and the most recent draft is sat3r05b.pdf .\n\nThe features can be read using the sgsatidentify utility which uses either the ATA IDENTIFY\nDEVICE (for non-packet devices) or the IDENTIFY PACKET DEVICE (for packet devices) command.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Arguments to long options are mandatory for short options as well.\n",
                "subsections": [
                    {
                        "name": "-c --count",
                        "content": "the  number  CO  is  placed in the \"count\" field in the ATA SET FEATURES command. Only\nsome subcommands (a term used for the value placed in the \"feature\" field) require the\ncount field to be set.  The default value placed in the \"count\" field is 0.\n",
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "-C --ck",
                        "content": "sets  the  CKCOND  bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear\n(i.e. 0). When set the SATL should yield a sense buffer containing a  ATA  Result  de‐\nscriptor  irrespective  of whether the ATA command succeeded or failed. When clear the\nSATL should only yield a sense buffer containing a ATA Result descriptor  if  the  ATA\ncommand failed.\n",
                        "flag": "-C",
                        "long": "--ck"
                    },
                    {
                        "name": "-e --extended",
                        "content": "allow  for extended LBA numbers (i.e. larger than 32 bits).  This value is enabled au‐\ntomatically for large LBA numbers, but can be enabled explicitly even for low LBA num‐\nbers with this option.\n",
                        "flag": "-e",
                        "long": "--extended"
                    },
                    {
                        "name": "-f --feature",
                        "content": "the  value  FEA  is placed in the \"feature\" field in the ATA SET FEATURES command. The\nterm \"subcommand\" is sometimes used for this value. The default value  placed  in  the\n\"feature\"  field is 0 which is reserved and hence should not change anything. Two com‐\nmon examples are 2h to enable the write cache and 82h to disable it.\n",
                        "flag": "-f",
                        "long": "--feature"
                    },
                    {
                        "name": "-h --help",
                        "content": "outputs the usage message summarizing command line options then exits. Ignores  DEVICE\nif given.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-L --lba",
                        "content": "the number LBA is placed in the \"lba\" field of the ATA SET FEATURES command. Only some\nsub-commands (a term used for the value placed in the \"feature\" field) require the lba\nfield  to be set. This value is typically not a \"logical block address\" as the acronym\nmight imply.  The default value placed in the \"lba\" field is 0. The maximum value  al‐\nlowed for LBA is 0xfffffffe (or 0xffffff if --len=12).\n",
                        "flag": "-L",
                        "long": "--lba"
                    },
                    {
                        "name": "-l --len",
                        "content": "this  is the length of the SCSI cdb used for the ATA PASS-THROUGH commands.  The argu‐\nment can either be 16 or 12. The default is 16. Some  SCSI  transports  cannot  convey\nSCSI commands longer than 12 bytes.\n",
                        "flag": "-l",
                        "long": "--len"
                    },
                    {
                        "name": "-r --readonly",
                        "content": "causes the DEVICE to be opened with the read-only flag (ORDONLY in Unix). The default\naction is to open DEVICE with the read-write flag (ORDWR  in  Unix).  In  some  cases\nsending  power  management  commands  to  ATA  disks are defeated by OS actions on the\nclose() if the DEVICE was opened with the read-write flag (e.g. the OS might think  it\nneeds to flush something to disk).\n",
                        "flag": "-r",
                        "long": "--readonly"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "increases the level or verbosity.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "content": "print out version string\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "NOTES": {
                "content": "In  the 2.4 series of Linux kernels the DEVICE must be a SCSI generic (sg) device. In the 2.6\nand 3 series block devices (e.g. disks and ATAPI DVDs) can also  be  specified.  For  example\n\"sginq /dev/sda\" will work in the 2.6 series kernels. From lk 2.6.6 other SCSI \"char\" device\nnames may be used as well (e.g. \"/dev/st0m\"). Prior to lk 2.6.29  USB  mass  storage  limited\nsense data to 18 bytes which made the --ckcond option yield strange (truncated) results.\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "The  exit  status  of  sgsatsetfeatures  is  0  when  it  is successful. Otherwise see the\nsg3utils(8) man page.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Written by Douglas Gilbert\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "Report bugs to <dgilbert at interlog dot com>.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2007-2014 Douglas Gilbert\nThis software is distributed under a FreeBSD license. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "sgsatidentify(sg3utils), sginq(sg3utils), sdparm(sdparm), hdparm(hdparm)\n\n\n\nsg3utils-1.40                              November 2014                     SGSATSETFEATURES(8)",
                "subsections": []
            }
        }
    }
}