How to create Oracle ASM devices using device-mapper multipath devices in Red Hat Enterprise Linux 6

How to create Oracle ASM devices using device-mapper multipath devices in Red Hat Enterprise Linux 6?

环境

    Red Hat Enterprise Linux 6
    Device-Mapper Multipath (DM Multipath)
    Oracle ASM
    Udev

决议

    Please use the following steps to create Oracle ASM disks with dm-multipath on RHEL 6 systems:

    Determine the DM_UUID value for each multipath device that is required to be used for Oracle ASM. You could use following command for the same:

    $ udevadm info --query=all --name=/dev/mapper/mpathN |grep -i DM_UUID

    Please replace mpathN in above command with name of the multipath devices used in your setup/environment.

    The output of above command would be similar to the one shown below:

    $ udevadm info --query=all --name=/dev/mapper/mpathd|grep -i DM_UUID
    E: DM_UUID=mpath-1234567890abcdefghijklmnopqrstuvwxyz

    Above command would be required to be repeated for each multipath device to be used with Oracle ASM, and please note down the DM_UUID value retrieved for each multipath device. This value would be used to create udev rule.

    Create a udev rule file /etc/udev/rules.d/96-asmmultipath.rules and add a udev rule for each multipath device using it‘s DM_UUID value:

    ACTION=="add|change", ENV{DM_UUID}=="mpath-<UUID>", SYMLINK+="oracleasm/asm01", GROUP="dba", OWNER="oracle", MODE="0660"

    e.g. to create Oracle ASM disk /dev/oracleasm/asm01 using above multipath device mpathd following udev rule could be used:

    $ cat /etc/udev/rules.d/96-asmmultipath.rules
    ACTION=="add|change", ENV{DM_UUID}=="mpath-1234567890abcdefghijklmnopqrstuvwxyz", SYMLINK+="oracleasm/asm01", GROUP="dba", OWNER="oracle", MODE="0660"

    Note that we have replaced mpath-<UUID> in above rule with the DM_UUID retrieved in step [1]. Similarly a udev rule for each multipath device would be required to be appended in /etc/udev/rules.d/96-asmmultipath.rules file.

    You could also modify Symlink path (e.g. oracleasm/asm01 in above udev rules), Group, Owner permissions as per requirement.

    Reload the udev service for the changes to take effect and create the ASM disks.




郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。