Article View: comp.sys.acorn.tech
Article #196Re: Disk free space
From: David Seal
Date: Tue, 25 Aug 1992 15:19
Date: Tue, 25 Aug 1992 15:19
40 lines
2481 bytes
2481 bytes
In article <1992Aug24.174024.1@vxdesy.desy.de> burke@vxdesy.desy.de writes: >[Description of mismatch between amount of data on disc and amount of disc > space used.] > > To investigate a bit further, I tried creating a directory (in the root); >the free space dropped by 13Kb (exactly). I created another directory, >and it dropped by another 18Kb. I then created a 1-byte-long file; the >free space didn't change at all! I created another 1-byte file, and again >the free space didn't change. Does anyone understand this? What is going on is that ADFS allocates space in large chunks. When you create a directory, it gets a lot of space, 2k of which is used for the directory itself. The rest of the space is reserved for small files in that directory. So you lose a lot of space when you create the directory, then don't lose anything when the small file is created, since it is using the previously reserved space. (I'm not quite certain why you're getting different amounts for different directories. Possibly it's due to the free space being in small chunks - e.g. ADFS looks for a chunk of size 10k and finds a gap in the free space map of length 13k. It can't allocate you just 10k, since the remaining 3k is too small to be allocatable, so it gives you 13k. Next time, it finds a gap of size 18k. Again, the remaining 8k is too small, so it gives you the whole thing.) This has obvious possible disadvantages - e.g. the possibility that the reserved space won't get used. But it also has a number of advantages: for instance, it allows the free space map to be stored very compactly and accessed efficiently. Another one is that small files tend to be stored in the same area on disc as the directory they're in: this often reduces the number of disc seeks you need to access the file (i.e. when you seek to the correct place to get the directory, you automatically find yourself in the right place to read the file itself without a further seek). The result is faster access to files. David Seal dseal@armltd.co.uk All opinions are mine only...
Technical Details
Message-ID:
<5725@armltd.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!acorn!armltd!dsealReferences:
<1992Aug24.174024.1@vxdesy.desy.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!acorn!armltd!dseal From: dseal@armltd.co.uk (David Seal) Newsgroups: comp.sys.acorn.tech Subject: Re: Disk free space Message-ID: <5725@armltd.uucp> Date: 25 Aug 92 15:19:14 GMT References: <1992Aug24.174024.1@vxdesy.desy.de> Sender: dseal@armltd.uucp Distribution: comp Organization: A.R.M. Ltd, Swaffham Bulbeck, Cambs, UK Lines: 40