HOME

TheInfoList



OR:

In
computer storage Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a compute ...
, a logical unit number, or LUN, is a number used to identify a logical unit, which is a device addressed by the
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
protocol or by
Storage Area Network A storage area network (SAN) or storage network is a computer network which provides access to consolidated, block-level data storage. SANs are primarily used to access data storage devices, such as disk arrays and tape libraries from serve ...
protocols that encapsulate SCSI, such as
Fibre Channel Fibre Channel (FC) is a high-speed data transfer protocol providing in-order, lossless delivery of raw block data. Fibre Channel is primarily used to connect computer data storage to servers in storage area networks (SAN) in commercial data cen ...
or
iSCSI Internet Small Computer Systems Interface or iSCSI ( ) is an Internet Protocol-based storage networking standard for linking data storage facilities. iSCSI provides block-level access to storage devices by carrying SCSI commands over a TCP/IP ...
. A LUN may be used with any device which supports read/write operations, such as a
tape drive A tape drive is a data storage device that reads and writes data on a magnetic tape. Magnetic tape data storage is typically used for offline, archival data storage. Tape media generally has a favorable unit cost and a long archival stability. ...
, but is most often used to refer to a
logical disk A logical disk, logical volume or virtual disk (VD or vdisk for short) is a virtual device that provides an area of usable storage capacity on one or more physical disk drive(s) in a computer system. The disk is described as ''logical'' or ''virt ...
as created on a SAN. Though not technically correct, the term "LUN" is often also used to refer to the
logical disk A logical disk, logical volume or virtual disk (VD or vdisk for short) is a virtual device that provides an area of usable storage capacity on one or more physical disk drive(s) in a computer system. The disk is described as ''logical'' or ''virt ...
itself.


Examples

To provide a practical example, a typical multi-disk drive has multiple physical
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
ports, each with one SCSI target address assigned. An administrator may format the disk array as a
RAID Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
and then
partition Partition may refer to: Computing Hardware * Disk partitioning, the division of a hard disk drive * Memory partition, a subdivision of a computer's memory, usually for use by a single job Software * Partition (database), the division of a ...
this RAID into several separate storage-volumes. To represent each volume, a
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
target is configured to provide a logical unit. Each
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
target may provide multiple logical units and thus represent multiple volumes, but this does ''not'' mean that those volumes are
concatenated In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalisations of concatenat ...
. The computer that accesses a volume on the disk array identifies which volume to read or write with the LUN of the associated logical unit. In another example: a single disk-drive has one physical SCSI port. It usually provides just a single target, which in turn usually provides just a single logical unit whose LUN is zero. This logical unit represents the entire storage of the disk drive.


Use

''How to select a LUN:'' In the early versions of SCSI, an initiator delivers a Command Descriptor Block (CDB) to a target (physical unit) and within the CDB is a 3-bit LUN field to identify the logical unit within the target. In current SCSI, the initiator delivers the CDB to a particular logical unit, so the LUN appears in the transport layer data structures and not in the CDB. ''LUN vs. SCSI Device ID:'' The LUN is not the only way to identify a logical unit. There is also the SCSI Device ID, which identifies a logical unit uniquely in the world. Labels or serial numbers stored in a logical unit's storage volume often serve to identify the logical unit. However, the LUN is the only way for an initiator to address a command to a particular logical unit, so initiators often create, via a discovery process, a mapping table of LUN to other identifiers. ''Context sensitive:'' The LUN identifies a logical unit only within the context of a particular initiator. So two computers that access the same disk volume may know it by different LUNs. ''LUN 0:'' There is one LUN which is required to exist in every target: zero. The logical unit with LUN zero is special in that it must implement a few specific commands, most notably Report LUNs, which is how an initiator can find out all the other LUNs in the target. But LUN zero need not provide any other services, such as a storage volume. Many SCSI targets contain only one logical unit (so its LUN is necessarily zero). Others have a small number of logical units that correspond to separate physical devices and have fixed LUNs. A large storage system may have up to thousands of logical units, defined logically, by administrative command, and the administrator may choose the LUN or the system may choose it.


c_t_d_s_ nomenclature in Unix

From the computer perspective, SCSI LUN is only a part of the full SCSI address. The full device's address is made from the: * c-part: ''controller ID'' of the
host bus adapter In computer hardware, a host controller, host adapter, or host bus adapter (HBA), connects a computer system bus, which acts as the host system, to other computer network, network and computer storage, storage devices. The terms are primarily ...
, * t-part: ''target ID'' identifying the SCSI target on that controller, * d-part: ''disk ID'' identifying a LUN on that target, * s-part: ''slice ID'' identifying a specific
partition Partition may refer to: Computing Hardware * Disk partitioning, the division of a hard disk drive * Memory partition, a subdivision of a computer's memory, usually for use by a single job Software * Partition (database), the division of a ...
on that disk. In the
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
family of
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s, these IDs are often combined into a single "name". For example, ''/dev/dsk/c1t2d3s4'' would refer to controller 1, target 2, disk 3, slice 4. Presently
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
,
HP-UX HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
, NCR, and others continue to use "c_t_d_s_" nomenclature, while
AIX Aix or AIX may refer to: Computing * AIX, a line of IBM computer operating systems *An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set * Athens Internet Exchange, a European Internet exchange point Places Belgi ...
has abandoned it in favor of more familiar names. HP-UX refers to this as the Legacy Naming Model since version 11i v3.


Other uses

The term ''logical unit number'' also applies to an input/output access channel within certain
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s.


See also

*
LUN masking Logical Unit Number Masking or LUN masking is an authorization process that makes a Logical Unit Number available to some hosts and unavailable to other hosts. LUN Masking is a level of security that makes a LUN available to only selected hosts ...


References

{{reflist SCSI