在启动的机器上运行fsck会在根文件系统上产生错误。 为了解决这个问题,我从LiveCD启动 – 但LiveCD实例上的fsck根本找不到任何错误。 我也尝试运行相同的二进制引导系统将与 – 相同的结果0错误。
这里发生了什么? 如何解决报告的错误? (见下文)
该机器是一个无头的Ubuntu 14.04,而LiveCD则来自Ubuntu 14.04桌面版。
当我跑步时:
fsck -v -n /dev/mapper/lvm-root -f
答复是:
fsck from util-linux 2.20.1 e2fsck 1.42.9 (4-Feb-2014) Warning! /dev/mapper/lvm-root is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. 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 Block bitmap differences: -(24598720--24598781) +(42616517--42616542) -(47432723--47432748) +(49925184--49925211) +(49925312--49925373) Fix? no Free blocks count wrong for group #750 (22700, counted=22638). Fix? no Free blocks count wrong for group #1300 (13150, counted=13176). Fix? no Free blocks count wrong for group #1447 (24124, counted=24098). Fix? no Free blocks count wrong for group #1523 (32016, counted=32106). Fix? no Free blocks count wrong (30301182, counted=30319341). Fix? no Inode bitmap differences: -11927698 +11927700 Fix? no Free inodes count wrong (15762199, counted=15762204). Fix? no /dev/mapper/lvm-root: ********** WARNING: Filesystem still has errors ********** 130281 inodes used (0.82%, out of 15892480) 1113 non-contiguous files (0.9%) 112 non-contiguous directories (0.1%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 121424/640 33268738 blocks used (52.33%, out of 63569920) 0 bad blocks 3 large files 101907 regular files 19700 directories 2 character device files 0 block device files 2 fifos 22 links 8624 symbolic links (8166 fast symbolic links) 32 sockets ------------ 130289 files
为了解决这个问题,我从Ubuntu 14.04 LiveCD启动并运行相同的命令:
root@ubuntu:~# fsck -n -v /dev/mapper/lvm-root -f fsck from util-linux 2.20.1 e2fsck 1.42.9 (4-Feb-2014) Warning! /dev/mapper/lvm-root is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. 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 130281 inodes used (0.82%, out of 15892480) 1114 non-contiguous files (0.9%) 112 non-contiguous directories (0.1%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 121429/640 33268738 blocks used (52.33%, out of 63569920) 0 bad blocks 3 large files 101908 regular files 19704 directories 2 character device files 0 block device files 2 fifos 22 links 8625 symbolic links (8167 fast symbolic links) 31 sockets ------------ 130294 files
没有错误,我发现奇怪。 所以我试图挂载根分区,然后手动运行位于/ sbin / fsck下的fsck:
root@ubuntu:~# /mnt/sbin/fsck -n -v /dev/mapper/lvm-root -f fsck from util-linux 2.20.1 e2fsck 1.42.9 (4-Feb-2014) Warning! /dev/mapper/lvm-root is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. 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 130281 inodes used (0.82%, out of 15892480) 1114 non-contiguous files (0.9%) 112 non-contiguous directories (0.1%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 121429/640 33268738 blocks used (52.33%, out of 63569920) 0 bad blocks 3 large files 101908 regular files 19704 directories 2 character device files 0 block device files 2 fifos 22 links 8625 symbolic links (8167 fast symbolic links) 31 sockets ------------ 130294 files
在挂载的文件系统上运行fsck将显示如果在此刻closures系统时将发生的相同错误; 磁盘上的状态不一致,因为更新已被caching在内存中,尚未写入磁盘。 因此不要做这个!
只在未安装的文件系统上运行fsck。 即使在只读挂载的文件系统上,如果fsck修复了问题,而且内核不知道它,也会发生问题。