加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – fsck文件中的文件系统

发布时间:2020-12-13 17:08:49 所属栏目:Linux 来源:网络整理
导读:我创建了一个像这样的文件系统: dd if=/dev/zero of=disk-image count=40960 使用以下方法创建filesystem: /sbin/mkfs -t ext3 -q disk-image 然后我挂载并复制了一些测试文件并卸载如下: mount -o loop disk.image foocp "something" foosudo umount foo
我创建了一个像这样的文件系统:
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读