Dump questions

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Feb 21 13:31:13 UTC 2010

Hash: SHA1

On 21/02/2010 12:52, Aiza wrote:
> Polytropon wrote:
>> On Sun, 21 Feb 2010 11:42:50 +0800, Aiza <aiza21 at comclark.com> wrote:
>>> 1. Using the -L flag to create a snapshot of the
>>> live running file system.
>>> Does this mean that a complete copy of the file
>>> system is written to .snap directory?
>> No. The snapshot, quite incorrectly explained, is a saved
>> delta between the file system on disk at a given state, to
>> fixate further modifications (that are not included in the
>> dump, of course).
> Sorry, I read your words but have no clue as what you are trying to say
> with that statement. As i understand 'delta' to mean, the difference in
> file system content between a point in time 'A' and 'B' some point in
> time later in the future. Now just what is snapshot recording between
> point 'A' and 'B' and how does that apply to what dump is going to read
> and write?

In horrendously simplified terms, the way snapshots work is this.
Whenever there would be a write to a disk block, instead of overwriting
the original block, the content is copied and written out to a
previously unused disk block.  The original block is preserved
temporarily while the snapshot is active -- so the snapshotted data you
see is the comprised of:

   * All the disk blocks that haven't been altered during the lifetime
     of the snapshot

   * The original, unchanged disk blocks which have been replaced by
     modified copies in the live filesystem.

ZFS always does the copy-on-write thing, so it's a very natural and
very fast operation to create snapshots with it -- often described as
'snapshots for free' -- and you can have as many as you want.

UFS doesn't do CoW by default (AFAIR) so creating a snapshot under UFS
means toggling the default behaviour and initialising some data
structures to keep track of the disk blocks that belong to each
snapshot.  This means it will take a few seconds to create and you can
only have a limited number of snapshots per filesystem active

In either case, the space used for the snapshot corresponds to the
amount of changes made to the filesystem since the snapshot was
created.  Thus on an active fs, snapshot space usage will go up over
time.  However, the amount used will generally be a fairly small
percentage of the total space on the device, and all the extra space is
recovered when the snapshot is released.



- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the freebsd-questions mailing list