From owner-freebsd-questions@FreeBSD.ORG Mon Oct 31 15:51:29 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70DF316A41F for ; Mon, 31 Oct 2005 15:51:29 +0000 (GMT) (envelope-from e.schuele@computer.org) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F0B243D45 for ; Mon, 31 Oct 2005 15:51:25 +0000 (GMT) (envelope-from e.schuele@computer.org) Received: from [208.206.151.59] (host59.gtisd.com[208.206.151.59]) by comcast.net (sccrmhc12) with ESMTP id <2005103115403001200d285me>; Mon, 31 Oct 2005 15:40:44 +0000 Message-ID: <43663AE0.2040606@computer.org> Date: Mon, 31 Oct 2005 09:40:16 -0600 From: Eric Schuele User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050930) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Csaba Henk References: <20051030134902.GG2911@beastie.creo.hu> <72cf361e0510300958w33bf3u3f754e68794b858d@mail.gmail.com> <43651D7B.6000005@computer.org> <20051031140038.GH2911@beastie.creo.hu> In-Reply-To: <20051031140038.GH2911@beastie.creo.hu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: backup strategies 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: Mon, 31 Oct 2005 15:51:29 -0000 Csaba Henk wrote: > Thanks for all the tips and answers, I will consider the mentioned > alternatives. > > Yet I have one more question... > > On Sun, Oct 30, 2005 at 01:22:35PM -0600, Eric Schuele wrote: > >>dump(8) will create a snapshot of a live filesystem, dump the snapshot >>and then remove the snapshot, if given the correct flags ('-L'). > > > Can even a full bakcup done safely on a live filesystem by "dump -L"? > > As dump(8) says when explaining the -L flag: > > To obtain a consistent dump image, dump takes a snapshot of the file > system in the .snap directory in the root of the file system being > dumped and then does a dump of the snapshot. > > I don't see how the temporary snapshot can improve the > reliability/consistency/correctness of the dump. Could someone explain > this? > How do snapshots work and how do they provide the consistency necessary for a dump? (Well, I'm probably not the best one to answer this, but I'll take a swing.) Basically, when taking a snapshot... any new activity on the filesystem in question is suspended. All presently executing syscalls are allowed to finish. The filesystem is synchronized as if unmounting, and then a snapshot file is created. At this point filesystem activity is resumed. The real magic is in the snapshot file. The file is a snapshot of the filesystem metadata at the time the snapshot was taken. From this point on... as long as the snapshot exists on your machine... it tracks the changes that occur within the filesystem from the time you took the snapshot to the present. What this means is the snapshot file holds pointers to the data on your filesystem. As that data changes (since the snapshot), the old data gets claimed by the snapshot... and the new data is written to disk. Same with deleting data... the deleted data gets claimed by the snapshot and the filesystem looses it. Any unchanged data is simply referred to (in the snapshot file) as pointers to the existing data on the actual filesystem, and any new data need not be mentioned in the snapshot file. So the snapshot can be taken very quickly... and requires a bit of maintenance by the OS during its lifetime. But if you create it, dump it and remove it. The OS need not worry about it for long. SoftUpdates are required on the filesystem. HTH. -- Regards, Eric