TABLE OF CONTENTS 1. Introduction 2. Overview of the ﬁle system 2.1. Superblock 2.2. Summary Information. Cylinder groups. Fragments. Updates to the ﬁle system 3. Fixing corrupted ﬁle systems 3.1. Detecting and correcting corruption. Super block checking. Free block checking. Checking the inode state. Inode links. Inode data size. Checking the data associated with an inode 3.8. File system connectivity Acknowledgements References 4. Appendix A 4.1. Conventions. Initialization. Phase 1 - Check Blocks and Sizes. Phase b - Rescan for more Dups 4.5. Phase 2 - Check Pathnames 4.6. Phase 3 - Check Connectivity. Phase 4 - Check Reference Counts. Phase 5 - Check Cyl groups. Cleanup
The UNIX File System Check Program SMM:3-3 1. Introduction This document reﬂects the use of fsck with the BSD and BSD ﬁle system organization. This is a revision of the original paper written by T. J. Kow alski. When a UNIX operating system is brought up, a consistency check of the ﬁle systems should always be performed. This precautionary measure helps to insure a reliable environment for ﬁle storage on disk. If an inconsistency is discovered, corrective action must betaken. Fsck runs in two modes. Normally it is run non-interactively by the system after a normal boot. When running in this mode, it will only make changes to the ﬁle system that are known to always be correct. If an unexpected inconsistency is found fsck will exit with a nonzero exit status, leaving the system running single-user. Typically the operator then runs fsck interactively. When running in this mode, each problem is listed followed by a suggested corrective action. The operator must decide whether or not the suggested correction should be made. The purpose of this memo is to dispel the mystique surrounding ﬁle system inconsistencies. It ﬁrst describes the updating of the ﬁle system (the calm before the storm) and then describes ﬁle system corruption (the storm. Finally, the set of deterministic corrective actions used by fsck (the Coast Guard to the rescue) is presented.