Skip to content

Instantly share code, notes, and snippets.

@cobaohieu
Last active September 22, 2023 16:38
Show Gist options
  • Save cobaohieu/2627b96cb546a8414b3f889f032e3f04 to your computer and use it in GitHub Desktop.
Save cobaohieu/2627b96cb546a8414b3f889f032e3f04 to your computer and use it in GitHub Desktop.

Install neccessary

sudo apt-get install linux-headers-$(uname -r)

Clone source

git clone https://github.com/linux-apfs/linux-apfs-rw.git
cd linux-apfs-rw

Build

make
sudo modprobe libcrc32c
sudo insmod apfs.ko

Show list /Volume in disk

sudo fdisk --list
Disk /dev/sda: 465,76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C9C87ABB-B286-4F47-B5CC-BAFC9C1605CD

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1077247   1075200   525M EFI System
/dev/sda2    1077248  11563007  10485760     5G Microsoft basic data
/dev/sda3  323262464 606112351 282849888 134,9G Apple APFS
/dev/sda4  606112352 636454911  30342560  14,5G Apple HFS/HFS+
/dev/sda5  636717056 651485183  14768128     7G Microsoft basic data
/dev/sda6  651485184 652099583    614400   300M Microsoft reserved
/dev/sda7  652099584 976773119 324673536 154,8G Microsoft basic data
/dev/sda8   11563008  30291967  18728960   8,9G Linux swap
/dev/sda9   30291968 323262463 292970496 139,7G Linux filesystem

Partition table entries are not in disk order.

Create folder for map disk in /mnt/ or /media/

sudo mkdir /mnt/Macintosh
sudo chmod 777 /mnt/Macintosh

Mount

sudo mount -o rw,vol=3 /dev/sda3 /mnt/Macintosh

For the vol=X, please look at the position of listed partition above as /dev/sda3 and it has the same with your partition that you would like to mount.

Unmount

umount /mnt/Macintosh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment