Skip to content

Commit 4fd8ef5

Browse files
committed
Improve description of subvolumes and containers
This isn't a hack; it's the same approach taken by other filesystems with subvolumes. Mention this explicitly. Explain that containers are exposed as disks on their own right. A conclusion was made based on this fact, but it was not explicitly called out.
1 parent 28f210d commit 4fd8ef5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/Partitioning-cheatsheet.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ Warning: Some of Apple's tools do not like unsorted partitions in the GPT partit
3939

4040
`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.
4141

42-
`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.
42+
`diskN` (`N` >= 1) could be a disk image or an external disk, but more likely
43+
is an *APFS container*. Each *APFS container* contains multiple subvolumes,
44+
much like btrfs or zsh partitions contain multiple subvolumes. The "partitions"
45+
within such a disk aren't real partitions, they just represent volumes within
46+
one APFS container. The container itself exists within a physical partition in
47+
`disk0`, but is exposed as a separate disk on its own right too. That means
48+
that for APFS operations, for example, `disk0s2` and `disk1` could mean the
49+
same thing, the former referencing the container by its physical partition, and
50+
the latter by the virtual (*synthesized*) disk number.
4351

4452
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.
4553

0 commit comments

Comments
 (0)