OS Manuals

/usr/bin/sg_write_long

SCSI utilities for Linux, Unix and Windows

From sg3-utils 1.49-r3 (enterprise-packages), captured 2026-11-08 by running sg_write_long --help (exit 0). permalink

Usage: sg_write_long [--16] [--cor_dis] [--help] [--in=IF] [--lba=LBA]
                     [--pblock] [--verbose] [--version] [--wr_uncor]
                     [--xfer_len=BTL] DEVICE
  where:
    --16|-S              do WRITE LONG(16) (default: 10)
    --cor_dis|-c         set correction disabled bit
    --help|-h            print out usage message
    --in=IF|-i IF        input from file called IF (default: use
                         0xff bytes as fill)
    --lba=LBA|-l LBA     logical block address (default: 0)
    --pblock|-p          physical block (default: logical block)
    --verbose|-v         increase verbosity
    --version|-V         print version string then exit
    --wr_uncor|-w        set an uncorrectable error (no data transferred)
    --xfer_len=BTL|-x BTL    byte transfer length (< 10000) (default:
                             520 bytes)

Performs a SCSI WRITE LONG (10 or 16) command. Writes a single block
including associated ECC data. That data may be obtained from the
SCSI READ LONG command. See the sg_read_long utility.
Options (10)
OptionDescriptionSource
--in, -i IF|-iread data (binary) from file named IF and use it for the SCSI WRITE LONG command.help + man
--lba, -l LBA|-lwhere LBA is the logical block address of the sector to overwrite.help + man
--xfer_len, -x BTL|-xwhere BTL is the byte transfer length (default to 520).help + man
-S, --16send a SCSI WRITE LONG (16) command to DEVICE. (in the manual page but not in --help)man
-c, --cor_dissets the correction disabled (i.e 'COR_DIS') bit. (in the manual page but not in --help)man
-h, --helpoutput the usage message then exit. (in the manual page but not in --help)man
-p, --pblocksets the physical block (i.e 'PBLOCK') bit. (in the manual page but not in --help)man
-v, --verboseincrease the degree of verbosity (debug messages). (in the manual page but not in --help)man
-V, --versionoutput version string then exit. (in the manual page but not in --help)man
-w, --wr_uncorsets the "write uncorrected" (i.e 'WR_UNCOR') bit. (in the manual page but not in --help)man
Exit status (1) from the manual page
0it is successful

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.