SCSI command


In SCSI computer storage, computers and storage devices use a client-server model of communication. The computer is a client which requests the storage device to perform a service, e.g., to read or write data. The SCSI command architecture was originally defined for parallel SCSI buses but has been carried forward with minimal change for use with Fibre Channel, iSCSI, Serial Attached SCSI, and other transport layers.
In the SCSI protocol, the initiator sends a SCSI command information unit to the target device. Data information units may then be transferred between the computer and device. Finally, the device sends a response information unit to the computer.
SCSI commands are sent in a command descriptor block, which consists of a one byte operation code followed by five or more bytes containing command-specific parameters. Upon receiving and processing the CDB the device will return a status code byte and other information.
The rest of this article contains a list of SCSI commands, sortable in opcode or description alphabetical order. In the published SCSI standards, commands are designated as "mandatory," "optional" or "vendor-unique." Only the mandatory commands are required of all devices. There are links to detailed descriptions for the more common SCSI commands. Some opcodes produce different, though usually comparable, effects in different device types; for example, opcode 0x01 recalibrates a disk drive by seeking back to physical sector zero, but rewinds the medium in a tape drive.

SCSI command lengths

Originally the most significant 3 bits of a SCSI opcode specified the length of the CDB. However, when variable-length CDBs were created this correspondence was changed, and the entire opcode must be examined to determine the CDB length.
The lengths are as follows:
Opcode Length
00h to 1Fh6
20h to 5Fh10
60h to 7Dhreserved
7Ehvariable
7Fhextended
80h to 9Fh16
A0h to BFh12
C0h to FFhvendor specific

List of SCSI commands

When a command is defined in multiple CDB sizes, the length of the CDB is given in parentheses after the command name, e.g., READ and READ.
CodeCommand
00TEST UNIT READY
01REWIND
03REQUEST SENSE
04FORMAT
05READ BLOCK LIMITS
07REASSIGN BLOCKS
07INITIALIZE ELEMENT STATUS
08READ
0AWRITE
0BSEEK
0FREAD REVERSE
10WRITE FILEMARKS
11SPACE
12INQUIRY
13VERIFY
14RECOVER BUFFERED DATA
15MODE SELECT
16RESERVE
17RELEASE
18COPY
19ERASE
1AMODE SENSE
1BSTART STOP UNIT
1BLOAD UNLOAD
1CRECEIVE DIAGNOSTIC RESULTS
1DSEND DIAGNOSTIC
1EPREVENT ALLOW MEDIUM REMOVAL
23READ FORMAT CAPACITIES
25READ CAPACITY
28READ
29READ GENERATION
2AWRITE
2BSEEK
2BLOCATE
2CERASE
2DREAD UPDATED BLOCK
2EWRITE AND VERIFY
2FVERIFY
33SET LIMITS
34PRE-FETCH
34READ POSITION
35SYNCHRONIZE CACHE
36LOCK UNLOCK CACHE
37READ DEFECT DATA
37INITIALIZE ELEMENT STATUS WITH RANGE
38MEDIUM SCAN
39COMPARE
3ACOPY AND VERIFY
3BWRITE BUFFER
3CREAD BUFFER
3DUPDATE BLOCK
3EREAD LONG
3FWRITE LONG
40CHANGE DEFINITION
41WRITE SAME
42UNMAP
43READ TOC/PMA/ATIP
44REPORT DENSITY SUPPORT
45PLAY AUDIO
46GET CONFIGURATION
47PLAY AUDIO MSF
48SANITIZE
4AGET EVENT STATUS NOTIFICATION
4BPAUSE/RESUME
4CLOG SELECT
4DLOG SENSE
50XDWRITE
51XPWRITE
51READ DISC INFORMATION
52XDREAD
53XDWRITEREAD
54SEND OPC INFORMATION
55MODE SELECT
56RESERVE
57RELEASE
58REPAIR TRACK
5AMODE SENSE
5BCLOSE TRACK/SESSION
5CREAD BUFFER CAPACITY
5DSEND CUE SHEET
5EPERSISTENT RESERVE IN
5FPERSISTENT RESERVE OUT
7Eextended CDB
7Fvariable length CDB
80XDWRITE EXTENDED
80WRITE FILEMARKS
81READ REVERSE
83Third-party Copy OUT commands
84Third-party Copy IN commands
85ATA PASS-THROUGH
86ACCESS CONTROL IN
87ACCESS CONTROL OUT
88READ
89COMPARE AND WRITE
8AWRITE
8BORWRITE
8CREAD ATTRIBUTE
8DWRITE ATTRIBUTE
8EWRITE AND VERIFY
8FVERIFY
90PRE-FETCH
91SYNCHRONIZE CACHE
91SPACE
92LOCK UNLOCK CACHE
92LOCATE
93WRITE SAME
93ERASE
9DSERVICE ACTION BIDIRECTIONAL
9ESERVICE ACTION IN
9FSERVICE ACTION OUT
A0REPORT LUNS
A1ATA PASS-THROUGH
A2SECURITY PROTOCOL IN
A3MAINTENANCE IN
A4MAINTENANCE OUT
A4REPORT KEY
A5MOVE MEDIUM
A5PLAY AUDIO 12
A6EXCHANGE MEDIUM
A7MOVE MEDIUM ATTACHED
A8READ
A9SERVICE ACTION OUT
AAWRITE
ABSERVICE ACTION IN
ACERASE
ADREAD DVD STRUCTURE
AEWRITE AND VERIFY
AFVERIFY
B0SEARCH DATA HIGH
B1SEARCH DATA EQUAL
B2SEARCH DATA LOW
B3SET LIMITS
B4READ ELEMENT STATUS ATTACHED
B5SECURITY PROTOCOL OUT
B6SEND VOLUME TAG
B7READ DEFECT DATA
B8READ ELEMENT STATUS
B9READ CD MSF
BAREDUNDANCY GROUP
BBREDUNDANCY GROUP
BCSPARE
BDSPARE
BEVOLUME SET
BFVOLUME SET