How to use Udev for ASM in Oracle Linux 6

Source: Internet
Author: User
Tags dba uuid

Most of the documents that can be found on the web are set in RHEL5 or OEL5 Udev,udev the biggest effect for Linux is to prevent the operating system from restarting, and the drive letter used as an ASM disk is changed.
For example, Tim Hall article: UDEV SCSI Rules Configuration for ASM in Oracle Linux 5.
For example, MacLean article: Use the Udev service to address the RAC ASM storage device name.

But in OEL6 or RHEL6, all this has changed.

The main changes are:
1. The command syntax for SCSI_ID has changed, and the command scsi_id-g-u-s is no longer valid.
2. The Udevtest command is gone and integrated into the UDEVADM.

You can refer to the official documentation for Redhat (there are some errors in this document, and –device= in Udev rules, the correct way to see step 3rd below):
Configuring persistent storage in Red Hat Enterprise Linux 6.

The steps are as follows:
1. Edit the/etc/scsi_id.config file, if the file does not exist, create the file, and add the following line:

Options=--whitelisted--replace-whitespace

Note: In my tests, this step can be omitted.

2. Get the disk UUID that needs to be bound to ASM disk, for example we want to use/DEV/SDC and/DEV/SDD as ASM disks, then:

# scsi_id--whitelisted--replace-whitespace--DEVICE=/DEV/SDC

1ata_vbox_harddisk_vb36a9e548-1838194a

# scsi_id--whitelisted--replace-whitespace--DEVICE=/DEV/SDD

1ata_vbox_harddisk_vb9808fc7f-cdf35030

3. Write the Udev rules file, program write scsi_id command, the result of the above command to write the UUID returned, which is no different from the OEL5, but the syntax of the SCSI_ID command has changed.

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= "DBA", 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= "DBA", mode= "0660"

4. Test with UDEVADM, note that the Udevadm command does not accept a mount device name such as/DEV/SDC, and must be the original device name using/SYS/BLOCK/SDC.

Udevadm TEST/SYS/BLOCK/SDC

Udevadm Info--query=all--PATH=/SYS/BLOCK/SDC

Udevadm Info--query=all--name=asm-disk1

In the display, there is an output similar to the following, indicating that the test is correct and that 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

#/sbin/start_udev

6. Check if the device is properly bound

# ls-l/dev/asm*

BRW-RW----1 Grid dba 8, Oct 21:24/dev/asm-disk1

BRW-RW----1 Grid dba 8, Oct 21:17/dev/asm-disk2

How to use Udev for ASM in Oracle Linux 6

Related Article

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.