使用UDEV綁定ASM多路徑磁盤

OS版本:RHEL6.4
1) 找出目標磁盤的分區別名
# dmsetup ls |grep data
data01  (253:9)
data04  (253:4)
data03  (253:3)
data02  (253:2)
# dmsetup ls |grep crs
crs03   (253:8)
crs02   (253:7)
crs01   (253:5)

2) 編寫/etc/udev/rules.d/12-dm-permissions.rules規則文件
ENV{DM_NAME}=="data01", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="data02", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="data03", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="data04", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="crs01", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="crs02", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"
ENV{DM_NAME}=="crs03", OWNER:="oragrid", GROUP:="asmadmin", MODE:="660", SYMLINK+="iscsi/asm-$env{DM_NAME}"

3) 重啓多路徑服務
# service multipathd restart
 
4) 檢查權限是否設置正確
# ls -l /dev/dm*
brw-rw---- 1 root    disk     253,  0 Dec 15 14:18 /dev/dm-0
brw-rw---- 1 root    disk     253,  1 Dec 15 14:18 /dev/dm-1
brw-rw---- 1 root    disk     253, 10 Dec 15 14:18 /dev/dm-10
brw-rw---- 1 oragrid asmadmin 253,  2 Dec 15 14:18 /dev/dm-2
brw-rw---- 1 oragrid asmadmin 253,  3 Dec 15 14:18 /dev/dm-3
brw-rw---- 1 oragrid asmadmin 253,  4 Dec 15 14:18 /dev/dm-4
brw-rw---- 1 oragrid asmadmin 253,  5 Dec 15 14:18 /dev/dm-5
brw-rw---- 1 oragrid asmadmin 253,  7 Dec 15 14:18 /dev/dm-7
brw-rw---- 1 oragrid asmadmin 253,  8 Dec 15 14:18 /dev/dm-8
brw-rw---- 1 oragrid asmadmin 253,  9 Dec 15 14:18 /dev/dm-9

 
5) 確保多路徑設備的ASM符號連接已經存在# ls -l /dev/iscsi/*
[root@ysdb1 ~]#  ls -l /dev/iscsi/*
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-crs01 -> ../dm-5
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-crs02 -> ../dm-7
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-crs03 -> ../dm-8
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-data01 -> ../dm-9
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-data02 -> ../dm-2
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-data03 -> ../dm-3
lrwxrwxrwx 1 root root 7 Dec 15 14:18 /dev/asm/asm-data04 -> ../dm-4
相關文章
相關標籤/搜索