Mounting Mac APFS drives part 2

ionmich’s original post doesn’t appear ever to have been resolved, and neither anything Google has coughed up so far.

# parted /dev/sda print
Model: ATA APPLE HDD ST1000 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                        Flags
 1      20.5kB  210MB   210MB   fat32        EFI System Partition        boot, esp
 2      210MB   80.2GB  80.0GB               p02 MacOS Catalina system
 3      80.2GB  300GB   220GB                p03 MacOS user data
 4      300GB   309GB   8389MB  ext4         p04 Linux /usr/local
 5      309GB   326GB   16.8GB  ext4         p05 Linux /home
 6      326GB   351GB   25.2GB  ext4         p06 Linux /pub
 7      351GB   363GB   12.6GB  ext4         p07 openSUSE Tumbleweed
 8      363GB   376GB   12.6GB               p08
 9      376GB   389GB   12.6GB               p09
10      389GB   401GB   12.6GB               p10
11      401GB   779GB   377GB                reserved for more distros
12      779GB   1000GB  222GB   ext4         Apple ST10 Linux /isospace
# zypper --no-refresh se -s -i apfs afs | egrep -v 'debug|devel|srcp|openSUSE-20' | egrep 'x86|noarch'| sort -f
i  | openafs             | package | 1.8.13.g20250116-2.6           | x86_64 | OSS
i  | openafs-kmp-default | package | 1.8.13.g20250116_k6.14.6_2-2.6 | x86_64 | OSS
i+ | apfsprogs           | package | 0.2.1-1.1                      | x86_64 | OSS
i+ | libfsapfs           | package | 20240429-2.1                   | x86_64 | OSS
i+ | libfsapfs1          | package | 20240429-2.1                   | x86_64 | OSS
i+ | openafs-client      | package | 1.8.13.g20250116-2.6           | x86_64 | OSS
# ls -gGh /usr/bin/*apfs* /usr/sbin/*apfs* /usr/bin/*afs* /usr/sbin/*afs*
-rwxr-xr-x 1  39K Apr  9 02:47 /usr/bin/afs_compile_et
-rwxr-xr-x 1 459K Apr  9 02:47 /usr/bin/afsio
-rwxr-xr-x 1 434K Apr  9 02:47 /usr/bin/afsmonitor
-rwxr-xr-x 1 699K Apr  9 02:47 /usr/bin/afs_scout
-rwxr-xr-x 1  59K May  4 04:00 /usr/bin/fsapfsinfo
-rwxr-xr-x 1  47K May  4 04:00 /usr/bin/fsapfsmount
-rwxr-xr-x 1 760K Apr  9 02:47 /usr/sbin/afs_backup
-rwxr-xr-x 1 252K Apr  9 02:47 /usr/sbin/afsd
-rwxr-xr-x 1 219K Jun 10 01:50 /usr/sbin/apfsck
-rwxr-xr-x 1  15K Jun 10 01:50 /usr/sbin/apfs-label
-rwxr-xr-x 1  15K Jun 10 01:50 /usr/sbin/apfs-snap
lrwxrwxrwx 1    6 Jun 10 01:50 /usr/sbin/fsck.apfs -> apfsck
-rwxr-xr-x 1  35K Jun 10 01:50 /usr/sbin/mkapfs
lrwxrwxrwx 1    6 Jun 10 01:50 /usr/sbin/mkfs.apfs -> mkapfs
lrwxrwxrwx 1    7 Apr  9 02:47 /usr/sbin/rcopenafs-client -> service
# fsapfsinfo /dev/sda3
fsapfsinfo 20240429

Apple File System (APFS) information:

Container information:
        Identifier                      : 73646d25-5f10-4480-997c-dd9d17248bd7
        Number of volumes               : 1

