如何处理 fsck“扫描 inode 时出错”?

如何处理 fsck“扫描 inode 时出错”?

我从可启动的 Ubuntu USB 驱动器进行了检查,然后运行

sudo fsck -y /dev/sda2

在计算机的主 Linux 分区上。输出类似于

...
Pass 1B:  Rescanning for multiply-claimed blocks
Error while scanning inodes (207...): Inode checksum does not match inode

/dev/sda2: **** FILE SYSTEM WAS MODIFIED ***
e2fsck: aborted

/dev/sda2: **** FILE SYSTEM WAS MODIFIED ***

退出代码:9

就是这样吗?或者有办法修复驱动器吗?

答案1

建议的命令

  • 首先,确保目标文件系统已被卸载。

  • 我通常使用以下命令行来检查/修复ext文件系统,

    sudo e2fsck -cf /dev/sdxn
    

    其中 x 是驱动器号,n 是分区号,因此在你的情况下

    sudo e2fsck -cf /dev/sda2
    

    除非设备顺序已经改变。

选项

   -c     This option causes e2fsck to use badblocks(8) program  to  do  a  read-only
          scan  of the device in order to find any bad blocks.  If any bad blocks are
          found, they are added to the bad block inode to  prevent  them  from  being
          allocated  to a file or directory.  If this option is specified twice, then
          the bad block scan will be done using a non-destructive read-write test.

   -f     Force checking even if the file system seems clean.

退出代码

   The exit code returned by e2fsck is the sum of the following conditions:
        0    - No errors
        1    - File system errors corrected
        2    - File system errors corrected, system should
               be rebooted
        4    - File system errors left uncorrected
        8    - Operational error
        16   - Usage or syntax error
        32   - E2fsck canceled by user request
        128  - Shared library error

因此,对于你的情况,9=8+1:Operational error并且File system errors corrected

下一步

如果重试时进程也中止,我不知道什么可以修复文件系统。备份可以备份的内容并创建一个新的文件系统。

驱动器可能有物理缺陷。您可以根据以下方法检查

FSCK 报告文件系统仍然有错误 - 我现在该怎么办?

相关内容