> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/ask/flat/chapter-26-other-file-systems/di-26.3-jie-macos-wen-jian-xi-tong.md).

# 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:

```sh
# pkg install libfsapfs
```

Install using Ports:

```sh
# 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:

```sh
# kldload fusefs
```

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

```sh
# 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:

```sh
# gpart show -p nda1
=>    34  195286    nda1  GPT  (95M)
      34       6          - free -  (3K)
      40  195280  nda1p1  apple-apfs  (95M)
```

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

```sh
# file -s /dev/nda1p1
/dev/nda1p1: Apple File System (APFS), blocksize 4096
```

### Mounting APFS Volumes

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

```sh
# fsapfsmount /dev/nda1p1 /mnt
```

Verify the mount status and view contents:

```sh
# ls /mnt/
/mnt/.DS_Store      /mnt/.Trashes/      /mnt/evidence.json  /mnt/README.md
/mnt/.fseventsd/    /mnt/container/     /mnt/image/
```

> **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:

```sh
# pkg install fusefs-hfsfuse
```

Install using Ports:

```sh
# cd /usr/ports/filesystems/hfsfuse/
# make install clean
```

### Loading the fusefs Kernel Module

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

```sh
# kldload fusefs
```

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

```sh
# sysrc kld_list+=fusefs
```

### Identifying HFS/HFS+ Volumes

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

```sh
# file -s /dev/ada0
/dev/ada0: Apple HFS Plus version 4 data (mounted) last mounted by: 'HFSJ', created: Thu Jan 29 17:33:30 2009, last modified: Thu Jan 29 17:33:36 2009, last checked: Thu Jan 29 17:33:30 2009, block size: 4096, number of blocks: 2560, free blocks: 444
```

### 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**:

```sh
# hfsfuse /dev/ada0 /mnt
```

Verify the mount status

```sh
# mount
/dev/ada0 on /mnt (fusefs.hfs, read-only)

……irrelevant output omitted……

# df -hl
/dev/ada0       10M    8.3M    1.7M    83%    /mnt
```

View contents:

```sh
# ls /mnt
.Trashes	.fseventsd	file1.txt	file2.txt
# cat file1.txt
This is file 1 - snarf
```

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

## References

* Apple. Apple File System Reference\[EB/OL]. \[2026-03-25]. <https://developer.apple.com/support/downloads/Apple-File-System-Reference.pdf>. Apple's official APFS technical documentation.
* FreeBSD Forums. Mounting APFS partition\[EB/OL]. \[2026-03-25]. <https://forums.freebsd.org/threads/mounting-apfs-partition.69094/>. FreeBSD forum discussion on APFS mount support.
* libfsapfs Project. GitHub Repository\[EB/OL]. \[2026-03-25]. <https://github.com/libyal/libfsapfs>. libfsapfs open source project repository.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/ask/flat/chapter-26-other-file-systems/di-26.3-jie-macos-wen-jian-xi-tong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
