Stable storage can be seen as an ideal storage medium that, given a set of failure assumptions, protects user data from corruption or loss. The integrity of the stored data must be guaranteed even in the presence of crash failures. In this paper, we show how to realize stable storage using a technique called mirroring. The main idea is to write the data to two locations instead of one, in a sequential order. If one write operation fails, the technique ensures that the other copy is in a consistent state. It may be the state that was valid before the write operation, or it may already be the new one. Of course, there must be some mechanism to determine which one is correct. The purpose of the paper is therefore to describe the mirroring algorithm, and to present a state automaton covering all possible situations that can occur in the case of crash failures. Finally, an implementation in Ada 95 is presented.