在一次服务器断电重启后,一台Centos7的服务器无法启动
随即进入vnc查看日志,错误如下:
XFS (vda1):metadata I/0 error
发现是xfs文件系统故障,想到使用 xfs_repair 工具进行修复
# 查看
ls -l /dev/vda1
# 修复
xfs_repair /dev/vda1
不料系统又抛出了一个异常
ERROR:The filesystem has valuable metadata changes in a log which needs to
be replayed.Mount the filesystem to replay the log,and unmount it before
re-ruming xfs_repair.If you are unable to mount the filesystem,then use
the -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption
--please attempt a mount
of the filesystem before doing this
貌似是日志文件影响了修复,但也说了,可以附加 -L 参数,销毁日志文件进行修复
# 再次尝试修复
xfs_repair -L /dev/vda1
# 等修复完成后重启
init 6
经过上述过程,完美解决开机