This chapter explains how a device changes what it has stored, including its own software, without being left broken when power fails at the worst moment. It starts from the meaning of persistent state §8.1 and three guarantees that are easy to confuse: durability §8.2, which says that a completed change survives a failure; atomicity §8.3, which says that a change happens completely or not at all; and crash consistency §8.4, which says that recovery always finds a valid state. It then presents the standard designs that provide these guarantees, such as transactions §8.7, two-phase commit §8.8, shadow paging §8.9, copy-on-write §8.11, write-ahead logging §8.12 and A/B updates §8.10, and the log-structured storage used on flash memory §6.6, with its costs in wear and extra writing.
The second half applies these ideas to software updates: the order of writes, the small record whose write makes an update take effect, the separate steps of staging, committing and activating, trial runs that must be confirmed, and the return to the last version that worked. It also covers protection against reinstalling old versions with known flaws, monotonic counters §8.28, operations that are safe to repeat, and the state machines §8.33 that tie the steps together. The final entries show how to test all of this by cutting the power or resetting the device at chosen moments.