Centos – ny difference between e2fsck and e4fsck on CentOS / RHEL systems

centosext4fsckrhel

ext4.wiki.kernel.org makes it sound like e2fsck was simply renamed to e4fsck so that e4fsprogs and e2fsprogs could coexist without overlapping. However, there is no mention of any difference in the code of the command.

The e2fsck man page makes no mention of ext4, but does mention that it works with ext3 (i.e. ext2 with journaling turned on).

For Ubuntu, apparently e2fsck can handle ext2, 3 and 4 filesystems.

And of course there's good ol' vanilla fsck which itself makes no mention of ext4.

If I need to fsck an ext4 file system on a RHEL based system, which tool do I use? e4fsck? But if it's just a rename of e2fsck, can I just use that instead? Why does Ubuntu mention ext4 in its e2fsck man page but no one else seems to? And what about plain fsck on ext4?

EDIT:

On a Fedora 14 machine there is fsck.ext4, fsck.ext3 and fsck.ext2 in /sbin/. They all have the exact same file size. Curioser and Curioser.

EDIT 2:

Furthermore, when running fsck.ext4, you see that it appears to be e2fsck running. For example, I see this line when running fsck.ext4: e2fsck: aborted Tricksters!

Best Answer

e4fsprogs on RHEL5 is just a newer version of e2fsprogs. Red Hat has a policy of not upgrading to newer, binary-incompatible versions of things, so they "had to" stay on the old e2fsprogs they were using, and the solution they came up with to support ext4 was to introduce the newer version as e4fsprogs (with s/2/4/ on all of the command names). To make matters worse, ext4 support on RHEL 5 is technically a "technology preview".

I understand why they did it, but it is annoying, since you won't find e4fs* on any other distribution, including RHEL 6.

Related Question