
부팅된 시스템에서 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
답변1
마운트된 파일 시스템에서 fsck를 실행하면 그 순간 시스템 전원을 끄면 발생하는 것과 동일한 오류가 표시됩니다. 업데이트가 메모리에 버퍼링되었지만 아직 디스크에 기록되지 않았기 때문에 디스크의 상태가 일관되지 않습니다. 따라서이러지 마세요!
마운트되지 않은 파일 시스템에서만 fsck를 실행하십시오. 읽기 전용으로 마운트된 파일 시스템에서도 fsck가 문제를 수정하고 커널이 이에 대해 알지 못하는 경우 문제가 발생할 수 있습니다.