Background fsck
Background fsck is a filesystem-specific consistency-checking mode that performs permitted repairs while the filesystem remains in use.
The 2002 BSD design uses a snapshot and kernel-assisted reclamation. [1] The FreeBSD 14.3 manual requires eligible soft-updates filesystems and stops background cleaning on unexpected errors. [2]
FreeBSD 14.3 checks eligible file systems one at a time, after a startup delay that defaults to 60 seconds so large applications can start before the check takes disk bandwidth. A negative delay postpones the check indefinitely so it can be scheduled later. [4] [5]
During a background check the file system runs at about half its normal performance. Background checking covers only the most common abnormalities, so periodic foreground checks are still recommended. [6] [4]
Relations
Advantages
- Other system activity proceeds during the check, because background checking starts asynchronously. [4]
Limitations
- This is not a generic permission to run an arbitrary repair tool against a mounted filesystem. [1]
- Some errors can escape background checking and are found only by a foreground check. [4]
Citations
- McKusick. Running "fsck" in the Background. BSDCon 2002, pp. 55-64, sections 4-7.
- FreeBSD 14.3-RELEASE fsck_ffs(8): background checking, eligibility and exit status.
- FreeBSD 14.3-RELEASE fsck(8): background mode
- FreeBSD 14.3-RELEASE rc.conf(5): background_fsck and background_fsck_delay
- FreeBSD 14.3-RELEASE tunefs(8): soft updates journaling and background check cost
Further reading
Sources & caveats
- freebsd143 is the FreeBSD 14.3-RELEASE fsck_ffs(8) page, reread on the access date in the -B and -F options.
- fsck143 is the FreeBSD 14.3-RELEASE fsck(8) page, read in the description and the -B option.
- rcconf143 is the FreeBSD 14.3-RELEASE rc.conf(5) page, read in background_fsck and background_fsck_delay.
- tunefs143 is the FreeBSD 14.3-RELEASE tunefs(8) page, read in the -j option.
- One at a time comes from fsck143. 60 seconds and the negative delay come from rcconf143. About half comes from tunefs143.