In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the solution to the problem of inconsistent id and drive letter of scsi device of linux virtual machine. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
When a user mounts multiple scsi disks, the internal disk mapping of the virtual machine is inconsistent with the user configuration after restarting the virtual machine. As shown in the figure, the user-configured virtual machine scsi device id corresponds to the drive letter.
When the virtual machine is restarted, the corresponding relationship between the scsi device id and the drive letter of the virtual machine is not consistent with the user configuration. The scsi device id of the virtual machine shown in the following figure does not match the drive letter:
In this case, when the device corresponding to the drive letter used in Oracle RAC changes, it will have a certain impact on the business.
Solution:
When using a virtual machine scsi device, you need to specify the scsi device id, which is mainly suitable for situations where the entire scsi disk is used and the scsi disk is not partitioned within the virtual machine.
Environment: Redhat 6.564-bit operating system, for 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= "
KERNEL== "raw2", OWNER= "grid", GROUP= "oinstall", MODE= "
We can get the RESULT in the configuration through / sbin/scsi_id-g-u-d / dev/$name. For example:
When you need to use / dev/sda as a RAC device, you can execute:
# / sbin/scsi_id-g-u-d / dev/sda
The results are as follows:
# RESULT in 360022a11000e085d0de717f500000003\\ configuration
Redhat 6.564-bit operating system, for example: / etc/udev/rules.d/60-raw.rules configuration file.
ACTION== "add", KERNEL== "sd*", PROGRAM== "/ sbin/scsi_id-g-u-d / dev/$name"
RESULT== "360022a11000be24a0004aeee0000000a", RUN+= "/ bin/raw / dev/raw/raw1% N"
KERNEL== "raw1", OWNER= "grid", GROUP= "oinstall", MODE= "
Get the RESULT in the configuration by / sbin/scsi_id-g-u-d / dev/$name specified in PROGRAM. For example:
If you need to use / dev/sda as the RAC device, you can execute:
# / sbin/scsi_id-g-u-d / dev/sda
The results are as follows:
# RESULT in 360022a11000be24a0004aeee0000000a\\ configuration
Cause analysis:
When Oracle RAC configures scsi disks during installation, the traditional way is to point to a specific drive letter, such as the contents of the / etc/udev/rules.d/60-raw.rules 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= "
KERNEL== "raw2", OWNER= "grid", GROUP= "oinstall", MODE= "
KERNEL== "raw3", OWNER= "grid", GROUP= "oinstall", MODE= "
The correspondence between the device id and the drive letter (such as sda\ sdb) presented to the virtual machine in the physical device mapping may change after the virtual machine is rebooted for the following reasons:
The rules for Linux to generate sda, sdb, and sdc are determined by the Linux kernel. The mapping of the Linux kernel to this kind of disk device basically depends on three orders, one is the loading of the disk driver, the second is the monitoring of the host PCI slot, the third is the monitoring of the disk itself, the first is sda, and so on.
When the physical machine restarts after the device is hot-swappable, it will also face the problem of changing the drive letter. For example, sda,sdb,sdc before startup, unplug the sdb device and restart it, and the device number is sda,sdb (the original sdc).
The solution to the problem of inconsistency between id and drive letter of scsi devices in linux virtual machine is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.