![尽管我们执行 umount 并且 lsof 为空,但磁盘正在使用中](https://linux22.com/image/135182/%E5%B0%BD%E7%AE%A1%E6%88%91%E4%BB%AC%E6%89%A7%E8%A1%8C%20umount%20%E5%B9%B6%E4%B8%94%20lsof%20%E4%B8%BA%E7%A9%BA%EF%BC%8C%E4%BD%86%E7%A3%81%E7%9B%98%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E4%B8%AD.png)
我们想在 /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 中删除该磁盘,这样它就永远不会被安装。重启。那么这些内核线程将永远不会启动。