Skip to content

Commit 652ecd1

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. Signed-off-by: Hugo Osvaldo Barrera <[email protected]>
1 parent e366377 commit 652ecd1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/sw/partitioning-cheatsheet.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ Warning: Some of Apple's tools do not like unsorted partitions in the GPT partit
4343

4444
`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.
4545

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

4856
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.
4957

0 commit comments

Comments
 (0)