From owner-freebsd-questions@FreeBSD.ORG Thu Jan 31 01:01:18 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B1916A419; Thu, 31 Jan 2008 01:01:18 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id 5202E13C44B; Thu, 31 Jan 2008 01:01:18 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost.mckusick.com [127.0.0.1]) by chez.mckusick.com (8.13.8/8.13.6) with ESMTP id m0V10vjX009384; Wed, 30 Jan 2008 17:01:05 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <200801310101.m0V10vjX009384@chez.mckusick.com> To: Barry Pederson Date: Wed, 30 Jan 2008 17:00:57 -0800 From: Kirk McKusick Cc: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , questions@freebsd.org, fs@freebsd.org Subject: Re: Automatic `nodump' flag? 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: Thu, 31 Jan 2008 01:01:18 -0000 > Date: Wed, 30 Jan 2008 16:13:54 -0600 > From: Barry Pederson > To: Kirk McKusick > CC: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , questions@freebsd.org, > fs@freebsd.org > Subject: Re: Automatic `nodump' flag? > X-ASK-Info: Message Queued (2008/01/30 14:14:17) > X-ASK-Info: Confirmed by User (2008/01/30 16:37:01) > > Kirk McKusick wrote: > > > The dump program runs on the raw disk partition dumping sequentially > > by inode number. So, it has no idea of the file-tree hierarchy. > > I was just looking at the source to dump, specifically traverse.c and > from what I can see, doesn't dump pass #2 scan through all directories > and then in the searchdir() function remove a directory's children from > the list of inodes to backup if the directory has the nodump flag? > > --------- > 414 if (nodump) { > 415 ip = getino(dp->d_ino, &mode); > 416 if (TSTINO(dp->d_ino, dumpinomap)) { > 417 CLRINO(dp->d_ino, dumpinomap); > 418 *tapesize -= blockest(ip); > --------- > > Barry You are completely correct. This does prune out everything below a directory marked `nodump' even if those files are not also marked `nodump'. Note that by default, level 0 dumps will ignore the `nodump' flag. You have to use `-h 0' if you want a level 0 dump to honor the `nodump' flag. You would think I would remember code that I wrote (though in my defense it was written over 20 years ago :-) Kirk McKusick