Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Aug 2020 14:59:13 -0400
From:      Kurt Hackenberg <kh@panix.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Suggestion regarding fsck output enhancement
Message-ID:  <33f995b9-7799-c5d7-8b8d-5463b4048d68@panix.com>
In-Reply-To: <20200829021831.GA25998@neutralgood.org>
References:  <20200824104017.4c241ec0.freebsd@edvax.de> <12f154c3-078f-401d-6a48-dc2f700a4d1d@panix.com> <20200829021831.GA25998@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-08-28 22:18, Kevin P. Neal wrote:

>> The trouble is, an inode does not point back to any of the directory
>> entries that point to it. Far as I know, the only way to find names
>> associated with an inode is to search the whole filesystem, looking for
>> directory entries that contain that inode number. That could take a while.
> 
> Well, it would require building an in-memory version of the filesystem's
> metadata. Except that fsck already needs that (minus the filenames) in order
> to do its job, right? How else would it know that, for example, an inode
> is unreferenced.
> 
> Poly, I think you should open a bug report/feature request on the official
> FreeBSD bugtracker. If you haven't already.


You might want to estimate the amount of memory needed to hold all the 
filenames in a large filesystem.

What fsck does now probably needs just an array of reference counts, 
indexed by inode number.

Each inode in use is pointed to by at least one directory entry, a 
filename that can be up to 255 characters long (though usually they're 
much shorter). In practice, extra hard links aren't used much for 
regular files, but each directory has two links plus another for each of 
its subdirectories. (The extra link names are short, though: "." and "..".)

You could estimate, say, 1.1 filenames per inode, times maybe 32 
characters each, times the default number of inodes allocated in a 1 TB 
filesystem, whatever that is.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33f995b9-7799-c5d7-8b8d-5463b4048d68>