I was reading a blog post about filesystem repair and the author posted a good question… fsck -p
is supposed to fix minor errors automatically without human intervention. But what exactly will it fix when it's told to preen the filesystem? What errors will it fix, and what will cause it to stop and tell the user he or she must run fsck interactively? Is there a list of some kind?
I've been Googling around and all I find is the man page, which doesn't really tell what -p
will fix or what triggers the hands-on flag. I'm specifically interested in the ext4 filesystem.
Best Answer
The answer to your question lies in the
e2fsck/problems.c
file of the e2fsprogs source code. Looking for thePR_PREEN_OK
flag should get you started.As the complete error handling is a bit more involved, due to the multitude of different error conditions that may occur, you are advised to have a closer look at the code if you are concerned about a specific case. However, the lists below were extracted from the comments to the error conditions and should give you a rough overview about the effects of the preen-mode.
The following errors/warnings are currently handled automatically when the
-p
flag is specified:The following error conditions cause the non-interactive fsck process to abort, even if the
-p
flag is set: