What is the purpose of Journaling in a file system, and how does it help with recovery after a system crash?
Last updated
Journaling writes intended changes to a log (the journal) and marks them committed before applying them to the real structures, making each operation atomic.
After a crash, committed-but-unapplied entries are replayed and incomplete ones ignored, avoiding a full
fsckscan and cutting recovery from minutes to seconds.Metadata-only journaling is faster, while full data journaling is safest but writes data twice. It guarantees structural consistency, not that every byte of user data was saved.