Skip to content

Instantly share code, notes, and snippets.

@cobaohieu
Last active September 10, 2022 16:46
Show Gist options
  • Save cobaohieu/52e4b83593eecd005ace9fc9ffdb1ec7 to your computer and use it in GitHub Desktop.
Save cobaohieu/52e4b83593eecd005ace9fc9ffdb1ec7 to your computer and use it in GitHub Desktop.
install_and_mount_apfs_fuse_on_Ubuntu_22.04.md

Some appilcations requirement such as

sudo apt update
sudo apt install -y fuse libfuse3-3 libfuse3-dev bzip2 libbz2-dev libicu-dev libz-dev libattr1-dev
sudo apt install -y  zlib1g-dev clang cmake gcc-c++ git g++ build-essential 

For older versions of Ubuntu, please install:

sudo apt install -y fuse libfuse-dev libicu-dev bzip2 cmake libz-dev libbz2-dev libattr1-dev
sudo apt install -y clang git g++ build-essential 

Build driver

git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule init
git submodule update

mkdir build
cd build
cmake ..
ccmake . # Only if you want to change build options
make

Install driver to system

sudo cp apfs-* /usr/local/bin

Creat a folder to mount

sudo mkdir -p /media/$USERNAME/Macintosh\ HD

Mount APFS volumes

sudo fdisk --list /dev/sda
sudo ./apfs-fuse -o allow_other /dev/sda5 /media/$USERNAME/Macintosh\ HD

Set auto mount

sudo ln -s /usr/local/bin/apfs-fuse /usr/sbin/mount.apfs
sudo nano /etc/fstab

Add a line at the bottom of the file like this or see the example E.g:

mount.apfs#/dev/sda5    /media/<your username>/macos/    fuse    user,allow_other        0       0

E.g:

# Mount APFS volume when boot  
mount.apfs#/dev/sda5    /media/administrator/Macintosh\ HD/    fuse    user,allow_other        0       0

Remove or unmount APFS volumes

fusermount -u /media/<your username>/macos

E.g:

fusermount -u /media/administrator/Macintosh\ HD/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment