在 CentOS 5 上使用 fsck 修复 ext3 根文件系统的问题

在 CentOS 5 上使用 fsck 修复 ext3 根文件系统的问题

当我在 CentOS 5 服务器的已挂载根分区上运行只读 fsck 时,它发现了许多错误。但是,在下次启动时运行强制检查却没有发现任何错误!

以下是已安装的只读检查的结果:

# fsck -nCf /
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Warning!  /dev/sda3 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 232259589 has zero dtime.  Fix? no

Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 232259593 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -32194676 -(32235995--32235998) -(32236209--32236210) -(32238978--32238981) -(32239590--32239593) -(32239924--32239926) -(32241448--32241457) -(32245306--32245313) -32867401 -(36754088--36754097) +(143647672--143648620) -(143653816--143654764)
Fix? no

Free blocks count wrong for group #982 (1277, counted=1276).
Fix? no

Free blocks count wrong for group #983 (810, counted=777).
Fix? no

Free blocks count wrong for group #984 (19647, counted=19637).
Fix? no

Free blocks count wrong for group #1003 (28042, counted=28041).
Fix? no

Free blocks count wrong for group #1121 (11611, counted=11598).
Fix? no

Free blocks count wrong (227428348, counted=227427933).
Fix? no

Inode bitmap differences:  -232259589 -232259593
Fix? no

Free inodes count wrong (243391778, counted=243391739).
Fix? no


/: ********** WARNING: Filesystem still has errors **********

/: 205534/243597312 files (3.7% non-contiguous), 16161230/243589578 blocks

我进行强制检查的方式是:

touch /forcefsck
echo -n "-y" > /fsckoptions

这确实会强制 fsck 在下次启动时运行,并且“-y”选项应该会自动修复所有错误,但检查在启动过程中未发现任何错误。但是,一旦挂载文件系统并再次运行只读检查,它就会发现所有相同的错误。

谢谢你的时间,

催乳素

答案1

已安装的文件系统在磁盘上将不一致。不要检查已安装的文件系统。直接来自马口:“但是,即使这样做是安全的,如果文件系统已安装,e2fsck 打印的结果也是无效的。”-E2FSCK(8)

相关内容