Storage knowledge-What is Lun? What is the purpose of Lun? Good for understanding storage devices

Source: Internet
Author: User
A. Lun Concept

The full name of the Lun is the logical unit number, that is, the logical unit number. We know that the number of mounted devices on the SCSI bus is limited. Generally, there are 6 or 15 devices. We can use the target ID (also known as the scsi id) to describe these devices, as soon as the device is added to the system, there is a code. When we differentiate the device, we only need to say the number and number.
In fact, the object we need to describe is far more than this number, so we introduced the Lun concept, that is, the role of the Lun ID is to expand the target ID. Each target can have multiple Lun devices. Generally, the Lun device is called Lun. In this way, the original target X is changed to target x Lun y, obviously, the ability to describe devices is enhanced. for example, you used to mail something to someone else. When you write an address, you can write:
XXX, 54 Renmin Street, XX City)
But since there are more and more tall buildings, you have to write this:
Room 518, XX building, 54 Renmin Street, XX city, XXX (Reception)
So we can sum up that Lun is a method we have introduced to use and describe more devices and objects, and there is nothing special about it.

B. What is Lun?

Lun ID is not equal to a device, but a number. It does not represent any physical attribute. In our actual environment, the Lun we encounter may be a disk space or a tape drive, or media changer.
The mystery of Lun (compared with some new users) is that it is often not a visible entity, but a virtual object. For example, if a cabinet is regarded as a target device on the host side, we need to divide the disk space of the cabinet into several small units for use on the host for some special purposes, so we came up with some logical drive statements, that is, logical objects at a lower level than the target device. We are used to calling these smaller disk resources lun0, lun1, lun2 .... or something. According to the operating system mechanism, the minimum storage object level identified by the operating system is Lun device, which is a logical object. Therefore, it is often called a logical device.
Some people say that I recognize a disk in windows. I didn't see any Lun statement. Is it Lun = physical disk? The answer is no. As long as you pay attention, there is a lun value in the disk attribute, just because your disk is not divided into multiple storage resource objects, when the entire disk is used as a Lun, The Lun ID is zero by default.
We have encountered such a problem. For example, someone asked us that we have a disk array connected to two hosts. We divided a lun into two hosts and recognized it. Then we thought, first, the operating system divides the disk into two partitions, so that the two hosts use two partitions respectively. Then, when a host goes down, use the cluster software to switch the partition to another host, is this feasible? The answer is no. the disk unit operated by the cluster software is Lun rather than partition, so this operation is not feasible. Of course, in some environments, different disk partitions can be mounted on multiple hosts, but in this case, in fact, disk switching is not involved, so in some demanding environments, this situation is not allowed at all.
It should also be noted that, in some manufacturers' and some product concepts, Lun IDs are bound to specific devices, such as some tape libraries of IBM, the whole tape library has only one target ID, and then changer and tape drive are allocated as lun0, lun1, lun2 ....., however, we should note that this is only because the product has been specially designed and is rarely used.

C. Concept of Lun in the Age of electrical independence of storage and hosts

There are also many new users who confuse the concepts of disks in the array with the internal disks of the host.
In the era of disk arrays and tape libraries, storage is becoming more and more intelligent and more like an independent machine. In fact, the electrical independence of storage and hosts is an inevitable trend. As the saying goes, we need to split our families. In the era of more and more importance of storage, it is inevitable for storage to be self-reliant.
If we think of storage as an independent host, it's easy to understand. When talking about the concept of Lun, we will be divided into two layers. One layer is the range recognized by the operating system of the array machine, and the other layer is the range recognized by the operating system of the server. These two layers are relatively independent, because if we regard storage as a host, it naturally has its own device, target, Lun, and the server also has its own device, target and Lun. On the other hand, these two layers are interrelated. Most of the control systems of an array have virtualization functions. What kind of things does the array want the host to see, the host can see the corresponding things. Of course, the smallest storage resource recognized by the server is at the Lun level. The storage resources on the host's HbA card are located based on two main features: the storage system controller (target) and the Lun ID, this Lun is defined by the storage control system and is a part of the storage resources of the storage system.

D. LUN Masking and Lun Mapping

When an independent disk array is used, the server may use the disk resources of the disk array as long as it sees the storage control system, however, the disk array cannot be used only by one server, so it must control the use of certain disk resources by the host. This control is divided into two parts: the Lun mapping, similar to the green channel, is to ensure that the server can see a certain part of the storage resources, part is the LUN masking, similar to the warning line, it means that the server can only access the storage resources allocated to it, instead of the resources allocated to the server.
There are three methods to implement LUN Masking and Lun mapping: one is set based on the storage control system, the other is set based on the storage exchange system, and the other is set based on the Server OS.
The setting based on the storage control system is a common setting. For example, many disk array control systems can set the lun to be seen by a server. For example, fastt's partition function.
The setting based on the storage exchange system is also a common method, such as zoning.
Server OS-based settings are rarely used. Generally, some software is installed on some operating systems, because this method is completely self-conscious by the server, so it is rarely used.

E. Multi-path of Lun

Nowadays, the storage network is becoming more and more developed, and it is not new that A Lun can be accessed through multiple channels.
The server uses multiple hbas to connect to the storage network. The storage network may consist of multiple switches, and the storage system may have multiple controllers and links, the storage network link from the lun to the server may have multiple different logical links. Therefore, the same physical Lun must be identified as multiple devices on the server. Because OS devices only use bus, target ID, and Lun ID, they are considered to be different devices as long as their numbers are different.
Due to the above situation, the multi-path management software came into being, such as EMC's powerpath, the role of this software is to let the operating system know that those operating systems recognize the Lun is actually a real physical Lun, the specific method is to generate a special device file, which is operated by the operating system. We know that a function of the device file + driver + firmware is to tell the operating system how to use the device. That is to say, the multi-path management software starts from the driver and device files and tells the operating system how to handle these complex identities of Luns.

The Lun logical unit number enterprise-level disk array can accommodate many processors, host ports, disks, and cache devices. It is mainly used to allocate logical unit numbers (Luns) to connected servers ). The server can be directly connected to the disk array or through the exchange device. The Lun mask of the disk array and the Partition Function of the SWAp device are all protected by some form of security, which is used to control the permissions of the server to access the Lun. Once the server is connected to the Lun, data can be transmitted to the disk array through the current network interface. It is worth mentioning that a typical enterprise-level disk array generally supports multiple interface standards.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.