Volume: 1 information:
        Identifier                      : fcfae929-c5a4-4f56-81f3-78c33df4e323
        Name                            : MacData
        Compatible features             : 0x00000006
                (APFS_FEATURE_HARDLINK_MAP_RECORDS)
                (APFS_FEATURE_DEFRAG)

        Incompatible features           : 0x00000001
                (APFS_INCOMPAT_CASE_INSENSITIVE)

        Read-only compatible features   : 0x00000000

        Number of snapshots             : 0
# man fsapfsmount
# fsapfsmount -f 1 -p 12345 /dev/sda3
fsapfsmount 20240429

Missing mount point.
Use fsapfsmount to mount an Apple File System (APFS) container

Usage: fsapfsmount [ -f file_system_index ] [ -o offset ] [ -p password ]
                   [ -r recovery_password ] [ -X extended_options ]
                   [ -hvV ] container mount_point

        container:   an Apple File System (APFS) container

        mount_point: the directory to serve as mount point

        -f:          mounts a specific file system or "all"
        -h:          shows this help
        -o:          specify the container offset in bytes
        -p:          specify the password/passphrase
        -r:          specify the recovery password/passphrase
        -v:          verbose output to stderr, while fsapfsmount will remain running in the
                     foreground
        -V:          print version
        -X:          extended options to pass to sub system
# fsapfsmount -f 1 -p 12345 /dev/sda3 /mnt
fsapfsmount 20240429

No sub system to mount APFS format.
# find /usr/lib/modules/ -name '*apfs*' -print
# alias scluf
alias scluf='systemctl list-unit-files | sort | grep -E '
# scluf afs
openafs-client.service                      enabled         disabled
# grep apfs /etc/fstab
/dev/sda3 /disks/macdata apfs pass=12345,nofail 0 0
# mount -a
mount: /disks/macdata: unknown filesystem type 'apfs'.
       dmesg(1) may have more information after failed mount system call.
# grep -E 'afs|apfs' /etc/fstab
/dev/sda3 /disks/macdata afs pass=12345,nofail 0 0
# mount -a
mount: /disks/macdata: unknown filesystem type 'afs'.
       dmesg(1) may have more information after failed mount system call.
# grep -E 'afs|apfs' /etc/fstab
/dev/sda3 /disks/macdata openafs pass=12345,nofail 0 0
# mount -a
mount: /disks/macdata: unknown filesystem type 'openafs'.
       dmesg(1) may have more information after failed mount system call.
#

https://github.com/sgan81/apfs-fuse/issues/81 seems to suggest an apfs module should exist, but TW kernels don’t seem to provide any. Anyone here know what I’ve missed, or any solution to access apfs data filesystem while booted to TW from same internal HDD in an iMac 2012 with i7-3770 CPU?

Do you just require read-only APFS support? Unencrypted? If so, apfs-fuse is probably the most viable option here.

Once “apfs-fuse” is built, refer…

Mount as user with…
apfs-fuse <device> <mount-directory>

RW required. Enc. not. Where does apfs-fuse come from, openafs-fuse_client?

# lsmod | grep fs
libafs               3186688  2
configfs               65536  1
efivarfs               36864  1
dmi_sysfs              24576  0
# systemctl status openafs-client
● openafs-client.service - OpenAFS Client
     Loaded: loaded (/usr/lib/systemd/system/openafs-client.service; enabled; preset: disabled)
     Active: active (running) since Fri 2025-06-20 00:18:20 EDT; 3min 54s ago
 Invocation: 088bb0286d3a4918bff385d8173af60d
    Process: 819 ExecStartPre=/sbin/modprobe libafs (code=exited, status=0/SUCCESS)
    Process: 864 ExecStart=/usr/sbin/afsd $AFSD_ARGS (code=exited, status=0/SUCCESS)
    Process: 889 ExecStartPost=/usr/bin/fs sysname $SYSNAME (code=exited, status=0/SUCCESS)
    Process: 892 ExecStartPost=/usr/bin/fs setcrypt $CRYPT (code=exited, status=0/SUCCESS)
   Main PID: 873 (afsd)
      Tasks: 1 (limit: 18902)
        CPU: 87ms
     CGroup: /system.slice/openafs-client.service
             └─873 /usr/sbin/afsd -fakestat -memcache -blocks 102400 -dynroot -afsdb

