我们想在 /dev/sdc 上执行 fsck -f 但没有成功
umount -l /var/hadoop/zookeper
lsof /var/hadoop/zookeeper/
fsck -f /dev/sdc
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
/dev/sdc is in use.
e2fsck: Cannot continue, aborting.
怎么可能
磁盘未安装,从 lsof 我们没有得到任何东西
那么为什么我们得到 /dev/sdc 正在使用中。 ??
fsck -nf /dev/sdc
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
Warning! /dev/sdc is in use.
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
Free blocks count wrong (4206042, counted=4212201).
Fix? no
Free inodes count wrong (1310644, counted=1310641).
Fix? no
/dev/sdc: 76/1310720 files (55.3% non-contiguous), 1036838/5242880 blocks
。
fsck -pvcf /dev/sdc
fsck from util-linux 2.23.2
/dev/sdc is in use.
e2fsck: Cannot continue, aborting
答案1
问题是 jbd2 内核线程。例如:
# lsof | grep sdc
jbd2/sdc- 261 root cwd DIR 8,0 4096 2 /
jbd2/sdc- 261 root rtd DIR 8,0 4096 2 /
jbd2/sdc- 261 root txt unknown /proc/261/exe
您可以做的就是从 fstab 中删除该磁盘,这样它就永远不会被安装。重启。那么这些内核线程将永远不会启动。