The fsck command uses a state flag, which is stored in the superblock, to record the condition of the file system. This flag is used by the fsck command to determine whether a file system needs to be checked for consistency. The flag is used by the /sbin/rcS script during booting and by the fsck -m command. If you ignore the result from the fsck -m command, all file systems can be checked regardless of the setting of the state flag.
For a description of the superblock, see The Superblock.
The possible state flag values are described in the following table.
Table 20–1 Values of File System State Flags
State Flag Values |
Description |
---|---|
FSACTIVE |
Indicates a mounted file system that has modified data in memory. A mounted file system with this state flag indicates that user data or metadata would be lost if power to the system is interrupted. |
FSBAD |
Indicates that this file system contains inconsistent file system data. |
FSCLEAN |
Indicates an undamaged, cleanly unmounted file system. |
FSLOG |
Indicates that the file system has logging enabled. A file system with this flag set is either mounted or unmounted. If a file system has logging enabled, the only flags that it can have are FSLOG or FSBAD. A non-logging file system can have FSACTIVE, FSSTABLE, or FSCLEAN. |
FSSTABLE |
Indicates an idle mounted file system. A mounted file system with this state flag indicates that neither user data nor metadata would be lost if power to the system is interrupted. |
The following table shows how the state flag is modified by the fsck command, based on its initial state.
Table 20–2 How the State Flag is Modified by fsck
Initial State: Before fsck |
State After fsck |
|
|
---|---|---|---|
No Errors |
All Errors Corrected |
Uncorrected Errors |
|
unknown |
FSSTABLE |
FSSTABLE |
unknown |
FSACTIVE |
FSSTABLE |
FSSTABLE |
FSACTIVE |
FSSTABLE |
FSSTABLE |
FSSTABLE |
FSACTIVE |
FSCLEAN |
FSCLEAN |
FSSTABLE |
FSACTIVE |
FSBAD |
FSSTABLE |
FSSTABLE |
FSBAD |
FSLOG |
FSLOG |
FSLOG |
FSLOG |