한국   대만   중국   일본 
Macintosh: File System Specifications and Terms
The Wayback Machine - https://web.archive.org/web/20080508023713/http://docs.info.apple.com:80/article.html?artnum=8647
You are invited to take part in a short survey to help us improve your
Apple Support online experience. Please click Yes if you would like to participate.

Macintosh: File System Specifications and Terms

  • Last Modified on: January 17, 2007
  • Article: 8647
This document explains: the limitations of the Mac OS Standard format (HFS), the practical limits after which performance suffers, and the Mac OS Extended format (HFS Plus).


This document explains some of the terminology involved when speaking about volumes and the file system. It also explains why different formats on different hard drives can cause small files to take up more space on a larger drive than they do on a smaller drive. For more information on Mac OS Extended Format, and Volume and file limits in Mac OS 9, please see the following technical documents:

Document 30344: " Mac OS: About Mac OS Extended Format "
Document 24601: " Mac OS Extended Format: Volume and File Limits "

Mac OS Standard Format Specifications
Before discussing hard drive block allocation, and the intricacies of determining allocation block sizes and such, let's first review the Macintosh Standard format, sometimes called HFS.

Below are some specifications and associated terminology used to describe the Macintosh Standard format structure.

Volume
A volume is either a full disk, or a section of a disk, partitioned into separate parts. If you partition a single drive then each partition is considered a volume.

  • The maximum volume size under System 6 and System 7 is 2 GB. System 7.5 increased that limit to 4 GB and System 7.5.2 (and later) increases that limit to 2 TB on some computers, including:
-
any computer that came with System 7.5.2 or newer.
-
any Macintosh computer with PCI slots.
  • The maximum number of volumes is theoretically limited to 173 due to the maximum number of open files in the Mac OS. Since there are other files that are opened when the computer boots up, the actual maximum will vary depending upon how many other files are open by the operating system.
  • The maximum file size is 2 GB.
  • The maximum number of files on a volume is 65,536.
  • The maximum number of files in a folder is 32,767.
  • The maximum size of the data fork in a file is 2 GB.
  • The maximum size of the resource fork in a file is 16 megabytes.

Note that AppleShare, including Personal File Sharing, has its own volume size limitations. For more information, please see technical document 15460: " AppleShare File Server: Chart Of All Limitations "

Logical block
A 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 hard disk. Take the volume size, divide it by 512 bytes, and you have the number of logical blocks.

Allocation block
An 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.


In both the Macintosh and DOS environments, the maximum number of blocks on a driver is 65,536 because both operating systems address the allocation blocks with a 16-bit address. Drives larger than 512 MB cannot use a block size of 8K or less because there just aren't enough addresses. Thus, if a 2 GB drive is one Macintosh partition, the smallest file size allowed is 32K. (If you save a SimpleText file with one character in it, it would take up 32K of disk space.) This means that the size of your hard drive determines the minimum size of each file.

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:

  • 65,536 files, each 1 allocation block long.
  • 32,768 files, each 2 allocation blocks long.
  • 2048 files, each 32 allocation blocks long.
  • 1024 files, each 64 allocation blocks long.

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 only display the first 32K.

A second element concerns the performance of the Finder when approaching 800 to 900 files per directory. Even simple operations, such as moving the icon of a file, tend to slow down considerably when this number of files exists in a directory. This limitation changes depending on the speed of the individual Macintosh model.

Determining Allocation Block Size
Follow these steps to calculate the allocation block size:

1. Take the size of the drive in megabytes and multiply it by 2000 (there are 2000 disk blocks in 1 MB of disk space).
2. Divide that number by 65,536, since the Macintosh cannot have more than 65,536 allocation blocks.
3. Round this number up and multiply it by 512.
The result is the number of bytes in the allocation block. Here is an example using a 230 MB drive:

  • 230 x 2000 / 65536 = 7.019
  • 7.019 rounded up = 8
  • 8 x 512 = 4096 bytes
So what does this mean to you? The larger the hard drive, the larger the allocation block size, and the more space that is wasted on 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. This is because a 500 MB drive is not exactly 500 MB but is usually somewhat larger. This could result in different logical block sizes than those listed in the chart (see Allocation Block Size Table below), but the difference should not be more than +/- 512 bytes. This difference is most noticeable on the larger drives. For example, the 500 MB drive actually calculates to 8192 bytes but the 500 MB drive in some Macintosh computers is actually 540 MB, which has a logical block size of 8704, as listed in the chart.

Allocation Block Size Table
Here is a complete list of allocation block sizes for the various volume sizes, based on the formula described above:

