Dump questions

C. P. Ghost cpghost at cordula.ws
Sun Feb 21 13:39:07 UTC 2010


On Sun, Feb 21, 2010 at 1:52 PM, Aiza <aiza21 at comclark.com> 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?


A somewhat inaccurate explanation is this:

When you (or dump -L) create a snapshot, the current state of the filesystem
is "frozen" and a snapshot file is created. As soon as some process starts
to
modify the filesystem, the old blocks at the time of snapshot are written in
the snapshot file and the new blocks are written in the ("current")
filesystem.

Now, when you (or dump -L) read the snapshot file, the UFS filesystem does
some magic behind the scenes: if the snapshot file contains the blocks you
ask for, it means that the corresponding blocks in the filesystem have
already
been changed. That's okay: UFS will then give you the old blocks from the
snapshot. If the snapshot file doesn't contain the blocks you asked for, it
means
that those blocks were not modified in the filesystem, so UFS gives you
those
unmodified blocks, right from the filesystem.

When the snapshot file is deleted, the filesystem will not be monitored
anymore
and old blocks of modified blocks will not be saved anymore.

The net result is that by reading the snapshot, you get the "frozen" state
of
the whole filesystem, while everybody else who does read the filesystem will
get the current state.

Well, it doesn't work exactly as outlined above, but conceptually, it comes
pretty close.

Regards,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/


More information about the freebsd-questions mailing list