home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.bsd
- Path: sparky!uunet!pmafire!mica.inel.gov!ux1!fcom.cc.utah.edu!cs.weber.edu!terry
- From: terry@cs.weber.edu (A Wizard of Earth C)
- Subject: Re: Dumb Question: Why 512 byte block?
- Message-ID: <1992Dec18.235623.27538@fcom.cc.utah.edu>
- Sender: news@fcom.cc.utah.edu
- Organization: Weber State University (Ogden, UT)
- References: <1992Dec18.005050.20594@decuac.dec.com> <1992Dec18.030833.7395@fcom.cc.utah.edu> <1gt736INNjje@menudo.uh.edu>
- Date: Fri, 18 Dec 92 23:56:23 GMT
- Lines: 63
-
- In article <1gt736INNjje@menudo.uh.edu> wjin@cs.uh.edu (W. Woody Jin) writes:
- >In article <1992Dec18.030833.7395@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
- >>In article <1992Dec18.005050.20594@decuac.dec.com>, darryl@vfofu1.dco.dec.com (Darryl Wagoner) writes:
- >>|> Why is everything in 1/2 k block instead the BSD standard of 1024 byte blocks?
- [ ... ]
- >>
- >>If I have a set of 6 512 byte files, I will use up 3K of disk for them;
- >>similarly, if I had a blocking factor of 1K, I would use of 6K (since the
- >>smallest fragment usable by a file is now 1K.
- >>
- >>If I have 6 1.5K files, this translates to 9K of disk(512B) or 12K of disk(1K).
- >>Obviously, if I have 6 1.6K files, both blocking factors take up 512K.
- >
- >I did not think that Fast Unix File System works this way.
- >If you have 6 1.5K files using 1K blocks,
- > 6 1k blocks will take each 1K from each file, and
- > 3 1k blocks will take 0.5k from each file.
- >This was my understading from the famous FUFS paper.
-
- You can't split blocks between files. A block is, by definition, the
- smallest possible allocation unit. Thin about the case where you have
- a 1 byte file and a 1 block - 1 byte file; what would you do when
- adding one or two characters to the first (1 Byte)? TReallocate? Shift
- and reallocate for the last byte of the second file?
-
- But... you're right that it doesn't work the way I've shown... thought
- for sure I'd get bombarded on this one:
- >>Obviously, if I have 6 1.6K files, both blocking factors take up 512K.
- should have read:
- >>Obviously, if I have 6 1.6K files, both blocking factors take up 12K.
-
- 1.6K rounded to a both a 512b and 1K boundry is 2K, and 2k * 6 = 12k.
-
- >>When you store a lot of little files on the disk, small blocks are wasteful
- >>of disk space (for instance, 1024 empty files take 512K vs 1M of disk for
- >>the smaller blocking factor).
- >
- >And choosing a disk block size is a performance issue rather than
- >disk space issue. One should tune disk block size and fragment size
- >to get the best performance.
- >
- >I thought that 386BSD uses this Fast Unix File System.
-
- Consider the most ridiculous possible situation: I have a 1G disk with
- a 1G blocking factor (impossible without rewriting the buffering code).
-
- How many files can I have on the disk? (Ignore the blocks allocated to inodes
- and directoryies 8-P).
-
- The answer is "1"... even if it only has 1 byte in it.
-
-
- Terry Lambert
- terry@icarus.weber.edu
- terry_lambert@novell.com
- ---
- Any opinions in this posting are my own and not those of my present
- or previous employers.
- --
- -------------------------------------------------------------------------------
- "I have an 8 user poetic license" - me
- Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
- -------------------------------------------------------------------------------
-