在EL/RH 5 ORACLEASM LISTDISKS 重启程序或系统后无法显示设备
适用于:
Linux Kernel - Version: 2.0.3.1
Linux Kernel - Version: 2.6.18 to 2.6.18
Linux x86-64
症状:
/etc/init.d/oracleasm listdisks在DM -* / LVM设备上工作,直到重新启动/重新启动。下面是重现的行动序列:
1。环境
#uname -a
Linux host 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 GNU/Linux
#rpm -qa grep oracleasm
oracleasm-support-2.0.4-1.el5
oracleasm-2.6.18-53.el5-2.0.4-1.el5
oracleasmlib-2.0.3-1.el5
2。创建磁盘
[root@oel5a ~]#/etc/init.d/oracleasm createdisk DATA2 /dev/oraasm/oraasm-2
Marking disk "/dev/oraasm/oraasm-2" as an ASM disk: 'DATA2
[root@oel5a ~]#
[root@oel5a ~]# /etc/init.d/oracleasm listdisks
DATA2
VOL1
[root@oel5a ~]#
3.重启oracleasm服务后DATA2卷不见了。
[root@oel5a ~]# /etc/init.d/oracleasm restart
Unmounting ASMlib driver filesystem: [ OK ]
Unloading module "oracleasm": [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
[root@oel5a ~]# /etc/init.d/oracleasm listdisks
VOL1
[root@oel5a ~]#
[root@oel5a ~]# /sbin/blkid grep oracleasm
/dev/mapper/oraasm-oraasm-2: LABEL="DATA2" TYPE="oracleasm"
/dev/sdd1: LABEL="VOL1" TYPE="oracleasm"
[root@oel5a ~]#
[root@oel5a ~]# /etc/init.d/oracleasm querydisk /dev/oraasm/oraasm-2
Disk "/dev/oraasm/oraasm-2" is marked an ASM disk with the label "DATA2"
[root@oel5a ~]#
[root@oel5a ~]# more /proc/partitions
major minor #blocks name
.
253 0 6246400 dm-0
253 1 5644288 dm-1
[root@oel5a ~]# lvdisplay /dev/oraasm/oraasm-2
--- Logical volume ---
LV Name /dev/oraasm/oraasm-2
VG Name oraasm
LV UUID QzwLLd-DSc3-42aA-b3rb-d9T3-ImmH-P9z51D
LV Write Access read/write
LV Status available
# open 0
LV Size 5.38 GB
Current LE 1378
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
[root@oel5a ~]# ls -l /dev/dm*
ls: /dev/dm*: No such file or directory
[root@oel5a ~]#
原因
oracleasm扫描/proc/partitions,预计设备在/dev下。如果设备在/ dev目录中不存在,它将无法打开设备。 RHEL/OEL5不创建默认情况下,在/ dev的DM- XX设备。
解决方案
请在文件/ etc/udev/rules.d/50-udev.rules注释掉以下行
#KERNEL=="dm-[0-9]*", ACTION=="add", OPTIONS+="ignore_device"
重启之后这个问题应该被解决。
注意:更新的EL/RH 5 规则版本讲移动到"/etc/udev/rules.d/90-dm.rules".