Date: Sun, 21 Feb 2010 14:10:29 +0100 From: "C. P. Ghost" <cpghost@cordula.ws> To: Aiza <aiza21@comclark.com> Cc: freebsd-questions@freebsd.org Subject: Re: Dump questions Message-ID: <d74eb87c1002210510r329fe0aiac68cf245eddbeda@mail.gmail.com> In-Reply-To: <4B812C8F.40102@comclark.com> References: <4B80ABBA.9000707@comclark.com> <20100221110358.9ec8b286.freebsd@edvax.de> <4B812C8F.40102@comclark.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 21, 2010 at 1:52 PM, Aiza <aiza21@comclark.com> wrote: > Polytropon wrote: > >> On Sun, 21 Feb 2010 11:42:50 +0800, Aiza <aiza21@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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d74eb87c1002210510r329fe0aiac68cf245eddbeda>