Volume Size     Allocation Block Size         Minimum file size

       0-32 MB       1 logical block           0.5K
      33-64 MB       2 logical blocks          1.0K
      65-96 MB       3 logical blocks          1.5K
     97-128 MB       4 logical blocks          2.0K
    129-160 MB       5 logical blocks          2.5K
    161-192 MB       6 logical blocks          3.0K
    193-224 MB       7 logical blocks          3.5K
    225-256 MB       8 logical blocks          4.0K
    257-288 MB       9 logical blocks          4.5K
    289-320 MB      10 logical blocks          5.0K
    321-352 MB      11 logical blocks          5.5K
    353-384 MB      12 logical blocks          6.0K
    385-416 MB      13 logical blocks          6.5K
    417-448 MB      14 logical blocks          7.0K

    449-480 MB      15 logical blocks          7.5K
    481-512 MB      16 logical blocks          8.0K
    513-544 MB      17 logical blocks          8.5K
    545-576 MB      18 logical blocks          9.0K
    577-608 MB      19 logical blocks          9.5K
    609-640 MB      20 logical blocks         10.0K
    641-672 MB      21 logical blocks         10.5K
    673-704 MB      22 logical blocks         11.0K
    705-736 MB      23 logical blocks         11.5K
    737-768 MB      24 logical blocks         12.0K
    769-800 MB      25 logical blocks         12.5K
    801-832 MB      26 logical blocks         13.0K
    833-864 MB      27 logical blocks         13.5K
    865-896 MB      28 logical blocks         14.0K
    897-928 MB      29 logical blocks         14.5K
    929-960 MB      30 logical blocks         15.0K
    961-992 MB      31 logical blocks         15.5K
   993-1024 MB      32 logical blocks         16.0K
  1025-1056 MB      33 logical blocks         16.5K
  1057-1088 MB      34 logical blocks         17.0K

  1089-1120 MB      35 logical blocks         17.5K
  1121-1152 MB      36 logical blocks         18.0K
  1153-1184 MB      37 logical blocks         18.5K
  1185-1216 MB      38 logical blocks         19.0K
  1217-1248 MB      39 logical blocks         19.5K
  1249-1280 MB      40 logical blocks         20.0K
  1281-1312 MB      41 logical blocks         20.5K
  1313-1344 MB      42 logical blocks         21.0K
  1345-1376 MB      43 logical blocks         21.5K
  1377-1408 MB      44 logical blocks         22.0K
  1409-1440 MB      45 logical blocks         22.5K
  1441-1472 MB      46 logical blocks         23.0K
  1473-1504 MB      47 logical blocks         23.5K
  1505-1536 MB      48 logical blocks         24.0K
  1537-1568 MB      49 logical blocks         24.5K
  1569-1600 MB      50 logical blocks         25.0K
  1601-1632 MB      51 logical blocks         25.5K
  1633-1664 MB      52 logical blocks         26.0K
  1665-1696 MB      53 logical blocks         26.5K
  1697-1728 MB      54 logical blocks         27.0K

  1729-1760 MB      55 logical blocks         27.5K
  1761-1792 MB      56 logical blocks         28.0K
  1793-1824 MB      57 logical blocks         28.5K
  1825-1856 MB      58 logical blocks         29.0K
  1857-1888 MB      59 logical blocks         29.5K
  1889-1920 MB      60 logical blocks         30.0K
  1921-1952 MB      61 logical blocks         30.5K
  1953-1984 MB      62 logical blocks         31.0K
  1985-2016 MB      63 logical blocks         31.5K
  2017-2048 MB      64 logical blocks         32.0K
  2049-2080 MB      65 logical blocks         32.5K
  2081-2112 MB      66 logical blocks         33.0K
  2113-2144 MB      67 logical blocks         33.5K
  2145-2176 MB      68 logical blocks         34.0K
  2177-2208 MB      69 logical blocks         34.5K
  2209-2240 MB      70 logical blocks         35.0K
  2241-2272 MB      71 logical blocks         35.5K
  2273-2304 MB      72 logical blocks         36.0K
  2305-2336 MB      73 logical blocks         36.5K
  2337-2368 MB      74 logical blocks         37.0K

  2369-2400 MB      75 logical blocks         37.5K
  2401-2432 MB      76 logical blocks         38.0K
  2433-2464 MB      77 logical blocks         38.5K
  2465-2496 MB      78 logical blocks         39.0K
  2497-2528 MB      79 logical blocks         39.5K
  2529-2560 MB      80 logical blocks         40.0K
  2561-2592 MB      81 logical blocks         40.5K
  2593-2624 MB      82 logical blocks         41.0K
  2625-2656 MB      83 logical blocks         41.5K
  2657-2688 MB      84 logical blocks         42.0K
  2689-2720 MB      85 logical blocks         42.5K
  2721-2752 MB      86 logical blocks         43.0K
  2753-2784 MB      87 logical blocks         43.5K
  2785-2816 MB      88 logical blocks         44.0K
  2817-2848 MB      89 logical blocks         44.5K
  2849-2880 MB      90 logical blocks         45.0K
  2881-2912 MB      91 logical blocks         45.5K
  2913-2944 MB      92 logical blocks         46.0K
  2945-2976 MB      93 logical blocks         46.5K
  2977-3008 MB      94 logical blocks         47.0K

  3009-3040 MB      95 logical blocks         47.5K
  3041-3072 MB      96 logical blocks         48.0K
  3073-3104 MB      97 logical blocks         48.5K
  3105-3136 MB      98 logical blocks         49.0K
  3137-3168 MB      99 logical blocks         49.5K
  3169-3200 MB     100 logical blocks         50.0K
  3201-3232 MB     101 logical blocks         50.5K
  3233-3264 MB     102 logical blocks         51.0K
  3265-3296 MB     103 logical blocks         51.5K
  3297-3328 MB     104 logical blocks         52.0K
  3329-3360 MB     105 logical blocks         52.5K
  3361-3392 MB     106 logical blocks         53.0K
  3393-3424 MB     107 logical blocks         53.5K
  3425-3456 MB     108 logical blocks         54.0K
  3457-3488 MB     109 logical blocks         54.5K
  3489-3520 MB     110 logical blocks         55.0K
  3521-3552 MB     111 logical blocks         55.5K
  3553-3584 MB     112 logical blocks         56.0K
  3585-3616 MB     113 logical blocks         56.5K
  3617-3648 MB     114 logical blocks         57.0K

  3649-3680 MB     115 logical blocks         57.5K
  3681-3712 MB     116 logical blocks         58.0K
  3713-3744 MB     117 logical blocks         58.5K
  3745-3776 MB     118 logical blocks         59.0K
  3777-3808 MB     119 logical blocks         59.5K
  3809-3840 MB     120 logical blocks         60.0K
  3841-3872 MB     121 logical blocks         60.5K
  3873-3904 MB     122 logical blocks         61.0K
  3905-3936 MB     123 logical blocks         61.5K
  3937-3968 MB     124 logical blocks         62.0K
  3969-4000 MB     125 logical blocks         62.5K
  4001-4032 MB     126 logical blocks         63.0K
  4033-4064 MB     127 logical blocks         63.5K
  4065-4096 MB     128 logical blocks         64.0K

