简单记录一则在Linux平台上创建ASM磁盘时遭遇:
Device “/dev/sdf1” is already labeled for ASM disk “”
的错误!
1 故障现象:
[root@node1 ~]# /usr/sbin/oracleasm listdisks ASMDISK1 ASMDISK2 [root@node1 ~]# /usr/sbin/oracleasm createdisk asmdisk3 /dev/sdf1 Device "/dev/sdf1" is already labeled for ASM disk "" [root@node1 ~]# ll /dev/oracleasm/disks/ total 0 brw-rw---- 1 oracle oinstall 8, 49 Dec 25 16:53 ASMDISK1 brw-rw---- 1 oracle oinstall 8, 65 Dec 25 16:53 ASMDISK2 [root@node1 ~]#
2 故障处理:
通过查看/etc/blkid/blkid.tab文件,确实看到设备/dev/sdf1已经是一块ASM磁盘,只是ASM卷标为空。
[root@node1 ~]# cat /etc/blkid/blkid.tab/dev/sda2 /dev/sda1 /dev/cdrom /dev/hdc /dev/sde1 /dev/sdd1 /dev/sdf1 [root@node1 ~]#
通过/usr/sbin/oracleasm renamedisk命令来重命名磁盘:
[root@node1 ~]# /usr/sbin/oracleasm renamedisk -f /dev/sdf1 asmdisk3 Writing disk header: done Instantiating disk "ASMDISK3": done [root@node1 ~]# /usr/sbin/oracleasm listdisks ASMDISK1 ASMDISK2 ASMDISK3 [root@node1 ~]# ll /dev/oracleasm/disks/ total 0 brw-rw---- 1 oracle oinstall 8, 49 Dec 25 16:53 ASMDISK1 brw-rw---- 1 oracle oinstall 8, 65 Dec 25 16:53 ASMDISK2 brw-rw---- 1 oracle oinstall 8, 81 Dec 25 17:16 ASMDISK3 [root@node1 ~]#
且,重启操作系统之后:
[root@node1 ~]# cat /etc/blkid/blkid.tab/dev/sda2 /dev/sda1 /dev/cdrom /dev/hdc /dev/sdf1 /dev/sde1 /dev/sdd1 [root@node1 ~]#
3 故障原因:
之前,的确已经将设备/dev/sdf1创建成了ASM磁盘,然后,在操作系统级别将/dev/sdf硬盘的第1个分区sdf1直接删除后,重新创建了分区sdf1之后,再想将/dev/sdf1创建为ASM磁盘时,就遭遇到上述的错误信息!
4 如何避免:
正确的步骤,先通过/usr/sbin/oracleasm deletedisk命令来删除对应的ASM磁盘,然后在操作系统级别删除对应的硬盘分区,重新创建新分区之后,再在该硬盘分区上通过/usr/sbin/oracleasm createdisk命令创建ASM磁盘时,就不会出现上述错误了!