昨天和几个同事去一个用户现场解决不能对存储设备格式化成ocfs2的文件系统。
IBM的服务器,IBM的光纤交换机,IBM的存储。硬件方面应该不存在兼容性问题。系统是红旗的DC5.0。
刚到现场的时候,发现存储配置得有点问题,两台服务器看到的LUN并不一致,初步怀疑是配置问题,后来和用户协调,解决了这个问题。LUN的映射也达到了我们的要求,但是仍然是无法格式化ocfs2文件系统,只要格式化,并给出下面的报错信息
# mkfs.ocfs2 /dev/sdb1
mkfs.ocfs2 0.99.13-BETA14
Filesystem label=
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=21512568832 (656511 clusters) (5252088 blocks)
21 cluster groups (tail covers 11391 clusters, rest cover 32256 clusters)
Journal size=33554432
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: mkfs.ocfs2: Could not write: Input/output error
不过映射出来的LUN,却能格式化成ext3文件系统,使用dd命令也没有问题。 那么会不会是mkfs.ocfs2本身有问题了,我们开始测试本地设备和loop设备
#dd if=/dev/zero of=./a bs=1M count=500
[root@SGA-DC5 ~]# losetup /dev/loop1 ./a
[root@SGA-DC5 ~]# mkfs.ocfs2 /dev/loop1
mkfs.ocfs2 0.99.13-BETA14
Overwriting existing ocfs2 partition.
Filesystem label=
Block size=1024 (bits=10)
Cluster size=4096 (bits=12)
Volume size=104857600 (25600 clusters) (102400 blocks)
4 cluster groups (tail covers 2560 clusters, rest cover 7680 clusters)
Journal size=4194304
Initial number of node slots: 2
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing lost+found: done
mkfs.ocfs2 successful
这能说明mkfs.ocfs2本身没有问题吗?如果没有问题,难道于ocfs2的cluster配置有关?
那先测试一把吧,于是使用ocfs2console来重新配置cluster,再做测试。问题依然。
那这是什么原因呢?我们也从外围情况考虑了,比如主机名啦,LUN的重新映射啦,分区大小啦。都不能解决这个问题。
最后,我们抓取了mkfs.ocfs2的strace信息,如下:
File /Users/wgzhao/Sites/blog.wgzhao.com/source/downloads/code/mkfs_ocfs_trace could not be found
googling了一把,能找到较少的一些连接
Discussion Forums : RHEL 4, 10g and OCFS2 Installation
Discussion Forums : Formatting partition with ocfs2
不过都没有人提出解决方案。
谁有好的办法吗?