有谁知道为什么a)文件系统完全被修改和b)为什么每次我检查时都会发生这种情况,而不仅仅是在出现错误的情况下(如坏块)?
这是输出:
linux-Box# fsck.ext3 -c /dev/sdx1 e2fsck 1.40.2 (12-Jul-2007) Checking for bad blocks (read-only test): done Pass 1: Checking inodes,blocks,and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Volume (/dev/sdx1): ***** FILE SYSTEM WAS MODIFIED ***** Volume (/dev/sdx1): 5132/245760 files (1.2% non-contiguous),178910/1959896 blocks
解决方法
-c
This option causes e2fsck to run the badblocks(8) program to find any blocks which are bad on the filesystem,and then marks them as bad by adding them to the bad block inode. If this option is specified twice,then the bad block scan will be done using a non-destructive read-write test.
因此-c选项写入文件系统,fsck将其解释为“纠正错误”,因此返回码为1(“文件系统错误已更正”)
…所以,你问,为什么当你指定-n时它会返回1,哪个应该以只读方式打开文件系统并且不做任何修改?
好了,进一步阅读该联机帮助页也显示了答案:
-n
Open the filesystem read-only,and assume an answer of `no’ to all questions. Allows e2fsck to be used non-interactively. (Note: if the -c,-l,or -L options are specified in addition to the -n option,then the filesystem will be opened read-write,to permit the bad-blocks list to be updated. However,no other changes will be made to the filesystem.)
(换句话说:-n是谎言!)
这个答案完全由the manpage for fsck.ext3
带给你.