Fsck
如果“fsck -n /PATH”顯示錯誤,那麼 FS 有錯誤是 100% 正確的嗎?
HOSTNAME:~ # fsck -n /FSMOUNTPOINT fsck 1.38 (30-Jun-2005) e2fsck 1.38 (30-Jun-2005) Warning! /dev/vgname/lvname is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. /dev/vgname/lvname contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Inode 12845121 ref count is 1, should be 2. Fix? no Inode 12845122 ref count is 1, should be 2. Fix? no Inode 12845123 ref count is 1, should be 2. Fix? no Inode 12845124 ref count is 1, should be 2. Fix? no Pass 5: Checking group summary information Free blocks count wrong (38829073, counted=37828469). Fix? no Free inodes count wrong (22658484, counted=22658235). Fix? no /dev/vgname/lvname: ********** WARNING: Filesystem still has errors ********** /dev/vgname/lvname: 16972/22675456 files (0.3% non-contiguous), 6521839/45350912 blocks fsck.ext3 /dev/vgname/lvname failed (status 0x4). Run manually! HOSTNAME:~ #
OS: SUSE LINUX Enterprise Server 9.4
FS:EXT3,只有 rw 選項
問題:所以如果有“警告:文件系統仍然有錯誤”消息,我可以 100% 確定 FS 有問題,需要 umount/fsck/mount’ed?
更新:
$ tune2fs -l /dev/vgname/lvname | grep 'Filesystem state:' Filesystem state: clean $
通常的建議是不要
fsck
在已安裝的文件系統上執行。您會得到不可靠的結果 - 在fsck
嘗試掃描文件系統時,核心仍在向其讀取和寫入數據,因此它會顯得fsck
不一致。一些文件系統允許線上使用fsck
,但不是全部 - 例如,FreeBSD 可以在使用 UFS2 文件系統時檢查它的靜態快照,但在掛載文件系統時您仍然不會檢查文件系統本身。檢查文件系統的最佳方法是解除安裝它,然後
fsck
在其上執行。如果仍然報告問題,您可以採取補救措施。