NEWFS_APFS(8)

NAME
newfs_apfs - construct a new APFS volume

SYNOPSIS
newfs_apfs [-o options] [-b block-size] [-s volume-size | -q volume-quota -r volume-reserve] [-v volume-name] [-E | -P] special
newfs_apfs -C [-o options] [-b block-size] special
newfs_apfs -A [-o options] [-s volume-size | -q volume-quota -r volume-reserve] [-v volume-name] [-E | -P] special
newfs_apfs [-o options] [-s volume-size | -q volume-quota -r volume-reserve] [-v volume-name] [-E | -P] special

DESCRIPTION
The newfs_apfs command creates a new APFS container on the device and/or adds a new APFS volume to a container.

The first, more traditional, form of newfs_apfs formats the given special as a container with a single volume inside it. The second form creates a container only, with no volumes. The third form is used to non-destructively add additional volumes inside an existing container. The fourth form reformats an existing volume by effectively deleting and re-creating it; in this usage (only) special indicates a volume inside the container.

The special parameter should be the path to a disk device node, such as /dev/disk1s2, although can be specified as simply disk1s2.

The options are as follows:

-b block-size
    The block size of the container. All volumes within this container will use this block size. The default is 4096 bytes.

-o options
    Additional (undocumented) formatting options.

-q volume-quota
    Places a quota, or upper limit, on the size of the volume. If specified then no more than this much space will be used for its content, even if there is additional free space in the container; however it is not guaranteed that the entire quota will always be available. By default a volume has no assigned quota.

-r volume-reserve
    Reserves an amount of space for this volume. If specified it is guaranteed that at least this much space will be available for its content; the volume may also grow beyond this size (up to its quota limit, if any) if additional free space in the container. By default a volume has no assigned reserve.

-s volume-size
    The fixed size of the volume. If specified then the volume is guaranteed that exactly this much space will be available for its content. Setting -s is equivalant to setting both -q and -r to that same value. If not specified then the available space is dynamic and determined by the usage of other volumes within the same container (space-sharing).

-v volume-name
    The name of the volume. The default is "untitled".

-A  Add a volume to an existing container. There is a limit to the number of volumes that may reside inside a container.

-C  Create a container only, with no volume. newfs_apfs -A may be used later to format volumes inside that container.

-E  Make the volume "effaceable"; all its data and metadata will be encrypted with a single key (destroying this key results in a fast-wipe).

-P  Enable per-file encryption ("content protection") on the volume. The volume metadata is also encrypted.

DIAGNOSTICS

EXAMPLES
The following formats a new container and volume named "Macintosh" on the /dev/disk1s2 device:
    newfs_apfs -v Macintosh disk1s2

And then this adds another volume, named "Data" with a fixed size of 100 GB, to that container:
    newfs_apfs -v Data -s 100g -A disk1s2

SEE ALSO
mount_apfs(8)

HISTORY
The newfs_apfs utility first appeared in OS X 10.12.