HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free and registered users see less advertising! If you just want to browse through the existing questions, just select the forum that you want to visit from the selection below. Otherwise, click here to register!. We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Discussion with all linux champions and guru on How fsck works???

Hi All Linux Guru's and linux lovers and all users who loves to live in linux world.Thanks to all for four great work and contributions for linux
and thanks to linuxhomenetworking.com for giving us such a wonderful platform.

Well now come to the point as we all know that fsck is used for file system check and for recovering file systems. We also know that if we want to run fsck on root partition then it should be in unmounted stated first (let me correct i am wrong). And we also know that fsck recovers file in steps and its around 5 or 6 steps that fsck uses to recover files.

We all have run fsck many times and uses it but still we most of us are not sure how fsck works. What are the steps that fsck uses to recover to file. How fsck recovers block , inodes.

So i really appreciate if someone explain all the working machinism of fsck. So here i want to discuss with all the linux lovers and experts about this. Please give your valuable advice and give your contribution so there there is no more confusion with working process of fsck.

We also know that if we want to run fsck on root partition then it should be in unmounted stated first (let me correct i am wrong).

Or mounted read-only. The goal is to make sure that filesystem is not being changed by other processes when fsck is running.

And we also know that fsck recovers file in steps and its around 5 or 6 steps that fsck uses to recover files.

Which file recovery are you referring to? The ones that fsck usually 'stores' in lost+found?

We all have run fsck many times and uses it but still we most of us are not sure how fsck works. What are the steps that fsck uses to recover to file. How fsck recovers block , inodes.

The most common cases I've seen are when fsck would recover unlinked inodes which have no deleted time set, recover/relocate corrupted superblocks. These usually happens due to HW failures, crashes or rarely kernel bugs.

I am in no means an expert in how fsck (and FS's) work. If you have any specific question or scenario in mind, feel free to ask and I'll try my best

Well let me discuss few more about fsck
fsck also reports various informations about the allocation of files and directories, giving a detailed count of the amount of disc space that is wasted due to the way files are stored on it.
Generally, fsck is run automatically at boot time when the operating system detects that a file system is in an inconsistent state, indicating a non-graceful shutdown, such as a crash or power loss.