How To: set udev rule for setting the disk permission on ASM disks when using multipath on Linux 6.x

在RHEL6.4上安装11gR2的RAC时,使用了MULTIPATH来聚合绑定多路径的磁盘,并且修改磁盘的权限,赋予grid:asmadmin用户和组。

此时,在安装时可以发现磁盘,日志如下

INFO: ... discoveryString = /dev/mapper/*
INFO: Executing [/tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/kfod, nohdr=true, verbose=true, disks=all, status=true, op=disks, asm_diskstring=‘/dev/mapper/*‘]
 with environment variables {XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, LANG=en_US.UTF-8, DISPLAY=:1.0, ORACLE_BASE=/oracle, PWD=/home/grid, _=/software/grid/install/.oui, ORACLE_SID=+ASM1, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, USER=grid, QTINC=/usr/lib64/qt-3.3/include, CLASSPATH=, G_BROKEN_FILENAMES=1, HOME=/home/grid, HOSTNAME=ssodb01, LESSOPEN=|/usr/bin/lesspipe.sh %s, LD_LIBRARY_PATH=/tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/../lib, ORACLE_HOME=/tmp/OraInstall2014-11-24_04-55-14PM/ext/bin, LOGNAME=grid, SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass, SHELL=/bin/bash, CVS_RSH=ssh, SHLVL=2, HISTCONTROL=ignoredups, MAIL=/var/spool/mail/grid, QTDIR=/usr/lib64/qt-3.3, JAVA_HOME=, QTLIB=/usr/lib64/qt-3.3/lib, LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:, LC_ALL=, HISTSIZE=1000, TERM=xterm, PATH=/usr/bin:/usr/ccs/bin:/oracle/product/11g/grid/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/grid/bin:/software/grid/install}
INFO: Starting Output Reader Threads for process /tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/kfod
INFO: Parsing 102400 CANDIDATE /dev/mapper/mpathb grid     asmadmin
INFO: The process /tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/kfod exited with code 0
INFO: Waiting for output processor threads to exit.
INFO: Parsing 102400 CANDIDATE /dev/mapper/mpathc grid     asmadmin
INFO: Parsing 102400 CANDIDATE /dev/mapper/mpathd grid     asmadmin
INFO: Parsing 102400 CANDIDATE /dev/mapper/mpathe grid     asmadmin
INFO: Parsing 102400 CANDIDATE /dev/mapper/mpathf grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathg grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathh grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathi grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathj grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathk grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathl grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathm grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpathn grid     asmadmin
INFO: Parsing 1024 CANDIDATE /dev/mapper/mpatho grid     asmadmin

再进一步使用时,遇到错误ins-30508 invalid asm disks

INFO: Starting Output Reader Threads for process /tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/kfod
INFO: Parsing KFOD-00311: Error scanning device /dev/mapper/mpathi
INFO: Parsing ORA-15025: could not open disk "/dev/mapper/mpathi"
INFO: Parsing Linux-x86_64 Error: 13: Permission denied
INFO: The process /tmp/OraInstall2014-11-24_04-55-14PM/ext/bin/kfod exited with code 0
INFO: Parsing Additional information: 42
INFO: Waiting for output processor threads to exit.
INFO: Parsing Additional information: 22608487
INFO: Parsing Additional information: 1598903119
INFO: Parsing KFOD-00311: Error scanning device /dev/mapper/mpathh
INFO: Parsing ORA-15025: could not open disk "/dev/mapper/mpathh"
INFO: Parsing Linux-x86_64 Error: 13: Permission denied
INFO: Parsing Additional information: 42
INFO: Parsing Additional information: 22608487
INFO: Parsing Additional information: 1598903119
INFO: Parsing KFOD-00311: Error scanning device /dev/mapper/mpathg
INFO: Parsing ORA-15025: could not open disk "/dev/mapper/mpathg"
INFO: Parsing Linux-x86_64 Error: 13: Permission denied
INFO: Parsing Additional information: 42
INFO: Parsing Additional information: 22608487
INFO: Parsing Additional information: 1598903119
INFO: Output processor threads exited.
SEVERE: [FATAL] [INS-30508] Invalid ASM disks.
   CAUSE: The disks [/dev/mapper/mpathg, /dev/mapper/mpathh, /dev/mapper/mpathi] were not valid.
   ACTION: Please choose or enter valid ASM disks.
INFO: Advice is ABORT

原来识别到的磁盘此时的权限已经发生变化。此时就需要在multipath层面对磁盘进行显示的权限属组配置。

查看Redhat 6的文档,有这么一段话,来源https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/config_file_defaults.html

As of the Red Hat Enterprise Linux 6.0 release, the mode, uid, and gid parameters have been deprecated.
Permissions for device-mapper devices (including mulitpath mappings) are set by means of udev rules.
There is a template file in /usr/share/doc/device-mapper-version called 12-dm-permissions.rules
which you can use and place in the /etc/udev/rules.d directory for it to take effect.

1、使用dmsetup ls查看确认已配置的multipath的磁盘设备

[[email protected] ~]# dmsetup ls | grep mpath| sort
mpathb  (253:4)
mpathc  (253:2)
mpathd  (253:3)
mpathe  (253:5)
mpathf  (253:6)
mpathg  (253:8)
mpathh  (253:9)
mpathi  (253:7)
mpathj  (253:15)
mpathk  (253:10)
mpathl  (253:11)
mpathm  (253:13)
mpathn  (253:14)
mpatho  (253:12)

2、编辑文件/etc/udev/rules.d/12-dm-permissions.rules,显示配置磁盘的属组为grid:asmadmin。据文档描述,该文档的模板存在于/usr/share/doc/device-mapper-{version}/12-dm-permissions.rules。增加如下片段

ENV{DM_NAME}=="mpathb",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathc",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathd",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathe",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathf",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathg",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathh",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathi",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathj",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathk",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathl",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathm",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpathn",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"
ENV{DM_NAME}=="mpatho",OWNER:="grid",GROUP:="asmadmin",MODE:="660",SYMLINK+="mapper/$env{DM_NAME}"

3、重启服务或刷新重载,Any way you like。

4、Restart the GI Installation Session。

时间: 2024-10-13 12:41:42

How To: set udev rule for setting the disk permission on ASM disks when using multipath on Linux 6.x的相关文章

通过udev创建ASM共享磁盘(RAC)

OS:RedHat EL6.0 Oracle:   Oracle 11gR2 在Oracle 11gR2,构建RAC时可以通过ASM创建asm disk,但是需要安装asmlib相关软件:对于RedHat EL6.0,Oracle的asm不能很好的支持,所以可以通过udev来创建asm disk,就不需要安装asmlib相关软件. 一.查看系统环境 内核版本: [[email protected] rules.d]# uname -a Linux rac01 2.6.32-642.6.2.el6

Vagrant入门

vagrant工具的使用介绍 一.认识Vagrant 1.1 什么是vagrant? 1)Vagrant是一款用来构建虚拟开发环境的工具 官网地址:https://www.vagrantup.com box下载:http://www.vagrantbox.es 2)基于ruby开发 3)默认使用Oracle virtualbox作为虚拟化工具,需要打开机器的虚拟机支持 解决:进入BIOS开启VT虚拟化 1.2 vagrant常用命令 # vagrant box add {title} {url}

UDEV SCSI Rules Configuration for ASM in Oracle Linux 5 and 6

UDEV SCSI Rules Configuration for ASM in Oracle Linux 5 and 6 For Oracle Automatic Storage Manager (ASM) to use disks, it needs to be able to identify the devices consistently and for them to have the correct ownership and permissions. In Linux you c

[原]ubuntu14.04 网卡逻辑修改没有文件/etc/udev/rules.d/70-persistent-net.rules

-----问题出现------ 在新装的ubuntu14.04系统中没有发现文件/etc/udev/rule.d/70-persistent-net.rules, 无法修改网络的逻辑名称(即把第一张网卡的名字改为改为eth0,第二张网卡的名字改为eth0) ----------思路----- 1.由于未发现有/etc/udev/rule.d/70-persistent-net.rules文件,重启:重启后也未发现此文件 2.手动执行/lib/udev/write_net_rules;提示缺少变量

CENTOS 7 udev:renamed network interface eth0 to eth1 eno16777736

将这个/etc/udev/rules.d/70-persistent-net.rules删除,重启,网卡eth0成功启动,并重新生成/etc/udev/rules.d/70-persistent-net.rules文件. [[email protected] rules.d]# cat 70-persistent-ipoib.rules # This is a sample udev rules file that demonstrates how to get udev to # set th

使用 udev 高效、动态地管理 Linux 设备文件

概述: Linux 用户常常会很难鉴别同一类型的设备名,比如 eth0, eth1, sda, sdb 等等.通过观察这些设备的内核设备名称,用户通常能知道这些是什么类型的设备,但是不知道哪一个设备是他们想要的.例如,在一个充斥着本地磁盘和光纤磁盘的设备名清单 (/dev/sd*) 中,用户无法找到一个序列号为"35000c50000a7ef67"的磁盘.在这种情况下,udev 就能动态地在 /dev目录里产生自己想要的.标识性强的设备文件或者设备链接,以此帮助用户方便快捷地找到所需的

Linux6.6及以上版本配置oracle-ASM共享储存-UDEV

在linux6.6版本之前,我们又两种方式可以配置asm共享磁盘,一种是安装asm驱动包进行asm磁盘组配置,另一种是UDEV通过识别共享存储UUID号进行asm磁盘组配置. 但在linux6.6之后,厂家不再提供asm驱动包,只能通过UDEV方式进行配置,下面我们就来看下用UDEV配置的步骤: 操作系统:centos linux 6.6 共享储存:hda映射的emcpower裸设备 首先,我们先到UDEV路劲下将服务开启,再用命令输出这些裸设备的UUID号,UUID可以理解为盘符的一个序列号.

udev的简单用法举例

udev是kernel2.6中针对设备管理产生的新方式,udev可以通过sysfs下的/sys目录找到设备的相关信息,因此不需要事先把所有可能用到的设备文件在/dev中创建,而是动态灵活的支持热插拔功能,自动创建相关设备的设备文件,非常有弹性. udev中的配置文件在/etc/udev/下,其中rule.d/目录里面是具体的规则文件(待会会重点讲解规则的书写),udev.conf是udev全局配置文件. 当用vim打开udev.conf文件的时候,会发现里面只有一条关于udev的log等级的内容

udev和rules使用规则

本文以通俗的方法阐述 udev 及相关术语的概念.udev 的配置文件和规则文件,然后以 Red Hat Enterprise Server 为平台演示一些管理设备文件和查询设备信息的实例.本文会使那些需要高效地.方便地管理 Linux 设备的用户受益匪浅,这些用户包括 Linux 最终用户.设备驱动开发人员.设备测试人员和系统管理员等等. 概述: Linux 用户常常会很难鉴别同一类型的设备名,比如 eth0, eth1, sda, sdb 等等.通过观察这些设备的内核设备名称,用户通常能知道