In this chapter, you will examine the storage technology used by Mac OS X. Storage hardware like disk drives and RAID will be covered alongside logical storage concepts like partitions and volumes. You will learn how to properly manage and troubleshoot these storage assets and to manage storage security through ownership, permissions, and access control lists (ACLs).

Although personal computer processor speed has increased around one-thousandfold since the first Mac was introduced in 1984,
storage capacity has easily increased a million times over. Compare 1984’s 400 KB floppy to today’s average desktop drive
at 500 GB, which is roughly equivalent to 524,288,000 KB, or 1.4 million 400 KB floppies. Users have responded by moving thousands
of pictures and hundreds of hours of music and video, historically stored in analog form, to the convenience and dynamism
of digital storage. Likewise, enterprise customers have replaced filing cabinets and storage rooms with Redundant Array of
Independent Disks (RAID) arrays and backup tapes. Even though the Internet recently changed our perception of what a computer
is used for, it’s clear that the computer’s primary task is still that of a tool to organize, access, and store our stuff.

In this chapter, you will examine the storage technology used by Mac OS X. Storage hardware like disk drives and RAID will
be covered alongside logical storage concepts like partitions and volumes. Naturally, you will learn how to properly manage
and troubleshoot these storage assets as well. Finally, you will also learn to manage storage security through ownership,
permissions, and access control lists (ACLs).

File System Components

Before you begin managing storage on Mac OS X, it is important to understand the distinction between storage, partitions,
and volumes. Traditionally, computer storage has been defined by disk drive hardware. After all these years, disk drive hardware
still maintains the storage lead, as it has moved from removable floppy disks to enclosed hard disks. However, other more
convenient removable formats have become extremely popular as they have increased in capacity. This includes optical media
like CDs and DVDs and solid-state storage like SSD, USB key drives, and CompactFlash cards. All are equally viable storage
destinations for Mac OS X.

Without proper formatting, though, any storage technology is nothing more than a big empty bucket of ones and zeros, and consequently
not very useful to the Mac. Formatting is the process of applying logic to storage in the form of partitions and volumes.
Partitions are used to define boundaries on a storage device. You can define multiple partitions if you want the physical
storage to appear as multiple separate storage destinations. Even if you want to use the entire space available on a device
as a single contiguous storage location, the area must still be defined by a partition.

Once partitions have been established, the system can create usable volumes inside the partition areas. Volumes define how
the files and folders are actually stored on the hardware. In fact, it’s the volume that is ultimately mounted by the file
system and then represented as a usable storage icon in the Finder. Obviously, a storage device with several partitions, each
containing a separate volume, will appear as several storage location icons in the Finder.

Partition Schemes

As mentioned earlier, drives must be partitioned in order to define and possibly segregate the drive’s usable space. Every
disk requires at least one partition, but Mac OS X can support up to 16 partitions per disk. You learned the advantages and
disadvantages of using single or multiple partitions in Chapter 1, “Installation and Initial Setup.”

Mac OS X supports three different types of partition schemes. This may seem excessive, but it’s necessary for Macs to support
multiple partition schemes in order to boot computers using modern Intel processors, support older Mac drives, and use standard
PC-compatible volumes.

The three partition schemes supported by Mac OS X are:

GUID Partition Table (GPT)—This is the default partition scheme used by Intel-based Macs. This is also the only partition scheme supported for Intel-based
Macs to start up using disk-based storage. However, PowerPC-based Macs running Mac OS X version 10.4.6 or later can also access
this type of partitioning, but they will not be able to boot from it.

Apple Partition Map (APM)—This is the default partition scheme used by older PowerPC-based Macs. This is also the only partition scheme that PowerPC-based
Macs can start up from. However, all Intel-based Macs can also access this type of partitioning.

Master Boot Record (MBR)—This is the default partition scheme used by most non-Mac computers, including Windows-compatible PCs. Consequently, this
is the default partition scheme you will find on most new preformatted storage drives. This partition scheme is also commonly
used by peripherals that store to flash drives such as digital cameras or smart phones. Even though no Mac can boot from this
type of partitioning, all Macs can access MBR partitioning.

