How to Mount APFS Disk Volumes

APFS

APFS stands for Apple File System, it’s by default since 2017 on Mac [Book] “Whatever”, and normally it comes encrypted.

The following procedure allows to see what’s the content of a Mac’s HDD/SSD, to be able to backup data or just get rid of macOS.

:arrow_double_up: :white_check_mark: The system should be up-to-date before doing this.

:large_blue_circle: Installing Tools to Build the APFS-Fuse Driver

apt install fuse libfuse-dev libicu-dev bzip2 libbz2-dev cmake clang git libattr1-dev

:large_blue_diamond: Cloning APFS-Fuse Repo

git clone https://github.com/sgan81/apfs-fuse.git

:large_blue_diamond: Folder and Git Actions

cd apfs-fuse &&
git submodule init &&
git submodule update

:large_blue_diamond: Compiling the Source Code

mkdir build &&
cd build &&
cmake .. &&
make

:large_blue_circle: Copying Binaries to a Root Path

sudo cp apfs-* /usr/local/bin

:small_orange_diamond: Finding the macOS Partition

sudo fdisk -l

Find the device identifier, i.e. sdaX (where X is the number from the macOS partition)

:large_blue_circle: Making macOS Entry for File Viewers

sudo mkdir -p /media/$USERNAME/macos
sudo ./apfs-fuse -o allow_other /dev/sdaX /media/<USERNAME>/macos

:small_red_triangle_down: If this happends after make

fatal error: fuse3/fuse.h: No such file or directory
   31 | #include <fuse3/fuse.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/apfs-fuse.dir/build.make:63: CMakeFiles/apfs-fuse.dir/apfsfuse/ApfsFuse.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/apfs-fuse.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

:small_red_triangle_down: Install ccmake

sudo apt install cmake-curses-gui

:small_red_triangle_down: Follow these (only if make fails)

1. Execute `cmake ..`
2. Execute `ccmake .`
3. Navigate to `USE_FUSE3`, and if it is not set to `OFF`, hit enter
4. Press `c` to configure
5. Press `g` to generate Makefile and exit ccmake
6. Execute `make`

The reason that could happen is just because of a Fuse’s version issue. If compiling works then the binaries folder can be copied to the root path.

1 Like