我们想要检查磁盘上的文件系统为 /deb/sdc .... 每台 linux redhat 机器上的 /dev/sdg
目标是找到需要 e2fsck 的磁盘(如 e2fsck -y /dev/sdb 等)
根据手册页
-n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
the same time as the -p or -y options.
当我们运行命令时(仅示例)
e2fsck -n /dev/sdXX
我们得到
e2fsck 1.42.9 (28-Dec-2013)
Warning! /dev/sdc is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks
那么运行 e2fsck 需要从 e2fsck 输出中捕获什么?
e2fsck进程
init 1
umount /dev/sdXX
e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )
init 3
答案1
您可能正在寻找的输出tune2fs
而不是e2fsck
tune2fs -l /dev/sdXX |grep "Filesystem state\|Last checked\|Check interval"
应该会产生这样的结果:
Filesystem state: clean
Last checked: Mon Nov 28 16:03:44 2016
Check interval: 31536000 (12 months)