Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!labrea!decwrl!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Disk Fragmentation Message-ID: <24326@sun.uucp> Date: Tue, 28-Jul-87 14:15:25 EDT Article-I.D.: sun.24326 Posted: Tue Jul 28 14:15:25 1987 Date-Received: Thu, 30-Jul-87 02:18:08 EDT References: <8441@brl-adm.ARPA> <7674@mimsy.UUCP> <366@micropen> Sender: news@sun.uucp Lines: 18 > SystemV has just such a utility: dcopy(1M). It's man page claims it will > deflate large empty directories and place file blocks with optimal > rotational gap. Also subdirectories are placed at the beginning of a > directory in hopes of speeding depth first directory searches. Given that > AT&T went to the trouble to do this, cp(1) sounds too easy (and no directory > re-organization is done to the best of my knowledge.) The secret here is that, indeed, the original posting *was* about 4.3BSD. The 4.[23]BSD file system uses a bitmap, not a free list, to keep track of free blocks, and when a new block is needed it tries as best it can to allocate one radially as close to a related block as possible, preferably (at least in the case of blocks in a file) rotationally positioned as optimally as possible as well. It also tries to keep directories close to the files in them; the 4.3BSD version will also deflate large directories when possible. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com