Complete the sentence to describe the main purpose of a journaling file system.
A journaling file system primarily helps to [1] data after a system crash or power failure.
Journaling file systems keep a log (journal) of changes to help recover data after unexpected shutdowns.
Complete the sentence to explain what a journal records.
The journal in a journaling file system records [1] before they are applied to the main file system.
The journal mainly records metadata changes like file location and structure before applying them.
Fix the error in the description of journaling types.
In a journaling file system, [1] journaling writes both metadata and file data to the journal before committing.
Full journaling means both metadata and file data are written to the journal first.
Fill both blanks to complete the journaling file system code snippet.
if system_crash_occurred: replay_journal([1]) update_file_system([2])
After a crash, the system replays journal_entries to restore consistency, then updates the file system accordingly.
Fill all three blanks to complete the journaling file system recovery process.
journal = read_journal([1]) for entry in journal: if entry.[2] == 'metadata': apply_metadata_change(entry.[3])
The journal is read from the disk. Each entry's type is checked, and if it's metadata, the data is applied.