You Asked: What Does Fsck Do in Linux?

You Asked: What Does Fsck Do in Linux?
Contents

The system utility fsck (file system consistency check) is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD.

How does fsck work in Linux?

fsck computes the number of data blocks and compares that block count against the number of blocks the inode claims. If an inode contains an incorrect count, fsck prompts you to fix it. Each inode contains a 64-bit size field.

Why is fsck needed?

fsck’s only role is to ensure metadata consistency, so it is redundant to run fsck simply because the filesystem wasn’t properly unmounted. A journaling filesystem can get corrupted for other reasons, though – hardware failure, driver bugs, admin errors, etc. – so fsck tools are certainly necessary.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.