Oracle ASM 在 Solaris 上添加磁盘报错 SVR4 Error 5: I/O error 排查实录
环境:Oracle 11g RAC + ASM,Solaris 10/11
场景:从存储阵列映射新 LUN 后,ASM 中执行ALTER DISKGROUP ... ADD DISK失败
一、问题现象
在 ASM 实例中执行添加磁盘命令:
alter diskgroup data_dg add disk '/dev/rdsk/cxdxsx' rebalance power 9;
报错信息如下:
ORA-15032: not all alterations performed
ORA-15031: disk specification '/dev/rdsk/cxdxsx' matches no disks
ORA-15025: could not open disk "/dev/rdsk/cxdxsx"
ORA-27041: unable to open file
SVR4 Error: 5: I/O error
Additional information: xx
Additional information: xx
Additional information: xxxxxxxxx
在 OS 层面,设备文件已存在且权限正确:
$ ls -Ll /dev/rdsk/*sx
crw-rw---- 1 grid asmadmin 281, 70 Aug 2 16:17 cxdxsx
二、错误逐层拆解
这条错误链是从 OS 内核一路"冒泡"到 SQL 层的:
| 错误码 | 含义 | 谁报的 |
|---|---|---|
| ORA-15031 | 磁盘规格匹配不到任何磁盘 | ASM |
| ORA-15025 | 无法打开该磁盘 | ASM |
| ORA-27041 | 无法打开文件 | Oracle 通用 I/O 层 |
| SVR4 Error 5 | I/O 错误(errno = EIO) | Solaris 内核 |
核心结论:SVR4 Error 5 不是 Oracle/ASM 的逻辑错误,而是 Solaris 内核在 open() 设备文件时,底层 I/O 请求失败后返回的标准 UNIX 错误码。
关于
Additional information: xx/xx/xxxxxxxxxx:这是 Oracle 内部诊断码(操作类型、打开标志、内存地址),对日常排查无直接意义。
三、排查思路与常见原因
SVR4 Error 5 在 Solaris + ASM 场景下,常见根因包括:
- 磁盘头脏数据 — 磁盘残留旧 ASM 头或文件系统超级块
- 磁盘被占用 — 已被 ZFS、SVM、VxVM 或文件系统锁定
- 硬件/链路故障 — 存储阵列 LUN 离线、多路径异常
- 磁盘无 VTOC 标签 — Solaris 特有! 新盘未写 Label,slice 无法定位
因为是新建的盘,且其他盘是正常运行,以上的1、2、3这3中情况可以暂时先排除。再结合官方文档《ASM is not Discovering Disks on Solaris: ORA-15025 ORA-27041 SVR4 Error: 5: I/O error. KB149842》中的内容,先检查磁盘是否有 VTOC 标签。
四、根因定位
执行 format 命令查看磁盘状态:
$ format
选择磁盘 cxdx 后,系统提示:
[disk formatted]
Disk not labeled, Label it now? yes
真相大白:存储阵列映射过来的新 LUN,虽然在 /dev/rdsk/ 下生成了 cxdxsx 这样的设备文件,但磁盘本身没有 VTOC(Volume Table of Contents)标签。
Solaris 的磁盘访问层级是:
物理磁盘 (c1d8)
↓
VTOC 标签(分区表 / Slice 定义)
↓
Slice 切片(s0 ~ s7)
↓
设备文件(/dev/rdsk/cxdxsx)
没有 VTOC 标签,内核就不知道 sx 这个切片对应磁盘的哪个柱面、多大范围。此时任何进程(包括 ASM)尝试 open() 或读写该 slice,Solaris 都会直接返回 SVR4 Error 5: I/O error。
写 Label 后,直接回到 ASM 重试:
alter diskgroup data_dg add disk '/dev/rdsk/cxdxsx' rebalance power 9;
命令成功执行,磁盘顺利加入 Disk Group。
五、一句话总结
Solaris 上新 LUN 映射后,ASM 报
SVR4 Error 5,先检查format里有没有写 VTOC Label —— 没 Label,slice 就是"假设备",内核不认,ASM 自然打不开。
9135

被折叠的 条评论
为什么被折叠?



