Hi,

rhkra...@gmail.com wrote:
> In this email I want to hyptothesize on what a snapshot might be in the hope
> that others can correct / amplify it when I go wrong.

Nitpicking mode on.


> I suppose I could copy the entire contents of
> whatever I wanted to make a snapshot of (by any of a variety of tools -- dd,
> cp, ...) and call that a snapshot,

This lacks the single-point-in-time aspect of a snapshot.

The copy process will last some time in which changes may occur which will
only partly be backuped, because some parts of the change did not yet
exist, when their affected files were backuped.
A filesystem snapshot should reduce the risk for such inconsistencies by
freezing the filesystem in a state with no pending write operations.
(There still remains the risk that the filesystem gets frozen while e.g.
a large file is being written by multiple write operations. The snapshot
will then show the file as incomplete, as if you tried to read it too early.)

The freezing of the overall filesystem will normally not last long, because
a common aspect of most snapshot concepts is copy-on-write. I.e. the data
blocks get marked read-only. When a write operation is desired, then the
affected old block loses its active job to a copy which is created in
a previously unused block. The write operation then happens on the new
block, while the old block remains valid only in the snapshot.


> I also hear (i.e., read) statements from which I infer that some snapshots
> included only the metadata of the files (or blocks???), but I'm not sure of 
> the
> value of either of those to me -- how can you reconstruct a possibly missing
> file (or block) from the metadata?

I think these statements refer to the copy-on-write concept:
Mark as read-only now, copy later.
For such a mark, you need some a kind of block management system, which of
course needs to maintain data about the data blocks, i.e. metadata.


pa...@quillandmouse.com wrote:
> Assuming a snapshot is taken so that you can recover a filesystem to a
> previous state (or the current state). Is that correct?

Not necessarily. In backup scenarios, which involve real copying, the
snapshot shall reduce the risk for consistency mishaps.


> Let's assume, as the OP says, you do an original full backup. A
> snapshot ought to record either the contents of all the files which
> have changed, or record the delta of each file which has changed.

No. That's "incremental" or "differential" backup.
  https://en.wikipedia.org/wiki/Incremental_backup
  https://en.wikipedia.org/wiki/Differential_backup

Snapshots can be used to emulate such backups. (I'd frown on a backup
concept, though, which does not store copies at some other storage medium.)


Have a nice day :)

Thomas

Reply via email to