我创建了这样一个文件系统:
dd if=/dev/zero of=disk-image count=40960创建文件系统的方法如下:
/sbin/mkfs -t ext3 -q disk-image然后,我挂载并复制了一些测试文件,然后卸载如下:
mount -o loop disk.image foo
cp "something" foo
sudo umount foo然后运行一个e2fsck -c -c disk-image,它返回
"Pass 1: Checking inodes, blocks, and sizes
Inode 185, i_size is 16384, should be 17408. Fix<y>? yes 我的问题,因为这是一个文件,而不是一个块设备,是上述警告,我应该担心的事情。
如何对文件中的文件系统执行fsck?
发布于 2012-06-12 23:14:31
您只需运行e2fsck并指定图像文件,就像块设备一样。我不知道为什么要使用-c选项(这会检查坏块)。
% e2fsck -f ext3.img
e2fsck 1.42 (29-Nov-2011)
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
ext3.img: 11/25688 files (0.0% non-contiguous), 8913/102400 blockshttps://serverfault.com/questions/398109
复制相似问题