Usage: sg_write_x [--16] [--32] [--app-tag=AT] [--atomic=AB] [--bmop=OP,PGP] [--bs=BS] [--combined=DOF] [--dld=DLD] [--dpo] [--dry-run] [--fua] [--generation=EOG,NOG] [--grpnum=GN] [--help] --in=IF [--lba=LBA,LBA...] [--normal] [--num=NUM,NUM...] [--offset=OFF[,DLEN]] [--or] [--quiet] [--ref-tag=RT] [--same=NDOB] [--scat-file=SF] [--scat-raw] [--scattered=RD] [--stream=ID] [--strict] [--tag-mask=TM] [--timeout=TO] [--unmap=U_A] [--verbose] [--version] [--wrprotect=WRP] DEVICE where: --16|-6 send 16 byte cdb variant (this is default action) --32|-3 send 32 byte cdb variant of command (def: 16 byte) --app-tag=AT|-a AT expected application tag field (def: 0xffff) --atomic=AB|-A AB send WRITE ATOMIC command with AB being its Atomic Boundary field (0 to 0xffff) --bmop=OP,PGP|-p OP,PGP set BMOP field to OP and Previous Generation Processing field to PGP --bs=BS|-b BS block size (def: use READ CAPACITY), if power of 2: logical block size, otherwise: actual block size --combined=DOF|-c DOF scatter list and data combined for WRITE SCATTERED, data starting at offset DOF which has units of sizeof(LB+PI); sizeof(PI)=8n or 0 --dld=DLD|-D DLD set duration limit descriptor (dld) bits (def: 0) --dpo|-d set DPO (disable page out) field (def: clear) --dry-run|-x exit just before sending SCSI write command --fua|-f set FUA (force unit access) field (def: clear) --generation=EOG,NOG set Expected ORWgeneration field to EOG |-G EOG,NOG and New ORWgeneration field to NOG --grpnum=GN|-g GN GN is group number field (def: 0, range: 0 to 63) --help|-h use multiple times for different usage messages --in=IF|-i IF IF is file to fetch NUM blocks of data from. Blocks written to DEVICE. 1 or no blocks read in the case of WRITE SAME --lba=LBA,LBA... list of LBAs (Logical Block Addresses) to start |-l LBA,LBA... writes (def: --lba=0). Alternative is --scat-file=SF --normal|-N send 'normal' WRITE command (default when no other command option given) --num=NUM,NUM... NUM is number of logical blocks to write (def: |-n NUM,NUM... --num=0). Number of block sent is sum of NUMs --offset=OFF[,DLEN] OFF is byte offset in IF to start reading from |-o OFF[,DLEN] (def: 0), then read DLEN bytes(def: rest of IF) --or|-O send ORWRITE command --quiet|-Q suppress some informational messages --ref-tag=RT|-r RT expected reference tag field (def: 0xffffffff) --same=NDOB|-M NDOB send WRITE SAME command. NDOB (no data out buffer) can be either 0 (do send buffer) or 1 (don't) --scat-file=SF|-q SF file containing LBA, NUM pairs, see manpage --scat-raw|-R read --scat_file=SF as binary (def: ASCII hex) --scattered=RD|-S RD send WRITE SCATTERED command with RD range descriptors (RD can be 0 when --combined= given) --stream=ID|-T ID send WRITE STREAM command with its STR_ID field set to ID --strict|-s exit if read less than requested from IF ; require variety of WRITE to be given as option --tag-mask=TM|-t TM tag mask field (def: 0xffff) --timeout=TO|-I TO command timeout (unit: seconds) (def: 120) --unmap=U_A|-u U_A 0 clears both UNMAP and ANCHOR bits (default), 1 sets UNMAP, 2 sets ANCHOR, 3 sets both --verbose|-v increase verbosity --version|-V print version string then exit --wrprotect=WPR|-w WPR WPR is the WRPROTECT field value (def: 0) Performs a SCSI WRITE (normal), ORWRITE, WRITE ATOMIC, WRITE SAME, WRITE SCATTERED, or WRITE STREAM command. A 16 or 32 byte cdb variant can be selected. The --in=IF option (data to be written) is required apart from when --same=1 (i.e. when NDOB is set). If no WRITE variant option is given then, in the absence of --strict, a (normal) WRITE is performed. Only WRITE SCATTERED uses multiple LBAs and NUMs, or a SF file with multiple pairs. The --num=NUM field defaults to 0 (do nothing) for safety. Using '-h' multiple times shows the applicable options for each command variant.