It is interesting to compare features of HFS+ with those of NTFS, the native file system format for Microsoft Windows. In general, NTFS is a more sophisticated file system in terms of built-in features.[28] Table 126 compares some noteworthy aspects of these two file systems.
Table 126. A Comparison of HFS+ and NTFS
Feature/Aspect | HFS+ | NTFS |
---|
Allocation unit | Allocation block (32-bit). | Cluster (64-bit, but limited by Windows to 32 bits). |
Minimum allocation unit size | 512 bytes (must be integral multiple of sector size). | 512 bytes (must be integral multiple of sector size). |
Default allocation unit size | 4KB. | 4KB (for volumes larger than 2GB). |
Maximum volume size | 8 exabytes. | 16 exabytes (the theoretical maximum; Windows limits the maximum volume size to 256TB, with 32-bit clusters). |
Maximum file size | 8 exabytes. | 16 exabytes (the theoretical maximum; Windows limits the maximum file size to 16TB). |
Redundant storage of file-system-critical data | Yes. An alternate volume header is stored on the next-to-last sector. | Yes. A mirror of the master file table is stored immediately following the original. |
Filenames | A filename can have up to 255 Unicode characters. Mac OS X uses UTF-8 encoding. | A filename can have up to 255 Unicode characters. Windows uses UTF-16 encoding. |
Case sensitivity | HFS+ is case-insensitive and case-preserving by default; it has a case-sensitive variant (HFSX). | NTFS supports case sensitivity, but the Win32 environment doesn't. The default system setting for name comparison is case-insensitive. |
Metadata journaling | Yes, through a VFS-level journaling layer. | Yes, the journal is NTFS-specific. |
Multiple data streams | Yes: two inline streams (the data and resource forks), and an arbitrary number of named streams. A named stream is limited to 3802 bytes on Mac OS X 10.4. | Yes: one unnamed stream (the default) and an arbitrary number of named streams. The latter have their own sizes and locks. |
Permissions | Yes. | Yes. |
Access control lists | Yes. | Yes. |
Extended attributes | Yes. | Yes. |
File-system-level search | Yes, through the searchfs() system call. | No. |
Dedicated Startup file | Yes. | Yes (the $Boot file). |
Hard links | Yes. | Yes. |
Symbolic links | Yes, with Unix semantics. | Yes, but semantics differ from Unix. NTFS provides reparse points, using which Unix-like semantics can be implemented. |
Support for resilient "shortcuts" | Yes, through aliases. | Yes, but requires the link-tracking system service. |
Volume quotas | Yes, per-user and per-group quotas. | Yes, per-user quotas. |
Support for sparse files | No. | Yes. |
Built-in compression | No. | Yes. |
Built-in encryption | No. | Yes, through the Encrypting File System (EFS) facility that provides application-transparent encryption. |
Built-in change logging | No. | Yes, through the Change Journal mechanism. |
Support for fault-tolerant volumes | No. | Yes. |
Reserved area for metadata | Yes, the metadata zone. | Yes, the MFT Zone. |
Built-in support for tracking file access and relocating frequently used files | Yes, adaptive Hot File Clustering. | No. |
Support for live resizing | Yes, through the HFS_RESIZE_VOLUME control operation. This support is experimental in Mac OS X 10.4 and requires a journaled volume. It can extend or shrink a mounted file system if several conditions are satisfied. | Yes, through the FSCTL_EXTEND_VOLUME control operation. |
Support for "freezing" the file system | Yes, through the F_FREEZE_FS and F_THAW_FS control operations. | Yes, through volume shadow copying. |
Support for "full" sync | Yes. The F_FULLFSYNC control operation asks the storage driver to flush all buffered data to the physical storage device. | No. |
Support for bulk querying of access permissions | Yes. The HFS_BULKACCESS control operation can determine, in a single system call, whether the given user has access to a set of files. | No. |
User control of the next allocation location | Yes. The HFS_CHANGE_NEXT_ALLOCATION control operation allows the user to specify which block the file system should attempt to allocate from next. | |
Read-only support | Yes. | Yes. |
This concludes our exploration of Mac OS X internalswell, at least as far as this book's chapters are concerned. I hope the book has given you enough background and tools so that you can now continue the journey on your own. Happy Exploring!