Operating systemsLesson 2 of 3 in the course File systems and I/O

Journaling File Systems: Recovery, Journal Design, and Alternatives

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

A file system often needs to make several related changes when a file or directory is updated. If a crash interrupts those changes, the file system can be left in an inconsistent state. This lesson introduces journaling, explains why it helps, and describes how recovery works.

A crash between any two steps can leave the file system in an invalid intermediate state. If the directory entry is removed but the inode is not released, the inode may become orphaned and storage may be leaked. If the inode is released but the blocks are not, those blocks remain unavailable for new files. Simply changing the order does not solve the problem: releasing blocks too early could allow another file to reuse them while the old directory entry still refers to them.

All flashcards

Physical journaling
A journaling method that logs copies of changed blocks before writing them to their main locations.
Logical journaling
A journaling method that records metadata changes rather than copies of every changed data block.
Journal checksum
A value used to detect incomplete or damaged journal entries during recovery.
Write barrier
A control that can force a storage device to flush its cache at a particular point.
Copy-on-write file system
A file system that writes changes to newly allocated blocks, then updates metadata to point to them.

Quiz questions

  1. Why can a crash during file deletion leave a file system inconsistent?Answer: Deletion changes several structures, and a crash can leave only some of those updates completed.
  2. What is a performance cost of physical journaling?Answer: Each changed block is written to the journal and then to its main location.
  3. What can happen when metadata is replayed after an append, but the appended data was not written?Answer: The file may appear larger even though its newly added portion contains unwritten or stale data.
  4. How does copy-on-write help maintain file-system consistency?Answer: It writes changed data to new blocks, then updates metadata to point to those blocks.
  5. What consistency outcome do soft updates aim to provide after a crash?Answer: The on-disk file system remains consistent, though storage may be leaked until cleanup.

Based on the Wikipedia article Journaling file system, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Operating systems lessons