Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2012 03:25:36 -0500 (CDT)
From:      Robert Bonomi <bonomi@mail.r-bonomi.com>
To:        freebsd-questions@freebsd.org, jb.1234abcd@gmail.com
Subject:   Re: lost+found dir placement
Message-ID:  <201203130825.q2D8Pa6Y053252@mail.r-bonomi.com>
In-Reply-To: <loom.20120313T085550-787@post.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help

jb <jb.1234abcd@gmail.com> 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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203130825.q2D8Pa6Y053252>