set udev for setting disk permiss on ASM when using multipath OL 6.x_1521757.1

rongshiyuan發表於2014-10-14

How to set udev rule for setting the disk permission on ASM disks when using multipath on OL 6.x (文件 ID 1521757.1)



In this Document

Goal
Solution


Applies to:

Linux OS - Version Oracle Linux 6.0 with Unbreakable Enterprise Kernel [2.6.32] and later
Information in this document applies to any platform.
review currency on 22th.Sep 2014

Goal

How to set udev rule for setting the disk permission on ASM disks when using multipath on OL 6.x.
 

Solution

Follow the below steps if you are using multipath and want to set udev rule on multipath device

1) Determine partitioned alias for target device

# dmsetup ls |grep p1
datap1 (253, 5) ---&gt you would see something similar to this
 

 
2) Edit /etc/udev/rules.d/12-dm-permissions.rules file to set the above device ownership as oracle:oinstall

# Set permissions for first partition created on a multipath device (and detected by kpartx)
ENV{DM_NAME}=="datap1", OWNER:="oracle", GROUP:="oinstall", MODE:="660", SYMLINK+="iscsi/oraasm-$env{DM_NAME}"


3) Restart multipathd service.

# service multipathd restart

 
4) Check if permissions are correct

# ls -l /dev/dm*
brw-rw---- 1 root   disk 253, 0 Apr 15 19:40 /dev/dm-0
brw-rw---- 1 root   disk 253, 1 Apr 15 19:40 /dev/dm-1
brw-rw---- 1 root   disk 253, 2 Apr 15 21:47 /dev/dm-2
brw-rw---- 1 root   disk 253, 3 Apr 15 21:47 /dev/dm-3
brw-rw---- 1 oracle dba  253, 4 Apr 15 21:47 /dev/dm-4
brw-rw---- 1 oracle dba  253, 5 Apr 15 21:47 /dev/dm-5

 
5) Verify if oracle ASM symbolic links exists for multipath devices.

# ls -l /dev/iscsi/*
lrwxrwxrwx 1 root root 7 Apr 15 21:47 /dev/iscsi/oraasm-crsp1 -> ../dm-4
lrwxrwxrwx 1 root root 7 Apr 15 21:47 /dev/iscsi/oraasm-datap1 -> ../dm-5

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1298964/,如需轉載,請註明出處,否則將追究法律責任。

相關文章