Is a Container, Volume, or Partition all the Same?

Containers Volumes, Partitions, and File Systems All Come Into Play

Disk Utility and APFS file system.
APFS file system uses containers to house multiple volumes within. Screen shot courtesy of Coyote Moon, Inc.

Definition:

A volume is a storage container that has been formatted with a file system that your computer (in this case, a Mac) can recognize. Common types of volumes include CDs, DVDs, SSDs, hard drives, and partitions or sections of SSDs or hard drives.

Volume vs. Partition

A volume is sometimes referred to as a partition, but in the strictest sense, that's incorrect. Here's why: A hard drive may be divided into one or more partitions; each partition takes up space on the hard drive.

For example, consider a 1 TB hard drive that has been divided into four 250 GB partitions. The first two partitions were formatted with standard Mac file systems; the third partition was formatted with a Windows file system; and the final partition was either never formatted, or was formatted with a file system that the Mac doesn't recognize. The Mac will see the two Mac partitions and the Windows partition (because the Mac can read Windows file systems), but it won't see the fourth partition. It's still a partition, but it's not a volume, because the Mac can't recognize any file system on it.

Once your Mac recognizes a volume, it will mount the volume on the desktop, so you can access any data it contains.

Logical Volumes

So far, we've looked at volumes and partitions, where a volume was made up of a single partition on a single physical drive that had been formatted with a file system; this is by far the most common form a volume will take.

However, it isn't the only type of volume. A more abstract type, known as a logical volume, isn't limited to a single physical drive; it can be made up of as many partitions and physical drives as needed.

Logical volumes are a means for allocating and managing space on one or more mass storage devices.

You can think of it as a layer of abstraction that separates the OS from the physical devices that make up the storage medium. A basic example of this is RAID 1 (mirroring), where multiple volumes are presented to the OS as a single logical volume. RAID arrays can be performed by a hardware controller or by software, but in both cases, the OS isn't aware of what's physically making up the logical volume. It could be one drive, two drives, or many drives. The number of drives making up the RAID 1 array can change over time, and the OS is never aware of these changes. All the OS ever sees is a single logical volume.

The benefits are enormous. Not only is the physical device structure independent of the volume seen by the OS, it can be managed independently of the OS, which can allow for very simple or very complex data storage systems.

In addition to RAID 1, the other common RAID systems make use of multiple volumes that are shown to the OS as a single logical volume. But RAID arrays aren't the only storage system that makes use of a logical volume.

Logical Volume Manager (LVM)

Logical volumes are pretty interesting; they let you create a volume that can be made up of partitions located on multiple physical storage devices.

While conceptually easy to understand, managing such a storage array can become difficult; that's where the LVM (Logical Volume Manager) comes in.

The LVM takes care of managing a storage array, including allocating partitions, creating volumes, and controlling how the volumes interact with each other; for instance, if they will work together to support stripping, mirroring, spanning, resizing, or even more complex processes, such as data encryption or tiered storage.

Since OS X Lion was introduced, the Mac has had an LVM system known as core storage. The core storage system was first used to provide the full-disk encryption system used by Apple’s File Vault 2 system.

Then, when OS X Mountain Lion was released, the core storage system gained the ability to manage a tiered storage system that Apple called a Fusion drive.

Over time, I expect Apple to add more capabilities to the core storage system,ß beyond its current ability to dynamically resize partitions, encrypt data, or use the Fusion storage system.

Containers

With the addition of the APFS (Apple File System) added with the release of macOS High Sierra, containers take on a new special organizational space in the file system.

APFS is all about containers, a logical construct of space that can contain one or more volumes. There can be multiple containers each of which makes use of the APFS file system. individual volumes within an APFS container must use the APFS file systems.​​

When all of the volumes within a container use the APFS file system, they can share the space available in the container. This allows you to grow a volume that needs additional storage space by using any free space from within the container. Unlike partitions, that can take space from an adjacent partition volumes within a container can make use of space anywhere within the container, it does not need to be adjacent to the volume.