Volume Organization of Macintosh Standard Format
The 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            Last Volume Bitmap Logical Block
.
.      > 61,440                                         18
.      > 57,344                                         17
.      > 53,248                                         16
.      > 49,152                                         15
.      > 45,056                                         14
.      > 40,960                                         13
.      > 36,864                                         12
.      > 32,768                                         11


Allocation blocks begin after the volume bitmap. Contained in the allocation blocks are the catalog, extents and data files.

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" doesn't 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 (such as where to find file, and how many extents a file is divided into) about the data files you have created is stored. Any given file you create may be broken up into multiple extents. When extents are linked together, behind the scenes, with information from the extents tree file, the appearance is 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.

What You Can Do
So, can you do anything to decrease the file size on a large hard drive? One solution is to partition larger drives into smaller partitions, or logical drives, each with a maximum of 65,536 blocks.

Apple's Drive Setup can be used to partition qualified Apple hard drives and some removable devices as listed in the Drive Setup Guide file. Unsupported hard drives will show up in the device list by name, however, if you select an unsupported hard drive you will get the message, "Cannot modify a disk in an unsupported drive."


Drive Setup is supported on all of the Power Macintosh computers. This includes the original Power Macintosh computers and the new PCI-based Power Macintosh computers. Drive Setup is also compatible with 68040 and 68LC040 processor-based systems that have IDE drives installed. Drive Setup is not supported with the Power Macintosh Upgrade Card. Drive Setup 1.0.2 is available from online services.

There are third parties that offer a solution for creating multiple Macintosh partitions on Macintosh systems not supported by Drive Setup. A few are:

  • Hard Disk Toolkit (HDT) by FWB Software, Inc.
  • Silverlining by La Cie Ltd.
  • Micronet Utility by MicroNet Technology
  • MicroTech Utility by MicroTech International
  • Drive 7 by Casa Blanca Works, Inc.

Mac OS Extended Format
In 1998, concurrent with the release of Mac OS 8.1, Apple released a new file system format known as Mac OS Extended Format (sometimes referred to as HFS Plus). For more information on Mac OS Extended Format, please see the following technical documents:

30344: " Mac OS 8.1: About Mac OS 8.1 Extended Format "
24601: " Mac OS Extended Format: Volume And File Limits "

This document provides information about a non-Apple product. Apple, Inc. is not responsible for its content. Please contact the vendor for additional information. Document 17159: " Locating Vendor Information " can help you search for a particular vendor's address and phone number.

Keywords: kswreview ktech
Did this article help you?

It solved my issue...
Tell us what works for you.

It's good, but...
Report typos, inaccuracies, etc.

It wasn't helpful...
Tell us what would have helped.