From owner-freebsd-questions@FreeBSD.ORG Sun Feb 21 13:39:07 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A032A1065670 for ; Sun, 21 Feb 2010 13:39:07 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5888FC0C for ; Sun, 21 Feb 2010 13:39:06 +0000 (UTC) Received: by bwz8 with SMTP id 8so1123688bwz.3 for ; Sun, 21 Feb 2010 05:39:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.144.78 with SMTP id y14mr3245449bku.194.1266757829692; Sun, 21 Feb 2010 05:10:29 -0800 (PST) X-Originating-IP: [213.146.115.42] In-Reply-To: <4B812C8F.40102@comclark.com> References: <4B80ABBA.9000707@comclark.com> <20100221110358.9ec8b286.freebsd@edvax.de> <4B812C8F.40102@comclark.com> Date: Sun, 21 Feb 2010 14:10:29 +0100 Message-ID: From: "C. P. Ghost" To: Aiza Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: Dump questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 13:39:07 -0000 On Sun, Feb 21, 2010 at 1:52 PM, Aiza wrote: > Polytropon wrote: > >> On Sun, 21 Feb 2010 11:42:50 +0800, Aiza 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/