LightMySky

Crash Consistency and the Journal

A file operation touches several blocks, and a crash between them leaves the file system in a state no correct sequence could produce. A journal writes the intention down first, so recovery can either finish the operation or discard it whole.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Describe an inconsistent state a crash could leave halfway through a file move
  • Order the journal writes and the real writes and say why the order matters
  • Explain what recovery does with a journal entry that has no commit record

1 · Read

One file operation touches several blocks: the data, the record, and the directory entry. A crash between them leaves a state no correct sequence could produce. Half a move is worse than none.

Try it together

Moving a file writes its record in the new folder and erases it in the old one. Crash in between and the file lives in both places, or in neither. Both outcomes are impossible without the crash.

A journal writes the intention down first, then a commit record, and only then the real blocks. The order is the whole trick: intent before reality. Recovery trusts the journal because it came first.

Good to know

Recovery finishes an entry that has its commit record and discards one that lacks it. Committed means replay to the end. Uncommitted means drop it whole, as if it never began.

Journal the intent first, then write reality, so recovery can finish or discard cleanly.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Crash Consistency and the Journal · Computing, ages 20 to 22 · LightMySky