• Home
  • Raw
  • Download

Lines Matching +full:device +full:- +full:select

1 .TH SG_WR_MODE "8" "April 2018" "sg3_utils\-1.43" SG3_UTILS
3 sg_wr_mode \- write (modify) SCSI mode page
6 [\fI\-\-contents=H,H...\fR] [\fI\-\-dbd\fR] [\fI\-\-force\fR] [\fI\-\-help\fR]
7 [\fI\-\-len=10|6\fR] [\fI\-\-mask=M,M...\fR] [\fI\-\-page=PG_H[,SPG_H]\fR]
8 [\fI\-\-rtd\fR] [\fI\-\-save\fR] [\fI\-\-six\fR] [\fI\-\-verbose\fR]
9 [\fI\-\-version\fR] \fIDEVICE\fR
13 Writes a modified mode page to \fIDEVICE\fR. Uses the SCSI MODE SENSE (6
17 SELECT (6 or 10 byte variant) command. This utility does not modify
20 following MODE SELECT command.
22 If the \fI\-\-rtd\fR option is given then most other options apart from
23 \fI\-\-save\fR, \fI\-\-len=\fR10|6\fR and \fI\-\-six\fR are ignored. In this
24 case only a MODE SELECT command is sent to the \fIDEVICE\fR with the RTD
25 bit (Revert To Defaults) set. This bit was added to this command in SPC\-5
27 page has the RTD_SUP bit to indicate whether the \fIDEVICE\fR supports the
28 RTD bit in the MODE SELECT(6 and 10) commands. When the \fI\-\-rtd\fR option
34 not altered on the device.
38 \fI\-\-force\fR option is given. These include length, mode page code and
40 written to \fIDEVICE\fR as the new mode page.
55 the \fI\-\-dbd\fR option if need be.
63 \fB\-c\fR, \fB\-\-contents\fR=\fIH,H...\fR
68 \fIDEVICE\fR, potentially filtered by the mask string.
70 \fB\-c\fR, \fB\-\-contents\fR=-
75 forms the new contents of the mode page to be written to \fIDEVICE\fR,
78 \fB\-d\fR, \fB\-\-dbd\fR
79 disable block descriptors (DBD flag in cdb). Some device types include
81 so the same block descriptors are written by the MODE SELECT command.
86 \fB\-f\fR, \fB\-\-force\fR
88 doesn't do checks on the existing mode page. Note that \fIDEVICE\fR may
90 the \fI\-\-mask=M,M...\fR option.
92 \fB\-h\fR, \fB\-\-help\fR
95 \fB\-l\fR, \fB\-\-len\fR=10 | 6
96 length of the SCSI commands (cdb) sent to \fIDEVICE\fR. The default is 10
97 so 10 byte MODE SENSE and MODE SELECT commands are issued. Some old devices
100 \fB\-m\fR, \fB\-\-mask\fR=\fIM,M...\fR
111 \fB\-p\fR, \fB\-\-page\fR=\fIPG_H\fR
116 \fB\-p\fR, \fB\-\-page\fR=\fIPG_H,SPG_H\fR
123 \fB\-R\fR, \fB\-\-rtd\fR
125 SELECT(6 or 10) command is sent to the \fIDEVICE\fR with the RTD bit set.
126 This will cause all current values (and saved values if the \fI\-\-save\fR
130 \fB\-s\fR, \fB\-\-save\fR
131 changes the "saved" mode page when MODE SELECT is successful. By
132 default (i.e. when \fI\-\-save\fR is not used) only the "current" mode page
133 values are changed when MODE SELECT is successful. In this case the new mode
134 page will stay in effect until the device is reset (e.g. power cycled).
135 When it restarts the "saved" values for the mode page will be re\-instated.
136 So to make changes permanent use the \fI\-\-save\fR option.
138 When used with the \fI\-\-rtd\fR option then both the current and saved
140 absence of \fI\-\-save\fR option only the current values in each mode page
143 \fB\-6\fR, \fB\-\-six\fR
144 this option will cause the 6 byte variants of MODE SENSE and MODE SELECT
146 is equivalent to using the \fI\-\-len=6\fR option.
149 \fB\-v\fR, \fB\-\-verbose\fR
152 \fB\-V\fR, \fB\-\-version\fR
156 modify parts of the mode page which are changeable. The device should
160 Some mode pages are not saveable. If so an attempt to use the \fI\-\-save\fR
161 option should cause an error to be reported from the device: "Illegal field
164 The device is required to do various checks before it accepts a new
167 parameter list" error is returned by the device in the sense data.
171 device with a MODE SELECT command. For example, reading an existing mode
172 page can be accomplished with 'sg_modes \-p=1a \-r /dev/sdb > mp_1a.txt' (the
175 utility (e.g. 'sg_wr_mode \-p 1a \-s \-c \- /dev/sdb < mp_1a.txt').
177 Two fields differ between what is read from the device with MODE SENSE and
178 what is written to the device with MODE SELECT:
180 SELECT command while the PS bit ((sub)page byte 0 bit 7) in each
181 mode (sub)page is reserved (zero) in a MODE SELECT command.
183 the \fI\-\-force\fR option is selected.
185 This utility can be used together with the sg_modes utility. To re\-instate
187 manufacturer of the device) as both the current and saved mode page
190 $ sg_modes \-\-control=2 \-\-page=1a \-r /dev/sda > t
192 $ sg_wr_mode \-\-page=1a \-\-contents=\- \-\-save /dev/sda < t
199 $ sg_modes \-\-page=1a /dev/hdc
205 $ sg_wr_mode \-p 1a \-c 0,0,0,0,0,0,0,37 \-m 0,0,0,0,0,0,0,ff /dev/hdc
207 $ sg_modes \-p 1a /dev/hdc
220 Copyright \(co 2004\-2018 Douglas Gilbert
222 This software is distributed under a BSD\-2\-Clause license. There is NO