Tuesday, 18 February 2014

SCSI commands (small computer system interface) and LUNs Basics

There are 4 categories of SCSI commands: N (non-data), W (writing data from initiator to target), R (reading data), and B (bidirectional). There are about 60 different SCSI commands in total, with the most commonly used being:
§  Test unit ready: Queries device to see if it is ready for data transfers (disk spun up, media loaded, etc.).
§  Inquiry: Returns basic device information.
§  Request sense: Returns any error codes from the previous command that returned an error status.
§  Send diagnostic and Receive diagnostic results: runs a simple self-test, or a specialised test defined in a diagnostic page.
§  Start/Stop unit: Spins disks up and down, or loads/unloads media (CD, tape, etc.).
§  Read capacity: Returns storage capacity.
§  Format unit: Prepares a storage medium for use. In a disk, a low level format will occur. Some tape drives will erase the tape in response to this command.
§  SCSI Read format capacities: Retrieve the data capacity of the device.
§  Read (four variants): Reads data from a device.
§  Write (four variants): Writes data to a device.
§  Log sense: Returns current information from log pages.
§  Mode sense: Returns current device parameters from mode pages.
§  Mode select: Sets device parameters in a mode page.

Each device on the SCSI bus is assigned a unique SCSI identification number or ID. Devices may encompass multiple logical units, which are addressed by logical unit number (LUN). Simple devices have just one LUN, more complex devices may have multiple LUNs.
An SCSI LUN can be addressed with a combination of the controller ID, the target ID, a disk ID, and occasionally the slice ID. The identifications (IDs) in a UNIX OS are generally joined as one word. A typical example is the address c1t2d3s4. This refers to controller 1, target 2, disk 3 and slice 4. Full device addresses are as follows: 
  • c-part: controller ID of host bus adapter
  • t-part: target ID classifying SCSI target on the bus
  • d-part: disk ID classifying LUN on the target
  • s-part: slice ID classifying exact slice on the disk

No comments:

Post a Comment