上一次检查文件系统?


19

什么命令可以告诉我上一次对文件系统进行fsck操作?一个日期会很好,但自上次fsck以来,我已经决定接受安装计数。

我已经在fsck *,lsattr和stat中四处寻找,但没有看到。

Answers:



7

您可以使用tune2fs来获取信息

tune2fs -l /dev/devicetocheck | grep "Last Checked"

同样,您可以获得安装数量

tune2fs -l /dev/devicetocheck | grep "Mount Count"

7

除之外tune2fs -ldumpe2fs还将为您提供以下信息:

dumpe2fs /dev/sda1 | grep "Last Checked"
dumpe2fs /dev/sda1 | grep "Mount Count"

6

感谢大家!对于reiserfs,我发现它debugreiserfs显示了安装计数和上次fsck运行日期。


0

如果使用lvm

tune2fs -l /dev/sda5 | egrep -i "mount count|Check interval|Last|Next"

将失败:

tune2fs: Bad magic number in super-block while trying to open /dev/sda5

人们将不得不这样做:

tune2fs -l /dev/hostname-vg/root | egrep -i "mount count|Check interval|Last|Next"
Last mounted on:          /
Last mount time:          Wed Sep  4 17:45:12 2019
Last write time:          Wed Sep  4 17:45:10 2019
Mount count:              20
Maximum mount count:      -1
Last checked:             Fri Aug 30 16:09:19 2019
Check interval:           0 (<none>)
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.