Subject: Re: Defragmenting a NetBSD drive
To: Hubert Feyrer <>
From: Gandhi woulda smacked you <>
List: netbsd-ports
Date: 09/18/1999 11:09:42
On Wed, 15 Sep 1999, Hubert Feyrer wrote:

# In article <> you wrote:
# >   The file system doesn't need it. It was designed to work for long periods.
# >   About the only thing that may be needed is that directories that get used
# > a lot, e.g. /var/spool/mqueue, etc. may need to be deleted and rebuilt to
# > make them smaller, but that can be done with a shell script.
# Wasn't this problem solved with the truncate(2) system call?

This problem was purportedly "fixed" in 4.3BSD (or was it SunOS 4.1?)
in which directories which had been fully populated and then decimated
would adjust to their smaller size at the time a new directory entry
was created; i.e.

	mkdir foo (foo is size 512)
	[create LOTS of entries] (foo grows to size 8192)
	[delete MOST of the entries] (foo is still size 8192)
	touch foo/some-nonexistent-file	(foo gets compacted automagically
					and is now size 1024)

...or was this considered too much overhead to live in the kernel?

I reference SunOS because I lived there FAR too long.  I'd much rather
have lived in Berkeley.

	"Just click on the START button and your journey to the Dark Side
	 will be complete!"