linux – fsck文件中的文件系统

我创建了一个像这样的文件系统:
dd if=/dev/zero of=disk-image count=40960

使用以下方法创建filesystem

/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?

解决方法

您只需运行e2fsck并指定映像文件,就像使用块设备一样.我不确定你为什么使用-c选项(这会检查badblocks).
% e2fsck -f ext3.img
e2fsck 1.42 (29-Nov-2011)
Pass 1: Checking inodes,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 blocks

相关文章

insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...