---
title: "Crash Consistency and the Journal"
description: "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"
canonical: https://lightmysky.com/learn/computing/crash-consistency-and-the-journal-mt_I9DT0TUmiu
source: https://lightmysky.com/learn/computing/crash-consistency-and-the-journal-mt_I9DT0TUmiu.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# 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.

Subject: Computing · Area: Computer Systems · Ages 20 to 22
Page: https://lightmysky.com/learn/computing/crash-consistency-and-the-journal-mt_I9DT0TUmiu

## Ready when they can

- 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

## Lesson: Writing the intent before the blocks

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.

**Example.** 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.

**Tip.** 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.

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

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [File Systems: Names, Blocks and Metadata](https://lightmysky.com/learn/computing/file-systems-names-blocks-and-metadata-mt_jN4u3idvF3)

## Opens up

- [Crash Recovery and Write-Ahead Logging](https://lightmysky.com/learn/computing/crash-recovery-and-write-ahead-logging-mt_JFPafSWOWF)
