Use udev to set the static device name-Linux Enterprise Application-Linux server application information. For more information, see. 1. Objectives:
In the project, the device driver used by the local disk and SAN is the same driver module, which leads to a change in the module loading sequence during system startup to realize the drive letter sequence, fortunately, linux has udev, which dynamically creates/dev devices and runs them in user space.
2. Principle:
Let's see the figure below.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // docs.google.com/File? Id = ddtr4p49_187h8d322dp_ B '); ">
The information provided by hotplug and libsysfs allows udev to easily create devices and flexibly configure them. Because the operation of the kernel on the device mainly depends on the master and slave device numbers, the name does not matter.
3. Implementation Method:
(The Red Flag DCserver 5.0 or a later version can be implemented, but cannot be implemented before 4.1)
1. Obtain the UUID of the scsi device, edit the/etc/scsi_id.conf file, comment out option =-B, remove the # sign before option =-g, save and exit.
2. Run # scsi_id-g-s/block/sdx as the root user. x is a, B, and c .... A hexadecimal number similar to the following is obtained.
For example:
[Root @ devices] # scsi_id-g-s/block/sdc
3600a0b8000132753690015427b625e
3. Create a udev rule file. Edit/etc/udev/rules. d/20-names.rules Add the following content: KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id", RESULT = "3600a0b80001315427b625e ", NAME = "sda % n" restart the system for verification.
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