From owner-freebsd-questions@FreeBSD.ORG Tue Mar 13 08:24:23 2012 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 5B68A106564A for ; Tue, 13 Mar 2012 08:24:23 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id D64148FC08 for ; Tue, 13 Mar 2012 08:24:22 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q2D8Pa6Y053252; Tue, 13 Mar 2012 03:25:36 -0500 (CDT) Date: Tue, 13 Mar 2012 03:25:36 -0500 (CDT) From: Robert Bonomi Message-Id: <201203130825.q2D8Pa6Y053252@mail.r-bonomi.com> To: freebsd-questions@freebsd.org, jb.1234abcd@gmail.com In-Reply-To: Cc: Subject: Re: lost+found dir placement 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: Tue, 13 Mar 2012 08:24:23 -0000 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. > This implies the dir must have already existed (it may not be mounted ad hoc > e.g. at boot time, during fs recovery). > > 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". > > So, lost+found dir should exist under root dir as /lost+found. Do you have a filesystem mounted on /mnt? > > Any comments before I file a PR request ? The fsck_ffs manpage says that 'lost+found' is _created_ *when*needed*, in the root of a filesystem, if not already present. The presense of /mnt/lost+found is _not_ an error. just a surperfluous file that ended up there 'somehow'. *IF* you're going to file a PR, it should be for the filesystem initialization process -- which "should" (a) create the lost+found directory, (b) create some 'reasonable' number of files in that directory, and (c) then delete all those files. This ensures that the directory exists and has disk-space allocated for a 'reasonable' number of 'recovered' file entries. The existing fsck_ffs has a catastrophic failure mode if there is no space on the disk for the lost+found directory to grow to acomodate the recovered file entries.