asm 初始化创建ASM磁盘组 失败[root@dga01 ~]# oracleasm createdisk OCR /dev/sde1Writing disk header: doneInstantiating disk: failedClearing disk header: done开始以为是asm配置错误,于是重新初始化ASM[root@dga01 ~]# /etc/init.d/oracleasm configure -iConfiguring the Oracle ASM library driver.This will configure the on-boot properties of the Oracle ASM librarydriver. The following questions will determine whether the driver isloaded on boot and what permissions it will have. The current valueswill be shown in brackets ('[]'). Hittingwithout typing ananswer will keep that current value. Ctrl-C will abort.Default user to own the driver interface [grid]: gridDefault group to own the driver interface [asmadmin]: asmadminStart Oracle ASM library driver on boot (y/n) [y]: yScan for Oracle ASM disks on boot (y/n) [y]: yWriting Oracle ASM library driver configuration: doneInitializing the Oracle ASMLib driver: [ OK ]Scanning the system for Oracle ASMLib disks: [ OK ][root@dga01 ~]# /usr/sbin/oracleasm init但是 重新初始化后创建ASM磁盘组 依然失败[root@dga01 ~]# oracleasm createdisk OCR /dev/sde1Writing disk header: doneInstantiating disk: failedClearing disk header: done[root@dga01 ~]# /usr/sbin/oracleasm createdisk OCR /dev/sde1Writing disk header: doneInstantiating disk: failedClearing disk header: done通过linux提供的 dmesg 和 strace 来定位问题[root@dga01 ~]# dmesg sd 2:0:1:0: [sdb] Cache data unavailablesd 2:0:1:0: [sdb] Assuming drive cache: write throughsd 2:0:1:0: [sdb] Attached SCSI disksd 3:0:0:0: [sde] Cache data unavailablesd 3:0:0:0: [sde] Assuming drive cache: write throughsd 3:0:0:0: [sde] Attached SCSI disksd 2:0:3:0: [sdd] Cache data unavailablesd 2:0:3:0: [sdd] Assuming drive cache: write throughsd 2:0:3:0: [sdd] Attached SCSI diskEXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)dracut: Mounted root filesystem /dev/sda3dracut: Loading SELinux policytype=1404 audit(1363446394.257:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295SELinux: 2048 avtab hash slots, 250819 rules.SELinux: 2048 avtab hash slots, 250819 rules.SELinux: 9 users, 12 roles, 3762 types, 187 bools, 1 sens, 1024 catsSELinux: 81 classes, 250819 rulesSELinux: Permission audit_access in class file not defined in policy.SELinux: Permission audit_access in class dir not defined in policy.SELinux: Permission execmod in class dir not defined in policy.SELinux: Permission audit_access in class lnk_file not defined in policy.SELinux: Permission open in class lnk_file not defined in policy.SELinux: Permission execmod in class lnk_file not defined in policy.SELinux: Permission audit_access in class chr_file not defined in policy.SELinux: Permission audit_access in class blk_file not defined in policy.SELinux: Permission execmod in class blk_file not defined in policy.SELinux: Permission audit_access in class sock_file not defined in policy.SELinux: Permission execmod in class sock_file not defined in policy.SELinux: Permission audit_access in class fifo_file not defined in policy.SELinux: Permission execmod in class fifo_file not defined in policy.SELinux: Permission syslog in class capability2 not defined in policy.SELinux: the above unknown classes and permissions will be allowed[root@dga01 ~]# strace -f -o asm.out /usr/sbin/oracleasm createdisk OCR /dev/sde13714 brk(0) = 0x16770003714 brk(0x1698000) = 0x16980003714 stat("/dev/sde1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 03714 open("/dev/sde1", O_RDWR) = 43714 fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 03714 fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 03714 mknod("/dev/oracleasm/disks/OCR", S_IFBLK|0600, makedev(8, 65)) = -1 EACCES (Permission denied)3714 write(2, "oracleasm-instantiate-disk: ", 28) = 283714 write(2, "Unable to create ASM disk \"OCR\":"..., 51) = 513714 close(4) 日志中多次提到selinux 和 3714 mknod("/dev/oracleasm/disks/OCR", S_IFBLK|0600, makedev(8, 65)) = -1 EACCES (Permission denied)问题可能出在selinux或者防火墙上,查看selinux和防火墙状态[root@dga01 ~]# iptables -LChain INPUT (policy ACCEPT)target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT)target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT)target prot opt source destination [root@dga01 ~]# getenforce Enforcingiptables 与selinux均为开启 ,尝试关闭着两个服务关闭linux 防火墙[root@dga01 ~]# iptables -F[root@dga01 ~]# service iptables stopiptables: Flushing firewall rules: [ OK ]iptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Unloading modules: [ OK ][root@dga01 log]# chkconfig iptables off关闭selinux 服务[root@dga01 ~]# setenforce 0编辑selinux配置文件修改 为SELINUX=disabled[root@dga01 ~]# vim /etc/selinux/config # This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted再次查看linux防火墙与selinux服务[root@dga01 ~]# iptables -LChain INPUT (policy ACCEPT)target prot opt source destination Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destination [root@dga01 log]# getenforce Permissive重新创建ASM磁盘组,顺利完成[root@dga01 ~]# oracleasm createdisk OCR /dev/sde1Writing disk header: doneInstantiating disk: done