What’s the difference between e2fsck and fsck and which one I should use

fsck

I got this error message when running 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

sdd seems to be running fine. That's the main partition.
sda to sdc doesn't work. Should I umount and fo fsck? But which fsck I should use? e2fsck? e4fsck? Which one? I am using ext4 here.

I have no idea what loop0 is.

Looks like the system is pretty badly set up.
EXT3-fs (loop0): mounted filesystem with ordered data mode

I've heard I can do shutdown -rf . Someone have done that. The system is back online but I still got this message. What gives?

Best Answer

fsck is the original name for this tool. When new file systems came out they would need specific tools for each one. So fsck just acts as a frontend and will call the appropriate filesystem *fsck for operations that it's not able to do itself.

excerpt from the fsck man page

fs-specific-options

    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.

Most of the normal operations can be handled just by fsck.

other tools?

A quick look on my Fedora 14 system shows the following fsck* tools:

$ fsck
fsck          fsck.ext2     fsck.ext4     fsck.msdos    fsck.vfat     
fsck.cramfs   fsck.ext3     fsck.ext4dev  fsck.ntfs     fsck.xfs

This locate command shows even more:

$ 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

Between the 2 listings you can see that pretty much every file system type has its own fsck* tool. A few of the tools are multi-purpose such as 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

References

Related Question