Obviously, if you have any additional drives formatted with APM or MBR, you will have to repartition those drives in order
for them to be bootable on an Intel-based Mac. But if you don’t plan on ever using the additional drives as a system disk,
there is no advantage to repartitioning. Also, you should keep MBR drives unmodified if you intend to keep those drives backward-compatible
with generic PCs or peripherals.

TIP

Intel-based Macs can start up from both USB and FireWire external drives.

Volume Formats

The volume format defines how the files and folders are saved to the drive. To maintain compatibility with other operating
systems and provide advanced features for newer Mac systems, Mac OS X supports a variety of storage volume formats.

Volume formats supported as startup volumes for Mac OS X:

Mac OS Extended (Hierarchical File System Plus, HFS+)—Mac OS Extended, also known as HFS+, is the legacy volume format designed and supported by Apple for Macintosh computers.
HFS+ itself is an update from the earlier Mac OS Standard (HFS) format. HFS+ supports all the advanced features required by
Mac OS X, including Unicode filenames, rich metadata, POSIX Permissions, access control lists (ACLs), UNIX-style links, and
aliases.

Mac OS Extended, Case-Sensitive (HFSX)—This Mac OS Extended format adds case sensitivity to the file system. Normally Mac OS Extended is case-preserving but case-insensitive.
This means that a normally formatted Mac volume will remember what case you chose for the characters of a file’s name, but
it cannot differentiate between similar filenames where the only difference is the case. In other words, it would not recognize
“MYfile” and “myfile” as different filenames. By adding support for case sensitivity, Apple resolved this issue. However,
this is generally an issue only for volumes that need to support traditional UNIX clients, like those shared from Macs or
Xserves running Mac OS X Server.

Mac OS Extended, Journaled (JHFS+) or Mac OS Extended, Case-Sensitive, Journaled (JHFSX)—This feature, enabled by default on Mac OS X, is an option for the Mac OS Extended format that adds advanced file system journaling
to help preserve volume structure integrity. The journal records what file operations (creation, expansion, deletion, and
so on) are in progress at any given moment. If the system crashes or loses power, the journal can be “replayed” to make sure
operations in progress are completed, rather than being left in a half-completed, inconsistent state. This avoids both the
possibility of volume corruption and the need to run a lengthy check-and-repair process on the volume after a crash.

NOTE

While journaling protects the file structure, it cannot protect the contents of files themselves against corruption. If a
large file was half-written when the system crashed, the journal will make sure that half-file is consistently entered in
the volume’s file-tracking databases, but it’s still only half a file.

Volume formats supported as read/write in Mac OS X:

Mac OS Standard (HFS)—This is the legacy volume format used by the classic Mac OS. This format, though a precursor to HFS+, is not supported as
a startup volume for Mac OS X.

File Allocation Table (FAT)—FAT is the legacy volume format used by Windows PCs and still used by many peripherals. This format has evolved over the years,
with each progressive version supporting larger volumes; FAT12, FAT16, FAT32. Apple’s Boot Camp supports running Windows from
a FAT32 volume, but Mac OS X itself cannot start up from such a volume. Boot Camp is covered in Chapter 6, “Applications and
Boot Camp.”

UNIX File System (UFS)—UFS is the legacy native volume format supported by Mac OS X. UFS served as the default UNIX file system for decades. Starting
with Mac OS X v10.5, though, UFS volumes are no longer supported as startup volumes. Further, Disk Utility does not support
the creation of UFS volumes.

Volume formats supported as read-only in Mac OS X:

NT File System (NTFS)—Windows 7, Windows Vista, Windows XP, and Windows Server all use this as their native volume format. Once again Boot Camp
supports running Windows from an NTFS volume, but Mac OS X itself cannot write to or start up from such a volume. Further,
Disk Utility does not support the creation of NTFS volumes.

TIP

You can add NTFS volume write support to Mac OS X by installing the free and open source NTFS-3G and MacFUSE software bundle:
http://macntfs-3g.blogspot.com.

ISO 9660 or Compact Disk File System (CDFS)—This is a common standard for read-only CD media. Note, however, that “Mac formatted” CD media can contain HFS-formatted volumes.