Lines Matching +full:combined +full:- +full:stream
1 .TH SG_WRITE_X "8" "October 2021" "sg3_utils\-1.47" SG3_UTILS
3 sg_write_x \- SCSI WRITE normal/ATOMIC/SAME/SCATTERED/STREAM, ORWRITE commands
6 [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-app\-tag=AT\fR] [\fI\-\-atomic=AB\fR]
7 [\fI\-\-bmop=OP,PGP\fR] [\fI\-\-bs=BS\fR] [\fI\-\-combined=DOF\fR]
8 [\fI\-\-dld=DLD\fR] [\fI\-\-dpo\fR] [\fI\-\-dry\-run\fR] [\fI\-\-fua\fR]
9 [\fI\-\-generation=EOG,NOG\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-help\fR]
10 \fI\-\-in=IF\fR [\fI\-\-lba=LBA[,LBA...]\fR] [\fI\-\-normal\fR]
11 [\fI\-\-num=NUM[,NUM...]\fR] [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-or\fR]
12 [\fI\-\-quiet\fR] [\fI\-\-ref\-tag=RT\fR] [\fI\-\-same=NDOB\fR]
13 [\fI\-\-scat\-file=SF\fR] [\fI\-\-scat\-raw\fR] [\fI\-\-scattered=RD\fR]
14 [\fI\-\-stream=ID\fR] [\fI\-\-strict\fR] [\fI\-\-tag\-mask=TM\fR]
15 [\fI\-\-timeout=TO\fR] [\fI\-\-unmap=U_A\fR] [\fI\-\-verbose\fR]
16 [\fI\-\-version\fR] [\fI\-\-wrprotect=WPR\fR] \fIDEVICE\fR
21 \fI\-\-normal\fR \fI\-\-in=IF\fR [\fI\-\-16\fR] [\fI\-\-32\fR]
22 [\fI\-\-app\-tag=AT\fR] [\fI\-\-bs=BS\fR] [\fI\-\-dld=DLD\fR] [\fI\-\-dpo\fR]
23 [\fI\-\-fua\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-num=NUM\fR]
24 [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-ref\-tag=RT\fR] [\fI\-\-strict\fR]
25 [\fI\-\-tag\-mask=TM\fR] [\fI\-\-timeout=TO\fR] [\fI\-\-wrprotect=WPR\fR]
29 \fI\-\-or\fR \fI\-\-in=IF\fR [\fI\-\-16\fR] [\fI\-\-32\fR]
30 [\fI\-\-bmop=OP,PGP\fR] [\fI\-\-bs=BS\fR] [\fI\-\-dpo\fR] [\fI\-\-fua\fR]
31 [\fI\-\-generation=EOG,NOG\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-lba=LBA\fR]
32 [\fI\-\-num=NUM\fR] [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-strict\fR]
33 [\fI\-\-timeout=TO\fR] [\fI\-\-wrprotect=OPR\fR] \fIDEVICE\fR
36 \fI\-\-atomic=AB\fR \fI\-\-in=IF\fR [\fI\-\-16\fR] [\fI\-\-32\fR]
37 [\fI\-\-app-tag=AT\fR] [\fI\-\-bs=BS\fR] [\fI\-\-dpo\fR] [\fI\-\-fua\fR]
38 [\fI\-\-grpnum=GN\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-num=NUM\fR]
39 [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-ref\-tag=RT\fR] [\fI\-\-strict\fR]
40 [\fI\-\-timeout=TO\fR] [\fI\-\-wrprotect=WPR\fR] \fIDEVICE\fR
43 \fI\-\-same=NDOB\fR [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-app-tag=AT\fR]
44 [\fI\-\-bs=BS\fR] [\fI\-\-dpo\fR] [\fI\-\-fua\fR] [\fI\-\-grpnum=GN\fR]
45 [\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-num=NUM\fR]
46 [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-ref\-tag=RT\fR] [\fI\-\-strict\fR]
47 [\fI\-\-timeout=TO\fR] [\fI\-\-unmap=U_A\fR]
48 [\fI\-\-wrprotect=WPR\fR] \fIDEVICE\fR
51 \fI\-\-scattered=RD\fR \fI\-\-in=IF\fR [\fI\-\-16\fR] [\fI\-\-32\fR]
52 [\fI\-\-app-tag=AT\fR] [\fI\-\-bs=BS\fR] [\fI\-\-dld=DLD\fR] [\fI\-\-dpo\fR]
53 [\fI\-\-fua\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-lba=LBA[,LBA...]\fR]
54 [\fI\-\-num=NUM[,NUM...]\fR] [\fI\-\-offset=OFF[,DLEN]\fR]
55 [\fI\-\-ref\-tag=RT\fR] [\fI\-\-scat\-file=SF\fR] [\fI\-\-scat\-raw\fR]
56 [\fI\-\-strict\fR] [\fI\-\-tag\-mask=TM\fR] [\fI\-\-timeout=TO\fR]
57 [\fI\-\-wrprotect=WPR\fR] \fIDEVICE\fR
60 \fI\-\-stream=ID\fR \fI\-\-in=IF\fR [\fI\-\-16\fR] [\fI\-\-32\fR]
61 [\fI\-\-app-tag=AT\fR] [\fI\-\-bs=BS\fR] [\fI\-\-dpo\fR] [\fI\-\-fua\fR]
62 [\fI\-\-grpnum=GN\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-num=NUM\fR]
63 [\fI\-\-offset=OFF[,DLEN]\fR] [\fI\-\-ref\-tag=RT\fR] [\fI\-\-strict\fR]
64 [\fI\-\-tag\-mask=TM\fR] [\fI\-\-timeout=TO\fR] [\fI\-\-wrprotect=WPR\fR]
70 ATOMIC, WRITE SAME, WRITE SCATTERED or WRITE STREAM. This utility supports
82 \fI\-\-scat\-file=SF\fR option can be given for every command, it is only
84 \fI\-\-scat\-file=SF\fR option is given then neither the
85 \fI\-\-lba=LBA[,LBA...]\fR nor the \fI\-\-num=NUM[,NUM...]\fR options
86 should be given. Only the first item of the \fI\-\-lba=LBA[,LBA...]\fR and
87 the \fI\-\-num=NUM[,NUM...]\fR options (or first pair (or quintet) from the
88 \fI\-\-scat\-file=SF\fR option) is used for all but the WRITE SCATTERED
89 command. All commands can take \fI\-\-dry\-run\fR and \fI\-\-verbose\fR in
93 \fI\-\-bs=BS\fR option, as long as \fIBS\fR is greater than zero. It
94 is typically a power of two, 512 or greater. If the \fI\-\-bs=BS\fR option
99 PROT_EN is set in the response and the \fI\-\-wrprotect=WPR\fR option is
100 given and non\-zero; in which case 8 (bytes) is added to the logical block
108 are read from the file \fIIF\fR and the \fI\-\-strict\fR option is given then
110 are read from the file \fIIF\fR and the \fI\-\-strict\fR option is not
116 allocating a buffer that large. Next the SCSI pass\-through usually limits
128 list in the data\-out buffer. SBC\-4 makes clear that a degenerate LBA
130 \fI\-\-scattered=RD\fR option has the value 0. In this case the logic may
136 The reference for these commands is SBC\-4 (T10/BSR INCITS 506\-2021)
137 and draft SBC\-5 INCITS 571 revision 1 dated 21 May 2021. All six SCSI
139 SBC\-4 revision 3; WRITE STREAM was added in SBC\-4 revision 7; WRITE
140 SCATTERED was added in SBC\-4 revision 11 while the others are in the
141 previous SBC\-3 standard.
147 \fB\-6\fR, \fB\-\-16\fR
150 this option nor the \fI\-\-32\fR option is given then this option is
153 \fB\-3\fR, \fB\-\-32\fR
156 this option nor the \fI\-\-16\fR option is given then then the
157 \fI\-\-16\fR option is assumed. If both this option and the \fI\-\-16\fR
162 \fB\-a\fR, \fB\-\-app\-tag\fR=\fIAT\fR
168 \fB\-A\fR, \fB\-\-atomic\fR=\fIAB\fR
172 write the whole data\-out buffer in a single atomic operation.
174 \fB\-B\fR, \fB\-\-bmop\fR=\fIOP,PGP\fR
180 \fB\-b\fR, \fB\-\-bs\fR=\fIBS\fR
190 continues unless the \fI\-\-strict\fR option is also given. If \fIBS\fR
199 \fI\-\-wrprotect=WPR\fR is greater than zero.
201 \fB\-c\fR, \fB\-\-combined\fR=\fIDOF\fR
202 This option only applies to WRITE SCATTERED and assumes the whole data\-out
203 buffer can be read from \fIIF\fR given by the \fI\-\-in=IF\fR option. The
204 whole data\-out buffer is the parameter list header, followed by zero or more
206 data to be written to the media. If the \fI\-\-lba=LBA[,LBA...]\fR,
207 \fI\-\-num=NUM[,NUM...]\fR or \fI\-\-scat\-file=SF\fR options are also given
210 cdb. This is the offset in the data\-out buffer where the data to write
213 information (PI) is being sent. When \fIWPR\fR (from \fI\-\-wrprotect=WPR\fR)
214 is greater than zero then PI is expected. SBC\-4 revision 15 does not state
216 suggested that this option be used with the \fI\-\-strict\fR option while
217 experimenting as random or incorrect data fed in via the \fI\-\-in=IF\fR
223 \fB\-D\fR, \fB\-\-dld\fR=\fIDLD\fR
227 SCATTERED(16) is set if (0x1 & \fIDLD\fR) is non\-zero. The DLD1 field in
228 both cdbs is set if (0x2 & \fIDLD\fR) is non\-zero. The DLD2 field in both
229 cdbs is set if (0x4 & \fIDLD\fR) is non\-zero.
231 \fB\-d\fR, \fB\-\-dpo\fR
236 \fB\-x\fR, \fB\-\-dry\-run\fR
241 \fI\-\-in=IF\fR and/or the \fI\-\-scat\-file=SF\fR options are given. All
242 command line processing and sanity checks (e.g. if the \fI\-\-strict\fR
246 If this option is given twice (e.g. \-xx) then instead of performing the
247 selected write SCSI command, the data\-out buffer is written to a file
250 longer contents. The data\-out buffer is written in binary with some
256 \fB\-f\fR, \fB\-\-fua\fR
261 \fB\-G\fR, \fB\-\-generation\fR=\fIEOG,NOG\fR
267 \fB\-g\fR, \fB\-\-grpnum\fR=\fIGN\fR
271 \fB\-h\fR, \fB\-\-help\fR
273 Currently '\-h' to '\-hhhh' provide different output.
275 \fB\-i\fR, \fB\-\-in\fR=\fIIF\fR
278 used as the data\-out buffer for all SCSI write commands apart from WRITE
279 SCATTERED(16 or 32) which may include other data in the data\-out buffer.
280 For WRITE SCATTERED (16 or 32) the data\-out buffer is made up of 3 or 4
284 to write to the media unless \fI\-\-combined=DOF\fR is given. When the
285 \fI\-\-combined=DOF\fR option is given \fIIF\fR contains all components of
286 the WRITE SCATTERED data\-out buffer in binary. The data read from \fIIF\fR
290 is read. This option is mandatory apart from when \-\-same=1 is given (that
294 \fIIF\fR may be "\-" which is taken as stdin. In this case the
295 \fI\-\-offset=OFF,DLEN\fR can be given with \fIOFF\fR set to 0 and
296 \fILEN\fR set to a non\-zero value, preferably a multiple of the actual block
300 \fB\-l\fR, \fB\-\-lba\fR=\fILBA[,LBA...]\fR
306 \fI\-\-num=NUM[,NUM...]\fR option. The first given \fILBA\fR joins with the
308 number from zero in SBC\-4). The second \fILBA\fR joins with the second
311 \fI\-\-scat\-file=SF\fR option. Defaults to logical block 0 (which could be
316 \fB\-N\fR, \fB\-\-normal\fR
319 \fI\-\-atomic=AB\fR ), the choice of a "normal" WRITE is the default.
321 \fB\-n\fR, \fB\-\-num\fR=\fINUM[,NUM...]\fR
324 \fI\-\-lba=LBA[,LBA...]\fR option. If a \fINUM\fR is given and is not
325 provided by another method (e.g. by using the \fI\-\-scat\-file=SF\fR option)
328 or \fIDLEN\fR). Apart from the \fI\-\-combined=DOF\fR option, an LBA must
329 be explicitly given (either with \fII\-\-lba=LBA\fR or via
330 \fI\-\-scat\-file=SF\fR), if not \fINUM\fR defaults to 0 as a safety measure.
332 \fB\-o\fR, \fB\-\-offset\fR=\fIOFF[,DLEN]\fR
341 \fB\-O\fR, \fB\-\-or\fR
345 extra fields that are set with the \fI\-\-bmop=OP,PGP\fR and
346 \fI\-\-generation=EOG,NOG\fR options. ORWRITE(32) is the only 32 byte cdb
350 \fB\-Q\fR, \fB\-\-quiet\fR
355 \fB\-r\fR, \fB\-\-ref\-tag\fR=\fIRT\fR
358 WRITE STREAM. The field is also found in the WRITE SCATTERED(32) LBA range
362 \fB\-S\fR, \fB\-\-same\fR=\fINDOB\fR
364 stands for No Data\-Out Buffer. \fINDOB\fR can take values 0 or 1 (i.e. it
365 is a single bit field). When \-\-same=1 all options associated with the
366 data\-out buffer are ignored.
368 \fB\-q\fR, \fB\-\-scat\-file\fR=\fISF\fR
370 for the WRITE SCATTERED command. If the \fI\-\-scat\-raw\fR option is also
373 also 32 bytes long each. These components are as defined by SBC\-4 (i.e.
374 in binary with integers in big endian format). If the \fI\-\-scat\-raw\fR
378 If this option is given with the \fI\-\-combined=DOF\fR option then this
379 utility will exit with a syntax error. \fISF\fR must not be "\-", a way
382 \fB\-R\fR, \fB\-\-scat\-raw\fR
384 \fI\-\-scat\-file=SF\fR option for WRITE SCATTERED is interpreted. By
391 are 32 bytes each). If the \fI\-\-strict\fR option is given the reserved
395 \fB\-S\fR, \fB\-\-scattered\fR=\fIRD\fR
397 range descriptors that will be placed in the data\-out buffer. If \fIRD\fR
409 command line options, from the \fI\-\-scat\-file=SF\fR option or
410 decoded from \fIIF\fR (when the \fI\-\-combined=DOF\fR option is given)
416 \fB\-T\fR, \fB\-\-stream\fR=\fIID\fR
417 selects the WRITE STREAM command with the STR_ID field set to \fIID\fR.
420 \fB\-s\fR, \fB\-\-strict\fR
426 \fB\-t\fR, \fB\-\-tag\-mask\fR=\fITM\fR
428 32 byte cdb variants of WRITE, WRITE ATOMIC, WRITE SAME and WRITE STREAM. The
433 \fB\-I\fR, \fB\-\-timeout\fR=\fITO\fR
438 \fB\-u\fR, \fB\-\-unmap\fR=\fIU_A\fR
439 where \fIU_A\fR is OR\-ed bit values used to set the UNMAP and ANCHOR bit
446 \fB\-v\fR, \fB\-\-verbose\fR
450 \fB\-V\fR, \fB\-\-version\fR
453 \fB\-w\fR, \fB\-\-wrprotect\fR=\fIWPR\fR
458 in the data\-out buffer. \fIWPR\fR should be a value between 0 and 7.
460 All commands in this utility can take a \fI\-\-scat\-file=SF\fR and that
461 option can be seen as a replacement for the \fI\-\-lba=LBA[,LBA...]\fR and
462 \fI\-\-num=NUM[,NUM...]\fR options. if both the \fI\-\-scat\-file=SF\fR and
463 \fI\-\-scat\-raw\fR options are given then the file named \fISF\fR is
467 expected in \fISF\fR when the \fI\-\-scat\-raw\fR option is not given.
475 to the end\-of\-line is ignored, so comments can be placed there.
481 then a number_of_blocks until the end\-of\-file is reached. The pattern
505 the sg driver would fail with this utility if the \fI\-\-32\fR option was
518 sg_write_x \-\-atomic=0 \-\-in=/dev/zero \-\-lba=0x1234 \-\-num=4 /dev/sdc
520 Since \fI\-\-bs=BS\fR has not been given, then this utility will call the
527 \fI\-\-bs=BS\fR option can be used:
529 sg_write_x \-\-atomic=0 \-\-bs=512 \-\-in=/dev/zero \-\-lba=0x1234 \-\-num=4
532 Since \-\-bs= is given and its value (512) is a power of 2, then the actual
535 would be 520 bytes. To send the 32 byte variant add \-\-32 as in:
537 sg_write_x \-\-atomic=0 \-\-32 \-\-bs=512 \-\-in=/dev/zero \-\-lba=0x1234
538 \-\-num=4 /dev/sdc
540 For examples using 'sg_write_x \-\-same=NDOB' see the manpage for
544 To send a WRITE STREAM(32) with a STR_ID of 1 use the following:
546 sg_write_x \-\-stream=1 \-\-32 \-\-bs=512 \-\-in=/dev/zero \-\-lba=0x1234
547 \-\-num=4 /dev/sdc
550 the \-\-lba= and \-\-num= options, on the command line:
552 sg_write_x \-\-scattered=2 \-\-lba=2,0x33 \-\-num=4,1 -i /dev/zero /dev/sg1
555 descriptor (first element to \-\-lba= and \-\-num=):
557 sg_write_x \-\-scattered=2 \-\-lba=0,0x33 \-\-num=0,1 -i /dev/zero /dev/sg1
562 sg_write_x \-\-scattered=3 \-q scat_file.txt \-i /dev/zero /dev/sg1
565 single file. Note that the argument to \-\-scattered= is 0 so the number of
567 scat_data.bin (because the argument to \-\-combined= is 2) :
569 sg_write_x \-\-scattered=0 \-\-combined=2 \-i scat_data.bin /dev/sg1
571 When the \-xx option is used, a WRITE SCATTERED command is not executed
572 but instead the contents of the data\-out buffer are written to a file
577 sg_write_x \-\-scattered=3 \-q scat_file.txt \-xx \-i /dev/zero /dev/sg1
583 sg_write_x \-\-scattered=0 \-\-combined=1 \-i sg_write_x.bin /dev/sg1
587 for "LB data offset:" (1) should be given to the \-\-combined= option
595 Copyright \(co 2017\-2021 Douglas Gilbert
597 This software is distributed under a BSD\-2\-Clause license. There is NO