ocfs+multipath iscsi 使用问题记录

93 阅读2分钟

1.挂载目录后无法umount

umount /mnt/share-storage/test umount: /mnt/share-storage/test: target is busy. (参考:www.cnblogs.com/ding2016/p/… 方案: fuser -mv /mnt/share-storage/test 找到对应占用的进程,杀掉除mount 之外的其他用户进程

2.磁盘心跳信息残留问题

在特权容器pod中执行 多路径设备格式化和挂载,一切正常,在容器中执行卸载时,命令执行成功,但是dmesg -T -w 看到有如下报错:

ocfs2: Error -2 running user helper "/sbin/ocfs2_hb_ctl -K -u 65FD3BB0733B413B834F3E0F75181A57"

格式化和挂载过程:

mkfs.ocfs2 -F  -b 4K -C 1M -N 32 -J block64 -T vmstore --cluster-stack=o2cb --fs-feature-level=max-features --cluster-name ocfs2  /dev/mapper/366c34911004096be4327bc3600000a57

mkdir -p /mnt/share-storage/pool1204

mount -t ocfs2 -o noatime -o nodiratime -o _netdev /dev/mapper/366c34911004096be4327bc3600000a57 /mnt/share-storage/pool1204

#卸载 (卸载成功,dmesg 看到有报错信息)
# ocfs2: Error -2 running user helper "/sbin/ocfs2_hb_ctl -K -u 65FD3BB0733B413B834F3E0F75181A57"

umount /mnt/share-storage/pool1204    

异常现象: mounted.ocfs2 -d 看ocfs设备信息 ps -axu |grep o2hb发现磁盘心跳进程残留,正常情况下磁盘卸载会清理该进程:

image.png

image.png

问题原因: 内核同事查看ocfs源码,卸载时,会从内核态触发一个进程去关闭心跳线程,现在特权容器pod中执行卸载时,执行失败,导致心跳线程未正常退出

解决方案: 宿主机上安装ocfs工具包,保证/sbin/ocfs2_hb_ctl 在宿主机上存在

dnf install ocfs2-tools #安装工具包 dnf remove ocfs2-tools #卸载工具包