From owner-freebsd-questions@FreeBSD.ORG Tue Mar 13 12:44:52 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 6A7DF106566B for ; Tue, 13 Mar 2012 12:44:52 +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 2B6AE8FC0A for ; Tue, 13 Mar 2012 12:44:51 +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 D184D1EB34; Tue, 13 Mar 2012 13:44:50 +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 q2DCinNl001900; Tue, 13 Mar 2012 13:44:49 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 13 Mar 2012 13:44:49 +0100 From: Polytropon To: jb Message-Id: <20120313134449.64d1ad61.freebsd@edvax.de> In-Reply-To: References: <201203130825.q2D8Pa6Y053252@mail.r-bonomi.com> 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 12:44:52 -0000 On Tue, 13 Mar 2012 10:02:16 +0000 (UTC), jb wrote: > Robert Bonomi mail.r-bonomi.com> writes: > > > ... > > 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'. > > ... > > This worried me. And still does ... How "clean" is your installation? If you have had mounted some UFS file system in /mnt that has undergone a fsck check where the creation of lost+found had been neccessary... no wait, it would be on that partition then. If this directory entry is present in /mnt which is supposed to be empty by default, e. g. if "mount" doesn't show something actually mounted on /mnt, then I think you should delete the directory entry. Just imagine the "fun" that could happen if you mount something to /mnt... However, do you remember _what_ created lost+found in /mnt? > > *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. > > > > That's perhaps why under Linux they have special mklost+found entry ? Nothing new. In fact, I remember that my WEGA (UNIX system III derivate) mentiones a command that would create the lost+found directory, mklf or createlf... as a binary. > > 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. > > > > I was surprised to find empty lost+found dir in /mnt. > drwx------ 2 root wheel 512 May 5 2011 lost+found > That's why I jumped a bit. It's fully unsurprising to be surprised here. :-) > Few days ago, after clean reboot to single user mode, I tested fsck manually > on SUJ fs and found things that seemed to be questionable (I posted it on > current@ list, if you want to take a look). > > So, it must have happened during that time, because as I said I did not have > any forced fsck run at boot times, and I almost swear I did not have this > lost+found dir in /mnt before. Possible, but in a normal case, lost+found is tied to a partition (and per implication to a mountpoint). The mountpoint, if _not_ in use, should be empty. > I will take a look at source code of fsck* entries and perhaps find a clue. I posted the file name where you can find the handling of the creation of lost+found. Just search for this string and you'll find the corresponding section easily. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...