selinux 引起的 Instantiating disk: failed

asm 初始化创建ASM磁盘组 失败

[[email protected] ~]# oracleasm createdisk OCR /dev/sde1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done

开始以为是asm配置错误,于是重新初始化ASM

[[email protected] ~]# /etc/init.d/oracleasm   configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets (‘[]‘).  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [grid]: grid
Default group to own the driver interface [asmadmin]: asmadmin
Start Oracle ASM library driver on boot (y/n) [y]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

[[email protected] ~]# /usr/sbin/oracleasm  init

但是 重新初始化后创建ASM磁盘组 依然失败

[[email protected] ~]# oracleasm createdisk OCR /dev/sde1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[[email protected] ~]# /usr/sbin/oracleasm createdisk OCR /dev/sde1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done

通过linux提供的 dmesg 和 strace 来定位问题

[[email protected] ~]# dmesg 

sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sd 2:0:1:0: [sdb] Attached SCSI disk
sd 3:0:0:0: [sde] Cache data unavailable
sd 3:0:0:0: [sde] Assuming drive cache: write through
sd 3:0:0:0: [sde] Attached SCSI disk
sd 2:0:3:0: [sdd] Cache data unavailable
sd 2:0:3:0: [sdd] Assuming drive cache: write through
sd 2:0:3:0: [sdd] Attached SCSI disk
EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
dracut: Mounted root filesystem /dev/sda3
dracut: Loading SELinux policy
type=1404 audit(1363446394.257:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295
SELinux: 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 cats
SELinux:  81 classes, 250819 rules
SELinux:  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

[[email protected] ~]# strace  -f -o asm.out /usr/sbin/oracleasm createdisk OCR /dev/sde1

3714  brk(0)                            = 0x1677000
3714  brk(0x1698000)                    = 0x1698000
3714  stat("/dev/sde1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 0
3714  open("/dev/sde1", O_RDWR)         = 4
3714  fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 0
3714  fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 0
3714  mknod("/dev/oracleasm/disks/OCR", S_IFBLK|0600, makedev(8, 65)) = -1 EACCES (Permission denied)
3714  write(2, "oracleasm-instantiate-disk: ", 28) = 28
3714  write(2, "Unable to create ASM disk \"OCR\":"..., 51) = 51
3714  close(4)  

日志中多次提到selinux 和 3714  mknod("/dev/oracleasm/disks/OCR", S_IFBLK|0600, makedev(8, 65)) = -1 EACCES (Permission denied)

问题可能出在selinux或者防火墙上,查看selinux和防火墙状态

[[email protected] ~]# iptables -L
Chain 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         

  
[[email protected] ~]# getenforce 
Enforcing

iptables 与selinux均为开启 ,尝试关闭着两个服务

关闭linux 防火墙

[[email protected] ~]# iptables -F
[[email protected] ~]# service iptables stop
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
[[email protected] log]# chkconfig  iptables off

关闭selinux 服务
[[email protected] ~]# setenforce 0

编辑selinux配置文件修改 为SELINUX=disabled
[[email protected] ~]# 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服务

[[email protected] ~]# iptables -L
Chain 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 

[[email protected] log]# getenforce 
Permissive

重新创建ASM磁盘组,顺利完成

[[email protected] ~]# oracleasm createdisk OCR /dev/sde1
Writing disk header: done
Instantiating disk: done

selinux 引起的 Instantiating disk: failed

时间: 2024-08-08 05:35:06

selinux 引起的 Instantiating disk: failed的相关文章

LinuxCentOSamba7关闭SELinux重新启动失败出现:Failed to load SElinux policu freezing

login as: root[email protected]'s password:Last login: Tue Mar 6 03:31:31 2018 from 10.93.143.1[[email protected] ~]# more /etc/selinux/config # This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enf

ASMlib操作系统包安装与配置asm disk磁盘

1.加入6块硬盘,每块100g.不管是热加还是冷加.不管是加硬盘,用san存储划lun,或者再加上多路径,都是能够这么做的. 在操作系统层,能识别这种lun.以下的sdb就是一个刚划分的300g的lun(也就是硬盘.或者裸块设备). [[email protected] ~]# cd /dev [[email protected] dev]# ls -l | grep sd brw-r----- 1 root disk 8, 0 Apr 11 12:21 sda brw-r----- 1 roo

基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境

1.资源准备 最近,在VmwareStation 10虚拟机上,基于CentOS5.4安装Oracle 11g RAC,并把过程记录下来.刚开始时,是基于CentOS 6.4安装Oracle 11g RAC, 没有成功,主要是Oracle 11g RAC安装,没有针对CentOS 6.4的内核的一些包. 本文内容详实,包括安装过程中遇到的一些问题,也单独编一章节,第四章节的FAQ. http://blog.chinaunix.net/xmlrpc.php?r=blog/article&id=46

Oracle ASM -- disk header

我们知道asm是以au为分配单元,默认一个au为1m,那么disk header位于第一个au的第一个数据块上,而asm block编号是从0开始 下面通过kfed工具来了解asm diskheader内容 [[email protected] ~]# kfed read /dev/asm-diskb kfbh.endian:                          1 ; 0x000: 0x01 kfbh.hard:                          130 ; 0x

RAC_Oracle集群服务安装前期准备Prepare(案例)

2014-07-08 Created By BaoXinjian 一.摘要 [root@localhost ~]# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1

centos6.5 x86_64安装oracle 11.2.0.3grid

 1.安装前的准备 工作 1.1.配置node1 1.1.1.配置虚拟机并安装centos 安装node1----- 1.安装node1 1.1.加入30G的硬盘,1G内存,2个处理器,加入两个网卡NAT 1.2.设置主机名同一时候配置网络 node1.localdomain  192.168.0.3/255.255.255.0/192.168.0.1  eth0 node1-priv.localdomain  10.10.10.31/255.255.255.0/10.10.10.1 eth

asm createdisk时提示没有权限

[[email protected] Packages]# /etc/init.d/oracleasm createdisk asm1 /dev/sdg1Marking disk "asm1" as an ASM disk: [FAILED][[email protected] Packages]# /etc/init.d/oracleasm enable Writing Oracle ASM library driver configuration: doneInitializing

11gr2 rac 安装

1.服务进程[[email protected] ~]#sh rc.sh[[email protected] ~]# cat rc.shservice bluetooth stopservice netfs stopservice ip6tables stopchkconfig bluetooth offchkconfig ip6tables offchkconfig netfs offchkconfig kudzu offchkconfig nfs offchkconfig smartd of

oracle 11g RAC安装节点二执行结果错误CRS-5005: IP Address: 192.168.1.24 is already in use in the network

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oins