4

I have been trying to find out fsck code. I cannot find it in the coreutils package in Ubuntu. Could someone please let me know, where I would be able to take a look at the fsck code?

Reporter
  • 3,897
  • 5
  • 33
  • 47
Shehbaz Jaffer
  • 1,944
  • 8
  • 23
  • 30

2 Answers2

5

fsck has several implementations depending on used file system. For ext2/ext3/ext4 you need "e2fsprogs" package in Ubuntu.

Try:

sudo apt-get source e2fsprogs
1

fsck utility is a part of "util-linux" package. The sources of "util-linux" can be downloaded from https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/

fsck calls specific utility dependent on fs type: fsck.minix, fsck.ext4, fsck.nfs, fsck.exfat, fsck.ext4dev, fsck.cramfs, fsck.ext3, fsck.fat, fsck.vfat, fsck.msdos, fsck.ext2.

e2fsprogs package includes fsck.ext2, fsck.ext3, fsck.ext4 and multi-utility fsck. If fsck checks vfat fs and fsck.vfat is not presented in system, fsck can not work.

dosfs package includes fsck.fat and symlinks: fsck.msdos and fsck.vfat to fsck.fat

SerNik89
  • 11
  • 3
  • 1
    It might be better to point to the git repository https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/ – kvantour May 07 '20 at 12:00