四、存储设置
The /dev/dm-N devices are used internally by device-mapper-multipath and are non-persistent across reboot, so should not be used. The /dev/mpath/ devices are created for multipath devices to be visible together, however, may not be available during early stages of boot, so, again, should not be used. However, /dev/mapper/ devices are persistent and created sufficiently early during boot - use only these devices to access and interact with multipathed devices.
在RedHat 5.4 存储设置:
[root@rac2 ~]# more /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
ACTION=="add", KERNEL=="/dev/mapper/mpath6", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="/dev/mapper/mpath7", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="raw1", OWNER="root", GROUP="oinstall", MODE="777"
ACTION=="add", KERNEL=="raw2", OWNER="Oracle", GROUP="oinstall", MODE="777"
[root@rac2 ~]# more /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/bin/raw /dev/raw/raw1 /dev/mapper/mpath6
/bin/raw /dev/raw/raw2 /dev/mapper/mpath7
[root@rac2 ~]#
[root@rac1 ~]# chown -R oracle:oinstall /dev/mapper/mpath[1-5]
[root@rac1 ~]# chmod -R 755 /dev/mapper/mpath[1-5]
[root@rac1 ~]#
//////
ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="/dev/sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="/dev/sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="/dev/sdb4", RUN+="/bin/raw /dev/raw/raw4 %N"
KERNEL=="raw1", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw2", OWNER="oracle", GROUP="oinstall", MODE="640"
KERNEL=="raw3", OWNER="oracle", GROUP="dba", MODE="660"
KERNEL=="raw4", OWNER="oracle", GROUP="dba", MODE="660"
/etc/udev/rule.d/60-raw.rules
这种方法的配置如下:
[root@rac2 rules.d]# cat 60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="dm-7", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="dm-8", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="raw1", OWNER="root", GROUP="oinstall", MODE="660"
ACTION=="add", KERNEL=="raw2", OWNER="oracle", GROUP="oinstall", MODE="660"
-- 这个是对raw 设备进行权限设置的
[root@rac2 rules.d]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/bin/raw /dev/raw/raw1 /dev/dm-7
/bin/raw /dev/raw/raw2 /dev/dm-8
-- 系统启动时挂载raw 设备
