Skip to content

Improve description of subvolumes and containers #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/sw/partitioning-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ Warning: Some of Apple's tools do not like unsorted partitions in the GPT partit

`disk0` is your NVMe drive. `disk0sN` is a GPT partition within it. `N` is *not* stable and is allocated dynamically by the macOS kernel. It does *not* correspond to the physical slot index in the GPT, nor does it correspond to the physical order of the partition data in the drive. Any time you create a partition, N can be allocated to a different number, and they can all be renumbered on reboot.

`diskN` (`N` >= 1) could be a disk image or an external disk, but more likely is an *APFS container*. This is a hack that Apple came up with to represent subvolumes. The "partitions" within such a disk aren't real partitions, they just represent volumes within one APFS container. The container itself exists within a physical partition in `disk0`. That means that for APFS operations, for example, `disk0s2` and `disk1` could mean the same thing, the former referencing the container by its physical partition, and the latter by the virtual (*synthesized*) disk number.
`diskN` (`N` >= 1) could be a disk image or an external disk, but more likely
is an *APFS container*. Each *APFS container* contains multiple subvolumes,
much like btrfs or zsh partitions contain multiple subvolumes. The "partitions"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean zfs here?

within such a disk aren't real partitions, they just represent volumes within
one APFS container. The container itself exists within a physical partition in
`disk0`, but is exposed as a separate disk on its own right too. That means
that for APFS operations, for example, `disk0s2` and `disk1` could mean the
same thing, the former referencing the container by its physical partition, and
the latter by the virtual (*synthesized*) disk number.

Multiple macOS installs can share one APFS container. Each OS has a *volume group* consisting of two paired subvolumes, a *System* volume and a *Data* volume. There are extra volumes: `Preboot`, `Recovery`, `VM`, `Update`. These are shared between all OSes in that container. Not all of them necessarily exist.

Expand Down