Jun 20 00:18:19 i7mac systemd[1]: Starting OpenAFS Client...
Jun 20 00:18:20 i7mac afsd[885]: afsd: All AFS daemons started.
Jun 20 00:18:20 i7mac afsd[864]: afsd: All AFS daemons started.
Jun 20 00:18:20 i7mac fs[889]: Current sysname is 'amd64_linux26'
Jun 20 00:18:20 i7mac systemd[1]: Started OpenAFS Client.
# df
Filesystem      1K-blocks    Used  Available Use% Mounted on
/dev/sda7        11999536 3477884    7890868  31% /
/dev/sda6        24014052      32   23997636   1% /pub
/dev/sda5        16021424     132   16004908   1% /home
/dev/sda4         7979908   14784    7866820   1% /usr/local
/dev/sda1          201633     306     201327   1% /boot/efi
AFS            2147483647       0 2147483647   0% /afs
# cd /afs
# touch test.txt
touch: cannot touch 'test.txt': Read-only file system
#
<reconfigure & reboot>
# systemctl status openafs-client
○ openafs-client.service - OpenAFS Client
     Loaded: loaded (/usr/lib/systemd/system/openafs-client.service; disabled; preset: disabled)
     Active: inactive (dead)

Jun 20 00:31:02 i7mac systemd[1]: /usr/lib/systemd/system/openafs-client.service:18: Unit uses KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the >
# lsmod | grep fs
configfs               65536  1
efivarfs               36864  1
dmi_sysfs              24576  0
# modprobe libafs
# lsmod | grep fs
libafs               3186688  0
configfs               65536  1
efivarfs               36864  1
dmi_sysfs              24576  0
# grep -E 'afs|apfs' /etc/fstab
/dev/sda3 /disks/macdata apfs-fuse pass=12345,nofail 0 0
# mount -a
mount: /disks/macdata: unknown filesystem type 'apfs-fuse'.
       dmesg(1) may have more information after failed mount system call.
# modprobe apfs-fuse
modprobe: FATAL: Module apfs-fuse not found in directory /usr/lib/modules/6.14.6-2-default
# zypper in -D openafs-fuse_client
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: 1: the to be installed openafs-fuse_client-1.8.13.g20250116-2.6.x86_64 conflicts with 'openafs-client' provided by the installed openafs-client-1.8.13.g20250116-2.6.x86_64
 Solution 1: Following actions will be done:
  deinstallation of openafs-client-1.8.13.g20250116-2.6.x86_64
  deinstallation of openafs-kmp-default-1.8.13.g20250116_k6.14.6_2-2.6.x86_64
 Solution 2: do not install openafs-fuse_client-1.8.13.g20250116-2.6.x86_64

Choose from above solutions by number or cancel [1/2/c/d/?] (c): 1

Resolving dependencies...
Resolving package dependencies...

The following NEW package is going to be installed:
  openafs-fuse_client

The following 2 packages are going to be REMOVED:
  openafs-client openafs-kmp-default

1 new package to install, 2 to remove.

Package download size:
            |     349.3 KiB  overall package size
       0 B  |  -  349.3 KiB  already in cache

Package install size change:
              |     759.4 KiB  required by packages that will be installed
    -5.8 MiB  |  -    6.6 MiB  released by packages that will be removed

Backend:  classic_rpmtrans --dry-run
Continue? [y/n/v/...? shows all options] (y): y

Checking for file conflicts: ..........................................................................................................................................................[done]
#

6.12.33 doesn’t have either apfs-fuse or libafs.
:frowning:

You need to build it first:

Only suitable for reading though.

If you have important data files stored on APFS-formatted drive(s) and want to access the data in a Linux environment, the best approach is to migrate the data off APFS and onto a more Linux-friendly filesystem (using macOS) IMHO.