CentOS 挂载(mount)卡住是比较常见的问题,原因通常和存储端、网络、文件系统或内核状态有关。下面按常见场景给你梳理一下可能原因和排查思路。
这是 CentOS 挂载卡住的第一大原因。
可能原因:
hard 挂载,服务端无响应时客户端会一直重试典型表现:
mount -t nfs 192.168.1.10:/data /mnt
# 命令卡死,Ctrl+C 无效
排查:
ping 192.168.1.10
telnet 192.168.1.10 2049
showmount -e 192.168.1.10
dmesg | tail
建议:
soft 或加超时:mount -t nfs -o soft,timeo=30,retrans=3 192.168.1.10:/data /mnt
可能原因:
排查:
lsblk
dmesg | grep -i error
smartctl -a /dev/sdb
如果 dmesg 中有:
I/O error
task blocked for more than 120 seconds
说明是 存储层卡死。
可能原因:
fsck排查:
dmesg | grep xfs
dmesg | grep ext4
建议:
mountxfs_repair /dev/sdb1
# 或
fsck -y /dev/sdb1
如果之前挂载异常未清理:
ps aux | grep D
看到 D(不可中断睡眠)状态的 mount 或 bash
解决:
/etc/fstab 写错排查:
mount -a
dmesg -T | tail -50
ping 存储IP
telnet IP 端口
ps -eo pid,stat,cmd | grep D
mount | grep nfs
umount -l /mnt
soft 或 noauto如果你方便,可以告诉我:
mount 命令是什么?dmesg 或 ps 有没有异常?我可以直接帮你精准判断。