Date: Wed, 11 Aug 2004 20:00:14 +1000 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: Wilko Bulte <wb@freebie.xs4all.nl> Cc: freebsd-hackers@freebsd.org Subject: Re: fsck and lost+found space Message-ID: <20040811100014.GC423@cirb503493.alcatel.com.au> In-Reply-To: <20040811075821.GB72196@freebie.xs4all.nl> References: <20040810234448.A709@toad.nat.fasttrackmonkey.com> <20040811061739.GD63484@pc5.i.0x5.de> <20040811075435.GA423@cirb503493.alcatel.com.au> <20040811075821.GB72196@freebie.xs4all.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2004-Aug-11 09:58:21 +0200, Wilko Bulte wrote: >On Wed, Aug 11, 2004 at 05:54:35PM +1000, Peter Jeremy wrote.. >> On Wed, 2004-Aug-11 08:17:39 +0200, Nicolas Rachinsky wrote: >> >* Charles Sprickman <spork@fasttrackmonkey.com> [2004-08-10 23:52 -0400]: >> >> I was hoping for some option in fsck to allow an alternate lost+found >> >> directory on another device, but no such luck. >> >> This isn't possible - all fsck does is to create a directory entry >> pointing to the file. You could add an option to fsck to allow you >> to specify the directory name but you are still limited by fsck's >> inability to use indirect blocks for the fsck directory. > >Is this the same thing I remember from SysV days where we used to create >a ton of files in lost+found and then delete them so that in case fsck >ever needed dir entries it could re-use them? The quick answer is no. I got the impression that Charles wanted to have fsck recover files to a different filesystem - this is not currently possible and would be non-trivial to add (the file data would need to be copied). OTOH, it would be trivial to change the "lost+found" string in fsck to something else or even make it an option. I remember using S5FS. S5FS didn't shrink directories and fsck couldn't expand the lost+found directory so you had to pre-grow it by creating and deleting lots of files. I don't know if there was any restriction on growing the directory enough to need indirect blocks (I don't think I ever had a FS go so bad that it mattered). When FFS gained the ability to shrink directories, it was no longer safe to rely on a pre-allocated lost+found so fsck needed to learn how to expand lost+found. Presumably to simplify the code, fsck doesn't have the logic to handle indirect blocks in directories. It shouldn't be that difficult to add the necessary code but there shouldn't be much call for fsck to recover >~5000 files. -- Peter Jeremy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040811100014.GC423>