In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to bind udev on rhel6. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
The environment is RHEL5, and the script automatically generates the udev rule rule file:
For i in b c d e f g h i j k; doecho "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-g-u-s% p\ ", RESULT==\" `scsi_id-g-u-s / block/sd$ i`\ ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "" done
The above script is generic on Linux 5, but it has been reported to be invalid in redhat/Oracle Linux 6 and above.
This is because:
In OEL6 or RHEL6, all this has changed.
The main changes are:
1. The command syntax of scsi_id has changed, and commands such as scsi_id-g-u-s are no longer valid.
2. The udevtest command is no longer available and integrated into udevadm.
How to use udev for Oracle ASM in Oracle Linux 6
Below I provide an improved script that generates the correct udev rule rule file on redhat/Oracle Linux 6:
1.# first confirm that [root@vrh7 dev] # cat / etc/issue Oracle Linux Server release 6.2Kernel\ r on an\ m2.# add records to / etc/scsi_id.configecho "options=--whitelisted-- replace-whitespace" > > / etc/scsi_id.config3. # confirm which block devices require udev binding [root@vrh7 dev] # ls-l sd*brw-rw----. 1 root disk 8, 0 Jun 30 09:29 sdabrw-rw----. 1 root disk 8, 1 Jun 30 09:29 sda1brw-rw----. 1 root disk 8, 2 Jun 30 09:29 sda2brw-rw----. 1 root disk 8, 16 Jun 30 09:29 sdbbrw-rw----. 1 root disk 8, 32 Jun 30 09:29 sdcbrw-rw----. 1 root disk 8, 48 Jun 30 09:29 sddbrw-rw----. 1 root disk 8, 64 Jun 30 09:29 sdebrw-rw----. 1 root disk 8, 80 Jun 30 09:29 sdf for example, in this example, block devices with sdb- > sdf need to be bound 4. Put the number of b-> f in the for loop, for example: # AUTO UDEV RULE BY Maclean Liu 2012/06/30for i in b c d e f Doecho "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i`\ ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "done will generate RULE bound to sdb- > sdf devices. When writing these RULE to / etc/udev/rules.d/99-oracle-asmdevices.rules, you can also directly use the following script to write RULE to 99-oracle-asmdevices.rules# AUTO UDEV RULE BY Maclean Liu 2012/06/30for i in b c de f Doecho "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i` ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "> > / etc/udev/rules.d/99-oracle-asmdevices.rulesdone5. After that, run / sbin/start_udev with root
Actual running example:
[root@vrh7 dev] # echo "options=--whitelisted-- replace-whitespace" > > / etc/scsi_ id.config[ root @ vrh7 dev] # for i in b c de f > do > echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/sd$ i` ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ " MODE=\ "0660\" > > / etc/udev/rules.d/99-oracle-asmdevices.rules > done [root@vrh7 dev] # [root@vrh7 dev] # cat / etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL== "sd*", BUS== "scsi", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB09cadb31-cfbea255", NAME= "asm-diskb", OWNER= "grid", GROUP= "asmadmin" MODE= "0660" KERNEL== "sd*", BUS== "scsi", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB5f097069-59efb82f", NAME= "asm-diskc", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sd*", BUS== "scsi", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB4e1a81c0-20478bc4", NAME= "asm-diskd" OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sd*", BUS== "scsi", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VBdcce9285-b13c5a27", NAME= "asm-diske", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" KERNEL== "sd*", BUS== "scsi", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name" RESULT== "1ATA_VBOX_HARDDISK_VB82effe1a-dbca7dff", NAME= "asm-diskf", OWNER= "grid", GROUP= "asmadmin", MODE= "0660" [root@vrh7 dev] # [root@vrh7 dev] # / sbin/start_udevStarting udev: [OK] [root@vrh7 dev] # ls-l asm*brw-rw----. 1 grid asmadmin 8, 16 Jun 30 09:34 asm-diskbbrw-rw----. 1 grid asmadmin 8, 32 Jun 30 09:34 asm-diskcbrw-rw----. 1 grid asmadmin 8, 48 Jun 30 09:34 asm-diskdbrw-rw----. 1 grid asmadmin 8, 64 Jun 30 09:34 asm-diskebrw-rw----. 1 grid asmadmin 8, 80 Jun 30 09:34 asm-diskf read the above content, do you have any further understanding of how to bind udev on rhel6? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.