Skip to content
Alexey Matveichev edited this page Aug 13, 2021 · 1 revision

APFS volume

Beginning from version 10.13 it is possible to format disks using Apple File System (APFS). One can easily create volumes on existing APFS container, which can be case-sensitive. Since volumes share disk space with container it is not necessary to resize volume (as with disk image).

To create APFS volumes diskutil utility is used. First you need to learn, what APFS container you would like to use, then you create volume with case-sensitive file system.

To search for container diskutil ap list is used. Here is example output from my MacBook Air:

$ diskutil ap list
APFS Container (1 found)
|
+-- Container disk1 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    ====================================================
    APFS Container Reference:     disk1
    Size (Capacity Ceiling):      499963174912 B (500.0 GB)
    ...

To create a volume with case-sensitive file system the following command can be used:

$ diskutil ap addVolume disk1 'Case-sensitive APFS' OpenFOAM -role D

It produces the following output:

Will export new APFS (Case-sensitive) Volume "OpenFOAM" from APFS Container Reference disk1
Started APFS operation on disk1
Preparing to add APFS Volume to APFS Container disk1
Creating APFS Volume
Created new APFS Volume disk1sx
Mounting APFS Volume
Setting volume permissions
Disk from APFS operation: disk1sx
Finished APFS operation on disk1

The volume is automatically mounted upon boot, so there is no need in additional mount commands.

By default volume is mounted into /Volumes/OpenFOAM. According to manpage one can specify mount point during creation of the volume (using -mountpoint flag). Unfortunately this mount point information is not kept upon reboot. Also custom mount point requires administrative rights (i.e. diskutil should be executed using sudo).

Alternatively volume can be created using GUI, refer to Disk Utility documentation for the necessary steps.