The information in this article applies to:
SUMMARY
This article covers:
Hierarchical File System SpecificationsThe following sections cover specifications and associated terminology used to describe the Macintosh HFS structure. The following numbers apply to both System 6 and System 7.VolumeA volume is either an entire disk, or a section of a disk, partitioned into separate parts. If you partition a single drive then each partition is considered a volume.
Logical blockA logical block is a unit of drive space composed of up to 512 bytes. A logical block is numbered from 0 to n, n being the last block on the volume (not necessarily the last block on the hard disk). To figure out the number of logical blocks, divide the volume size by 512 bytes.Allocation blockAn allocation block is a unit of storage on a volume, composed of one or more logical blocks. The larger the volume, the more logical blocks comprise one allocation block. The maximum number of allocation blocks per volume is 65,536; most volumes have slightly less.The size of your hard drive determines the minimum size of each file. In both the Macintosh and MS-DOS environment, you can have up to 65,536 blocks on a drive (because both operating systems address the allocation blocks with 16-bit addressing). Drives larger than 512 megabytes cannot use 8K blocks because there are not enough addresses. Thus, if a 2 gigabyte drive is one Macintosh partition, the smallest file size allowed is 32K. If you save a TeachText file with one character in it, it would take up 32K of disk space. A non-empty file fork always occupies at least one allocation block, no matter how many bytes of data the file fork contains. If the data fork and resource fork of a file contain data, the file uses two allocation blocks. If all the files are only one allocation block long, then there can be as many files on the volume as there are allocation blocks for the volume. However, when a file is longer than one allocation block, the total number of possible files decreases. For example, on a volume with 65,535 allocations block, you can have:
All of the numbers above refer to the system's record structures. Other elements place tighter restrictions on the actual number of usable files in the root directory. The Standard File dialog uses the List Manager. The List Manager has a limit of 32K of data, which is somewhere between 800 and 900 files. Though more files can be handled in a directory, the List Manager will not display the first 32K. A second element concerns the performance of the Finder when you have approximately 800 to 900 files per directory. Even simple operations, such as moving the icon of a file, tend to slow down considerably when this many files exist in a directory. This limitation changes depending on the speed of the individual Macintosh model. Determining Allocation Block SizeTo calculate the allocation block size:
So larger hard drives mean larger allocation blocks, and consequently, more wasted space for small files. If you have a large drive with a lot of small files, the hard drive space is being used less efficiently than if most of your files average 32K in size. NOTE: Since drives come from different manufacturers, it is possible to get different values. For example, 500 megabyte drive might be slightly larger than 500 megabytes. This would result in different logical block sizes than those listed in the Allocation Block Size Table below. The difference is typically not more than 512 bytes. The difference is most noticeable on the larger drives. For example, a 500 megabyte drive has a logical block size of 8192 bytes. But the 500 MB drive in some Macintosh computers is actually 540 MB, which has a logical block size of 8704. Allocation Block Size TableHere is a complete list of allocation block sizes for the various volume sizes, based on the formula described above:
HFS Volume OrganizationThe first two logical blocks (labeled 0 and 1) of a volume are the boot blocks. This is where the information for mounting the volume is stored.The third logical block (labeled 2) is the Master Directory Block, or MDB for short. This block contains part of the data structure of a flat directory volume. It contains the volume information and the volume allocation block map. This block is where the information for the hard disk, such as number of files in the directory and the last time the drive was initialized, is stored. Logical blocks 3 to x (see the following table) contain the volume bitmap. This block is a data structure containing a sequence of bits, one bit for each allocation block. The volume bitmap stores a reference to every piece of data that is in the allocation blocks and indicates whether the block is allocated or free for use. Volume bitmaps exist both on hierarchical directory volumes and in memory. Volumes may have as few as 32,768 allocation blocks and as many as 65,536 allocation blocks. This table defines what logical block the volume bitmap ends on based on the number of allocation blocks:
Allocation blocks begin after the volume bitmap. The catalog, extents and data files are contained in the allocation blocks. The catalog file is a list of all files and folders stored in a volume. The catalog file maintains the relationships between the files and directories on a hierarchical directory volume. It corresponds to the file directory on a flat directory volume. The catalog file is organized and accessed using a B-tree structure. The files are arranged in alphabetical order evenly balanced on the tree so that finding a Z does not take any longer than finding an A. This structure is the glue that keeps the catalog file together. The extents tree file contains the locations of all the files on a volume. (An extent is a series of contiguous allocation blocks). The extents tree file is where the information about the data files you have created is stored (such as where to find file, and how many extents a file is divided into). Any file you create may be broken up into multiple extents. The extents are linked together, behind the scenes, with information from the extents tree file to give the appearance of one data file. The next, and largest, section of the volume contains all the actual data files and applications which are referenced using the above files. The next to last block on the hard disk contains the alternate master directory. This alternate is a backup to the MDB kept on logical block 2. It is used when the file manager determines that the MDB is corrupt and needs to be rewritten with the correct information. The very last block is empty. It is used to check for bad sections of the hard disk. Decreasing The File Size On Large Hard DrivesTo decrease the file size on a large hard drive, partition larger drives into smaller partitions or logical drives, each with a maximum of 65,536 blocks. However, Apple does not offer a tool for creating multiple Macintosh partitions for System 7.1. Future versions of the operating system and HD SC Setup will support smaller file sizes on larger hard drives.The following third-party utilities offer a solution for creating multiple Macintosh partitions:
MORE INFORMATIONFor additional information, please click the article number below to view the article in the Microsoft Knowledge Base:Q162468 Volume Creation Date Is Not Reported Correctly from WinNT Server Additional query words: prodnt Macintosh Connectivity 65536 32767 gb
Keywords : kbnetwork ntmac NTSrv |
Last Reviewed: September 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |