Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!uunet!mcsun!hp4nl!philapd!ssp2!pb From: pb@idca.tds.PHILIPS.nl (Peter Brouwer) Newsgroups: comp.unix.i386 Subject: Re: mkfs and disk performance Message-ID: <628@ssp2.idca.tds.philips.nl> Date: 24 Aug 90 07:31:43 GMT Reply-To: pb@idca.tds.philips.nl (Peter Brouwer) Organization: Philips Information Systems, Apeldoorn, The Netherlands Lines: 48 Summary: Expires: References:<1990Aug21.050638.15737@cimcor.mn.org> <536@fciva.FRANKLIN.COM> Sender: Followup-To: Organisation: Philips Information Systems, Apeldoorn, The Netherlands Disclamer: This is mine opinion alone. Keywords: In article <536@fciva.FRANKLIN.COM> dag@fciva.UUCP (Daniel A. Graifer) writes: >In article <1990Aug21.050638.15737@cimcor.mn.org> det@cimcor.mn.org (Derek Terveer) writes: >>I believe that he gap is the interleave on your drive. >I believe this is incorrect. The interleave is the physical numbering >modulus for sectors on your drive. This a function of drive controller/ >format. > >The 'gap' is parameter of the file system, and tells the file system how >to map 'contiguous' logical blocks of filespace to physical blocks. Since >the standard file system buffers reads one block at a time, proper >gapping will cause a set of sequential reads to synchonize efficiently >with the availability of physical blocks on the drive. To be precise, the gap determines the way the free block space is organised. There is a pitfall however. The gap size specified for mkfs and fsck is related to 512 disk sector size. The first thing mkfs and fsck does is determine the unix blocksize and recalculate the gap value. So if you specify a gap of 4 for a 1024 byte block file system the logical gap value used will be 2. Here is an example: lets asume the gap value is 4 and there are 20 blocks. Then the folowing sequence will be used in the free block list. 0 3 7 11 15 19 4 8 12 16 1 5 9 13 17 2 6 10 14 18 So when a file is created on the file system free block are taken in sequence from the free block list and the file has the same gap in the block sequence as is used in the free block list. Now when a file is removed the blocks are put at the begin of the free block list. This will disturb the organisation of the free block list. So if this is going on for a lost of files with different sizes the free block lists and the new created files get fragmented. The only way to defragment a file system with the 'standard tools' is to copy the filesystem to a new created file system. There are however a few 'defragment tools'. There was one posted on the net about a year ago. This one could would created new files with a gap of 1. An other approach would be to use fsck at regular intervals to recreate the free block list. Fsck will then create a new block list with blocks in the correct sequence. This will not defragment the already excisting files. I have forced a fsck on each monday during the boot process of the machine. I hope this will help to clear things up a bit. -- Peter Brouwer, # Philips Information Systems, NET : pb@idca.tds.philips.nl # Department SSP-P9000 Building V2, UUCP : ....!mcsun!philapd!pb # P.O.Box 245, 7300AE Apeldoorn, The Netherlands. PHONE:ext [+31] [0]55 432523, #