RAC_UDEV的99-oracle-asmdevices.rules配置方法

swq618發表於2018-05-08
wwid為3600c0ff0001001cd78cdaa4e02000000的分割槽1對應來對應/dev/udev1,分割槽2對應/dev/udev2,分割槽3對應/dev/udev3

如果配置中OWNER="grid", GROUP="asmadmin",則必須給oracle使用者也加上asmadmin許可權,usermod -a -G asmadmin oracle

按分割槽來
LINUX 5的/etc/udev/rules.d/99-oracle-asmdevices.rules配置(/block/$parent)
KERNEL=="sda1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /block/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev1", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sda2", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /block/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev2", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sda3", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /block/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev3", OWNER="grid", GROUP="oinstall", MODE="0660"

LINUX 6的/etc/udev/rules.d/99-oracle-asmdevices.rules配置(/dev/$parent)
KERNEL=="sda1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev1", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sda2", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev2", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sda3", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev3", OWNER="grid", GROUP="oinstall", MODE="0660"





按磁碟來(%p)
LINUX 5 
LINUX 6
/etc/udev/rules.d/99-oracle-asmdevices.rules配置都可如下

KERNEL=="sda", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev", OWNER="grid", GROUP="asmadmin", MODE="0660"

LINUX 6也可單獨如下(/dev/$name)
echo "options=--whitelisted --replace-whitespace"  >> /etc/scsi_id.config
KERNEL=="sda", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev", OWNER="grid", GROUP="asmadmin", MODE="0660"

ORACLE官方故障文件推薦如下(%p)
How To Setup Partitioned Linux Block Devices Using UDEV (Non-ASMLIB) And Assign Them To ASM? (文件 ID 1528148.1)
[root@asmlnx2 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="xv*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="360a98000375331796a3f434a55354474", NAME="asmdisk1_udev_p1", ACTION=="add|change", OWNER="grid", GROUP="asmadmin", MODE="0660"






$parent指KERNEL值中的父節點裝置
%p is the path for the current device

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

相關文章