For the complete documentation index, see llms.txt. This page is also available as Markdown.

26.3 macOS File Systems

FreeBSD provides support for macOS file systems, including HFS/HFS+ and APFS, for accessing storage devices formatted for Apple systems.

APFS File System

Apple File System (APFS) is a next-generation file system developed by Apple, which has been the default file system for macOS since macOS High Sierra. On FreeBSD, read-only access to APFS partitions can be achieved through libfsapfs.

Installing libfsapfs

Install the libfsapfs package using pkg:

# pkg install libfsapfs

Install using Ports:

# cd /usr/ports/filesystems/libfsapfs/
# make install clean

Loading the fusefs Kernel Module

Before using FUSE file systems, the fusefs(4) kernel module must be loaded:

# kldload fusefs

Use sysrc(8) to configure the module to load automatically at boot:

# sysrc kld_list+=fusefs

Identifying APFS Volumes

After connecting a disk containing APFS volumes to the computer, use gpart to view partition information. APFS volumes are typically displayed as the apple-apfs type:

The file command can be used to more precisely identify the file system type:

Mounting APFS Volumes

Use libfsapfs to mount APFS volumes. Mount the APFS volume /dev/nda1p1 to /mnt:

Verify the mount status and view contents:

Note

Currently, libfsapfs only provides read-only support; write operations are not available.

HFS/HFS+ File Systems

Note

HFS/HFS+ was the primary file system for macOS before the introduction of APFS. Since macOS High Sierra (2017), APFS has replaced HFS+ as the default file system; since macOS Catalina, the system volume must use APFS. HFS+ now exists only on older Mac devices and external storage formatted with HFS+, and is only applicable for scenarios requiring access to such legacy storage.

FreeBSD provides read-only support for HFS/HFS+ through the filesystems/hfsfuse package.

To use HFS/HFS+ on FreeBSD, install the filesystems/hfsfuse package, load the FUSE kernel module, and mount the file system as follows:

Installing the HFS/HFS+ Package

Install using pkg:

Install using Ports:

Loading the fusefs Kernel Module

Before using FUSE file systems, the fusefs(4) kernel module must be loaded:

Use sysrc(8) to configure the module to load automatically at boot:

Identifying HFS/HFS+ Volumes

The file command can be used to identify the file system type:

Mounting HFS/HFS+ Volumes

Mount the HFS/HFS+ volume by specifying its FreeBSD partition name and a mount point (which must already exist). The following example mounts /dev/ada0 to /mnt:

Verify the mount status

View contents:

Note

Currently, fusefs-hfsfuse only provides read-only support; write operations are not available, and there are currently no plans for write support.

References

Last updated