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

NAME

6       sg_sat_set_features  -  use  ATA SET FEATURES command via a SCSI to ATA
7       Translation (SAT) layer
8

SYNOPSIS

10       sg_sat_set_features  [--count=CO]  [--ck_cond]   [--extended]   [--fea‐
11       ture=FEA] [--help] [--lba=LBA] [--len={16|12}] [--readonly] [--verbose]
12       [--version] DEVICE
13

DESCRIPTION

15       This utility sends an ATA SET FEATURES command  to  the  DEVICE.   This
16       command  is  used to change settings of ATA non-packet (i.e. disks) and
17       packet devices (e.g. cd/dvd drives). Rather than send the SET  FEATURES
18       command directly to the device it is sent via a SCSI transport which is
19       assumed to contain a SCSI to ATA Translation (SAT)  Layer  (SATL).  The
20       SATL may be in an operating system driver, in host bus adapter firmware
21       or in some external enclosure.
22
23       The SAT standard (SAT ANSI INCITS 431-2007, prior draft: sat-r09.pdf at
24       www.t10.org)  defines two SCSI "ATA PASS-THROUGH" commands: one using a
25       16 byte "cdb" and the other with a 12 byte cdb. This  utility  defaults
26       to  using the 16 byte cdb variant. SAT-2 is also a standard: SAT-2 ANSI
27       INCITS 465-2010 and the draft prior to that is sat2r09.pdf . The  SAT-3
28       project has started and the most recent draft is sat3r05b.pdf .
29
30       The  features  can be read using the sg_sat_identify utility which uses
31       either the ATA IDENTIFY DEVICE (for non-packet devices) or the IDENTIFY
32       PACKET DEVICE (for packet devices) command.
33

OPTIONS

35       Arguments to long options are mandatory for short options as well.
36
37       -c, --count=CO
38              the number CO is placed in the "count" field in the ATA SET FEA‐
39              TURES command. Only some subcommands (a term used for the  value
40              placed  in  the  "feature"  field) require the count field to be
41              set.  The default value placed in the "count" field is 0.
42
43       -C, --ck_cond
44              sets the CK_COND bit in  the  ATA  PASS-THROUGH  SCSI  cdb.  The
45              default  setting  is  clear  (i.e.  0). When set the SATL should
46              yield a sense buffer containing a ATA  Result  descriptor  irre‐
47              spective  of  whether  the ATA command succeeded or failed. When
48              clear the SATL should only yield a sense buffer containing a ATA
49              Result descriptor if the ATA command failed.
50
51       -e, --extended
52              allow for extended LBA numbers (i.e. larger than 32 bits).  This
53              value is enabled automatically for large LBA numbers, but can be
54              enabled explicitly even for low LBA numbers with this option.
55
56       -f, --feature=FEA
57              the  value  FEA  is placed in the "feature" field in the ATA SET
58              FEATURES command. The term "subcommand" is  sometimes  used  for
59              this value. The default value placed in the "feature" field is 0
60              which is reserved and hence should not change anything. Two com‐
61              mon examples are 2h to enable the write cache and 82h to disable
62              it.
63
64       -h, --help
65              outputs the usage message summarizing command line options  then
66              exits. Ignores DEVICE if given.
67
68       -L, --lba=LBA
69              the  number LBA is placed in the "lba" field of the ATA SET FEA‐
70              TURES command. Only some sub-commands (a term used for the value
71              placed  in the "feature" field) require the lba field to be set.
72              This value is typically not a "logical  block  address"  as  the
73              acronym  might  imply.   The  default  value placed in the "lba"
74              field is 0. The maximum value allowed for LBA is 0xfffffffe  (or
75              0xffffff if --len=12).
76
77       -l, --len={16|12}
78              this is the length of the SCSI cdb used for the ATA PASS-THROUGH
79              commands.  The argument can either be 16 or 12. The  default  is
80              16. Some SCSI transports cannot convey SCSI commands longer than
81              12 bytes.
82
83       -r, --readonly
84              causes the DEVICE to be opened with the read-only flag (O_RDONLY
85              in  Unix).  The  default  action  is  to  open  DEVICE  with the
86              read-write flag (O_RDWR in Unix). In some  cases  sending  power
87              management  commands  to ATA disks are defeated by OS actions on
88              the close() if the DEVICE was opened with  the  read-write  flag
89              (e.g. the OS might think it needs to flush something to disk).
90
91       -v, --verbose
92              increases the level or verbosity.
93
94       -V, --version
95              print out version string
96

NOTES

98       In  the  2.4  series of Linux kernels the DEVICE must be a SCSI generic
99       (sg) device. In the 2.6 and 3 series  block  devices  (e.g.  disks  and
100       ATAPI  DVDs)  can also be specified. For example "sg_inq /dev/sda" will
101       work in the 2.6 series kernels. From lk 2.6.6 other SCSI "char"  device
102       names  may  be  used as well (e.g. "/dev/st0m"). Prior to lk 2.6.29 USB
103       mass storage limited sense data to 18 bytes which  made  the  --ck_cond
104       option yield strange (truncated) results.
105

EXIT STATUS

107       The exit status of sg_sat_set_features is 0 when it is successful. Oth‐
108       erwise see the sg3_utils(8) man page.
109

AUTHOR

111       Written by Douglas Gilbert
112

REPORTING BUGS

114       Report bugs to <dgilbert at interlog dot com>.
115
117       Copyright © 2007-2014 Douglas Gilbert
118       This software is distributed under a FreeBSD license. There is NO  war‐
119       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
120       POSE.
121

SEE ALSO

123       sg_sat_identify(sg3_utils),     sg_inq(sg3_utils),      sdparm(sdparm),
124       hdparm(hdparm)
125
126
127
128sg3_utils-1.40                   November 2014          SG_SAT_SET_FEATURES(8)
Impressum