Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 5/22/85; site cbosgd.UUCP Path: utzoo!watmath!clyde!cbosgd!mark From: mark@cbosgd.UUCP (Mark Horton) Newsgroups: net.followup Subject: Re: Unix physical block size Message-ID: <1638@cbosgd.UUCP> Date: Tue, 26-Nov-85 00:29:18 EST Article-I.D.: cbosgd.1638 Posted: Tue Nov 26 00:29:18 1985 Date-Received: Tue, 26-Nov-85 20:52:27 EST References: <298@weitek.UUCP> <228@polaris.UUCP> <942@wcom.UUCP> <701@petrus.UUCP> Organization: AT&T Bell Laboratories, Columbus, Oh Lines: 29 > > it's partly a function of hardware as well. tradition has it that all disk > > blocks are 512 bytes. this is fine on a smaller machine where there was > > only 64K to work with, the CPU and memory are slow, and so was the disk. > > you can make block sizes bigger, but still you have to live with hardware > > that doesn't understand it. > > On System V, the physical block sizes are 1K. Unfortunately, in System V, the number 512 is thoroughly embedded into nearly all levels of the system. At the physical level, disk sectors are assumed to be 512 bytes. (This is true of 4BSD also.) When you do a "du" or an "ls -s", the units reported to the user are "blocks", which everyone knows are 512 bytes each. In fact, I often ask someone how much disk space something takes up, and they tell me how many "blocks" it takes up, assuming I know that "blocks" are 512 bytes. Berkeley has attempted to change the units that people think in to "K", e.g. 1024 bytes. While I've changed my thinking to K and Megabytes, I still have to translate from the old system because of all the people out there that have 512 stamped onto their brains. It's like translating between the traditional and metric systems - if we'd all go cold turkey at once it wouldn't be any big deal. The filesystems do work in bigger units, and this produces significant speedups. System V typically does disk transfers in units of 1K (this means that when it wants a disk block, it transfers two 512 byte sectors at once.) 4.2BSD is similar, although it does 4K or 8K transfers by doing 8 or 16 sectors at once. (There are exceptions, of course, some systems still use 512, others use 4K, etc.)