Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure ASM with UDEV on RHEL6

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to configure ASM with UDEV on RHEL6. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

How to use udev for Oracle ASM in Oracle Linux 6 is used differently for different operating systems or different versions of the same operating system. My environment here is mainly RHEL6.0.

The steps are as follows:

1. Edit the / etc/scsi_id.config file, and if it does not exist, create it, adding the following line:

[root@rac1 ~] # vi / etc/scsi_id.config

Options=-whitelisted-replace-whitespace

two。 Get the disk uuid that needs to be bound to ASM Disk. For example, if we want to use / dev/sdc and / dev/sdd as ASM disks, then:

[root@rac1] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdc

1ATA_VBOX_HARDDISK_VB36a9e548-1838194a

[root@rac1] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdd

1ATA_VBOX_HARDDISK_VB9808fc7f-cdf35030

3. Write the udev rules file, write the scsi_id command in PROGRAM, and write the uuid returned in the above command in RESULT, which is no different from OEL5, except that the syntax of the scsi_id command has changed.

[root@rac1 ~] # vi / etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB36a9e548-1838194a", NAME= "asm-disk1", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "1ATA_VBOX_HARDDISK_VB9808fc7f-cdf35030", NAME= "asm-disk2", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"

4. For testing with udevadm, note that the udevadm command does not accept mount device names such as / dev/sdc, but must use raw device names such as / sys/block/sdc.

[root@rac1 ~] # udevadm test / sys/block/sdc

[root@rac1] # udevadm info-query=all-path=/sys/block/sdc

[root@rac1] # udevadm info-query=all-name=asm-disk1

In the display, there is output similar to the following, indicating that the test is correct, and the / dev/sdc device will be bound to / dev/asm-disk1 after udev starts:

Udevadm_test: UDEV_LOG=6

Udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc

Udevadm_test: MAJOR=8

Udevadm_test: MINOR=32

Udevadm_test: DEVNAME=/dev/asm-disk1

Udevadm_test: DEVTYPE=disk

Udevadm_test: ACTION=add

Udevadm_test: SUBSYSTEM=block

5. Start udev

[root@rac1 ~] # / sbin/start_udev

6. Check whether the device is properly bound

[root@rac1 ~] # ls-l / dev/asm*

Brw-rw-- 1 grid asmadmin 8, 32 Oct 26 21:24 / dev/asm-disk1

Brw-rw-- 1 grid asmadmin 8, 48 Oct 26 21:17 / dev/asm-disk2

7. Use scripts to generate 99-oracle-asmdevices.rules

For i in b c

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

This is the end of this article on "how to configure ASM with UDEV on RHEL6". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report