e2fsck 和 fsck 之间有什么区别,我应该使用哪一个?

use*_*951 3 fsck

运行 dmesg 时收到此错误消息

EXT3-fs (sdd1): using internal journal
EXT3-fs (sdd1): mounted filesystem with ordered data mode
EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts:
EXT4-fs (sdc1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts:
Adding 4194296k swap on /dev/sdd2.  Priority:-1 extents:1 across:4194296k SSD
kjournald starting.  Commit interval 5 seconds
EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
EXT3-fs (loop0): using internal journal
Run Code Online (Sandbox Code Playgroud)

sdd 似乎运行良好。那是主分区。sda 到 sdc 不起作用。我应该 umount 和 fo fsck 吗?但是我应该使用哪个 fsck?e2fsck?e4fsck?哪一个?我在这里使用 ext4。

我不知道 loop0 是什么。

看起来系统设置得很糟糕。EXT3-fs (loop0):以有序数据模式挂载的文件系统

我听说我可以执行 shutdown -rf 。有人这样做了。系统已重新上线,但我仍然收到此消息。是什么赋予了?

slm*_*slm 11

fsck是此工具的原始名称。当新的文件系统出现时,他们需要为每个文件系统提供特定的工具。因此,它fsck只是充当前端,并会调用适当的文件系统 *fsck 来执行它自己无法完成的操作。

摘自 fsck 手册页

fs 特定选项

    Options which are not understood by fsck are passed to the 
    filesystem-specific checker.  These arguments must  not
    take  arguments,  as  there is no way for fsck to be able to 
    properly guess which arguments take options and which don't.

    Options and arguments which follow the -- are treated as file 
    system-specific options to be  passed  to  the  file
    system-specific checker.

    Please note that fsck is not designed to pass arbitrarily 
    complicated options to filesystem-specific checkers.  If
    you're doing something complicated, please just execute the 
    filesystem-specific checker  directly.   If  you  pass
    fsck  some horribly complicated option and arguments, and it 
    doesn't do what you expect, don't bother reporting it
    as a bug.  You're almost certainly doing something that you 
    shouldn't be doing with fsck.
Run Code Online (Sandbox Code Playgroud)

大多数正常操作只需通过fsck.

其他工具?

快速浏览我的 Fedora 14 系统会显示以下 fsck* 工具:

$ fsck
fsck          fsck.ext2     fsck.ext4     fsck.msdos    fsck.vfat     
fsck.cramfs   fsck.ext3     fsck.ext4dev  fsck.ntfs     fsck.xfs
Run Code Online (Sandbox Code Playgroud)

locate命令显示更多:

$ locate fsck|grep "^/sbin"
/sbin/dosfsck
/sbin/e2fsck
/sbin/fsck
/sbin/fsck.cramfs
/sbin/fsck.ext2
/sbin/fsck.ext3
/sbin/fsck.ext4
/sbin/fsck.ext4dev
/sbin/fsck.msdos
/sbin/fsck.ntfs
/sbin/fsck.vfat
/sbin/fsck.xfs
Run Code Online (Sandbox Code Playgroud)

在这 2 个清单之间,您可以看到几乎每种文件系统类型都有自己的 fsck* 工具。一些工具是多用途的,例如dos2fsck

$ ls -l /sbin/|grep fsck | grep dos
-rwxr-xr-x  1 root root   54424 Apr  5  2011 dosfsck
lrwxrwxrwx  1 root root       7 Aug  3  2011 fsck.msdos -> dosfsck
lrwxrwxrwx  1 root root       7 Aug  3  2011 fsck.vfat -> dosfsck
Run Code Online (Sandbox Code Playgroud)

参考