The Volume Snapshot Snapshot

A solution to this problem was found in taking a data snapshot and then making the backup. Original data is mirrored before the start of a backup, and then backed as the frozen mirrored data. In the meantime, the access to the original data remains unrestricted. The online backup can then ensue. The idea of performing a snapshot a very quick copying of the dynamic data is similar to the concept of taking a photograph of a moving object. Once the data is snapped, we can then make a time−consuming backup of its mirror — mirrored data is reliably consistent — it does not change. The only requirement is the prevention of any data change during the snapshot, which is easily met thanks to the short snapshot time period. LVM makes this approach feasible. There are two types of snapshots: the volume and the filesystem snapshot.

6.3.5.1 The Volume Snapshot

The volume snapshot is provided on the volume level, regardless of the upper−level data structures. The procedure is relatively simple: the snapstart operation creates a write−only backup in a separate volume, which gets attached to and synchronized with the original, snapped volume. Synchronized means that the original volume is mirrored to the newly attached backup volume. The synchronization takes some time, especially in the case of large volumes. However, in this period all activities on the system are continuing normally, without any restrictions. The end of the synchronization procedure is signified by a change in the snapshot mirror status, known as the snapdone state. Once the backup volume is synchronized with the snapped volume, it is ready to be used as a snapshot mirror. The synchronized snapshot mirror continues to be updated until it is detached. The detachment can be schedule for any convenient time. The snapshot volume, an image of the snapped volume, will be created in that moment. The detachment itself represents the snapshot of the volume. The previous synchronization is only an unavoidable process required for a successful snapshot. The snapshot typically takes a very short time, and during this brief period the use of the system should be strictly controlled and any change of the volume content prevented. Once the detachment is done, the content of the created snapshot volume remains unchanged as long as this volume lives. The main disadvantage of the volume snapshot is that the size of the snapshot volume must be the same or larger than the snapped volume. The same snapshot volume can be used to mirror multiple volumes at different times, but the required long−time synchronization actually restricts its multiple usage. The synchronization itself always takes a great deal of time: each volume block must be updated mirrored regardless of whether it was changed or not. Even the unused blocks in the volume are mirrored.

6.3.5.2 The Filesystem Snapshot