SOLUTION and GUIDE
I have been able to mount and read (you will only have read-only access since that is what apfs-fuse provides) Apple's apfs file system using apfs-fuse. In the following, I will document it just in case it becomes useful for someone else.
There are certain libraries and development tools that are prerequisites. Therefore, do ensure that you have the following installed, all available from the Software Center:
Libraries and their -dev/-devel packages:
- fuse 2.9.9 (It's important that the fuse version is 2.6 or above)
- fuse-devel 2.9.9
- zlib
- zlib-devel
- bzip2
- bzip2-devel
- attr
- attr-devel
Development Tools:
Run the following commands in the terminal:
git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule init
git submodule update
After that’s done, it’s time to compile the downloaded source code:
mkdir build
cd build
cmake ..
ccmake .
In the screen that opens in the terminal, scroll down to USE_FUSE3=ON
and press the space bar to toggle so it becomes USE_FUSE3=OFF
. Configure it by pressing c
. Then quit that screen by pressing q
.
Now, we can proceed to make:
make
After compilation, the binaries are located in the build directory. I recommend copying the apfs* tools into a directory that can be accessed in the path, for example /usr/local/bin. First, create the directory:
sudo mkdir -p /usr/local/bin
Now, simply copy them using this:
sudo cp apfs-* /usr/local/bin
Now we need to find out which disk partition macOS is on. By using the fdisk -l command you’ll be able to see the layout of the disk.
`$sudo fdisk -l
--- 8>--snipped the loop volumes--<8 ---
Disk /dev/sda: 465.9 GiB, 500277790720 bytes, 977105060 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6153AD88-FE14-4E88-8D9A-60E8AA465516
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 764593231 764183592 364.4G unknown
/dev/sda3 764594176 781570047 16975872 8.1G Microsoft basic data
/dev/sda4 781832192 976842751 195010560 93G Microsoft basic data
--- 8>--snipped the loop volumes--<8 ---`
You can see in my example above that there is a 364.4GB unknown partition. I know that this is my macOS partition because I know that the size of my macOS partition is 365GB. This means that the device identifier is /dev/sda2, so that’s what we will mount.
Let’s check it out and see if it works….
sudo mkdir -p /media/$USERNAME/macos
sudo ./apfs-fuse -o allow_other /dev/sda2 /media/<your userame>/macos
If you got no errors thus far, your macOS partition should be mounted in /media/<your username>/macos
. You can navigate there and check.
We can now make this permanent and run at boot:
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 (all on one line) that says this:
mount.apfs#/dev/sda2 /media/<your username>/macos/ fuse user,allow_other 0 0
When the partition is mounted, you will see two directories, private-dir and root. The directory root is the one you want. Inside there is the root filesystem of your mac. You’ll find your stuff in the ‘Users’ folder.
Credit:
The bulk of the information in this guide has been pulled from https://linuxnewbieguide.org/how-to-mount-macos-apfs-disk-volumes-in-linux/#How_do_I_get_it_working, created by Alistair Ross. What I had to figure out is a way to use fuse 2
in place of fuse 3
.
I trust others who dual boot with macOS will find this guide useful.
Grateful if this thread could be tagged as solved.