Resolving the problem of device ID and drive letter inconsistency of Linux virtual machine

Source: Internet
Author: User

When a user mounts multiple SCSI disks, the virtual machine internal disk mapping and user Configuration inconsistencies after the virtual machine is restarted. , the user-configured virtual machine SCSI device ID corresponds to the drive letter.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/C1/wKioL1WndJXjGHH1AAEq0I2gy_Q891.jpg "title=" 111. PNG "alt=" wkiol1wndjxjghh1aaeq0i2gy_q891.jpg "/>


When the virtual machine restarts, the virtual machine's SCSI device ID corresponds to the drive letter, and the user's configuration is inconsistent. The SCSI device ID of the virtual machine as shown is inconsistent with the drive letter:


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/C4/wKiom1WncsuwDQ5yAAIsRfi1dVU522.jpg "title=" 222. PNG "alt=" wkiom1wncsuwdq5yaaisrfi1dvu522.jpg "/>


In this case, a change in the device that corresponds to the drive letter used in the Oracle RAC can have a certain impact on the business.



Workaround:

You need to specify the SCSI device ID when using a virtual machine SCSI device, which is primarily intended for use with the entire SCSI disk and not to partition SCSI disks inside the virtual machine.

Environment: Redhat 6.5 64-bit operating system, example:/etc/udev/rules.d/60-raw.rules configuration file.

action== "Add", kernel== "sd*", program== "/sbin/scsi_id-g-u-d/dev/$name",
result== "360022a11000e085d0de717f500000003", run+= "/bin/raw/dev/raw/raw1%N"
action== "Add", kernel== "sd*", program== "/sbin/scsi_id-g-u-d/dev/$name",
result== "360022a11000e085d0de7372c0000002e", run+= "/bin/raw/dev/raw/raw2%N"
kernel== "Raw1", owner= "grid", group= "Oinstall", mode= "777"
kernel== "Raw2", owner= "grid", group= "Oinstall", mode= "777"

We can get the result in the configuration by/sbin/scsi_id-g-u-d/dev/$name. For example:

When you need to use/DEV/SDA as a RAC device, you can perform:
#/sbin/scsi_id-g-u-d/DEV/SDA
The resulting results are:
result in #360022a11000e085d0de717f500000003 \ \ Configuration

Redhat 6.5 64-bit operating system, example:/etc/udev/rules.d/60-raw.rules configuration file.

action== "Add", kernel== "sd*", program== "/sbin/scsi_id-g-u-s%p",
result== "360022a11000be24a0004aeee0000000a", run+= "/bin/raw/dev/raw/raw1%N"
kernel== "Raw1", owner= "grid", group= "Oinstall", mode= "777"

The result in the configuration is obtained by/SBIN/SCSI_ID-G-u-s%p specified in program. For example:

If you need to use/DEV/SDA as a RAC device, you can perform:
#/sbin/scsi_id-g-u-s/BLOCK/SDA
The resulting results are:
result in #360022a11000be24a0004aeee0000000a \ \ Configuration



Cause Analysis:

When an Oracle RAC configures a SCSI disk during installation, the traditional way is to point to the specific drive letter, as follows/etc/udev/rules.d/60-raw.rules the contents of the configuration file, where the kernel field represents the specific drive letter pointed to.

action== "Add", kernel== "SDB", run+= "/bin/raw/dev/raw/raw1%N"
action== "Add", kernel== "SDC", run+= "/bin/raw/dev/raw/raw2%N"
action== "Add", kernel== "SDD", run+= "/bin/raw/dev/raw/raw3%N"
kernel== "Raw1", owner= "grid", group= "Oinstall", mode= "777"
kernel== "Raw2", owner= "grid", group= "Oinstall", mode= "777"
kernel== "RAW3", owner= "grid", group= "Oinstall", mode= "777"

The corresponding relationship between the device ID and the drive letter (such as SDA\SDB) that is presented to the virtual machine in the physical device mapping may change after the virtual machine restarts for the following reasons:

Linux rules for generating SDA, SDB, and SDC are determined by the Linux kernel. Linux kernel for this disk device mapping basically depends on three sequence, one is the disk driver load, the second is the host PCI slot monitoring, the third is the disk itself monitoring, first comes SDA, and so on.

The physical machine restarts after the device is hot-plugged, and also faces the problem of changing the drive letter. For example, before starting is SDA,SDB,SDC, the SDB device is unplugged and restarted, the device number presented is SDA,SDB (the original SDC).

This article is from the "Hollows Jie Sun" blog, be sure to keep this source http://xjsunjie.blog.51cto.com/999372/1675363

Resolving the problem of device ID and drive letter inconsistency of Linux virtual machine

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.