From owner-freebsd-questions@FreeBSD.ORG Tue Mar 13 08:11:45 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 428B21065672 for ; Tue, 13 Mar 2012 08:11:45 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 02B0B8FC21 for ; Tue, 13 Mar 2012 08:11:44 +0000 (UTC) Received: from r56.edvax.de (port-92-195-185-71.dynamic.qsc.de [92.195.185.71]) by mx02.qsc.de (Postfix) with ESMTP id 3FB731E1BA; Tue, 13 Mar 2012 09:11:41 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q2D8BfMp005939; Tue, 13 Mar 2012 09:11:41 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 13 Mar 2012 09:11:41 +0100 From: Polytropon To: jb Message-Id: <20120313091141.11263aeb.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: lost+found dir placement X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 08:11:45 -0000 On Tue, 13 Mar 2012 07:58:09 +0000 (UTC), jb wrote: > Hi, > > Each fs should have its own lost+found directory. > It is used by fsck for placing recovered corrupted fs files in there. Correct. > This implies the dir must have already existed (it may not be mounted ad hoc > e.g. at boot time, during fs recovery). No. This implication does not exist. If I read /usr/src/sbin/fsck_ffs/dir.c correctly, the lost+found/ directory will be created by fsck if it is required and _not_ present. It will do so on a inode based method (instead of utilizing a file system oriented call to make a directory). This is a requirement because (as you correctly mentioned) the partition checked will not be writable (or even be mounted), so mkdir() and related fs functions cannot be used. Also see an evidence for that idea in "man fsck_ffs". > In FreeBSD 9, I found lost+found dir under /mnt. > This is incorrect - /mnt is defined under all standards (Filesystem Hierarchy > Standard, Unix directory structure) as "contains filesystem mount points". According to "man hier" (mandatory for interpreting the file system hierarchy on FreeBSD) this your assumption sounds correct: /mnt is explained to be an "empty directory commonly used by system administrators as a temporary mount point", so having a lost+found/ directory in there doesn't seem to have any purpose and looks wrong. > So, lost+found dir should exist under root dir as /lost+found. Correct. It will be assigned to the results of possible recoveries of lost data of the / partition correctly. > Any comments before I file a PR request ? If this directory has been created by the installation process, I think you should. Maybe you verify the issue on the freebsd-fs@ list? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...