If you use a Mac but occasionally need to access drives formatted with Linux filesystems, you are probably aware of the limitations of macOS.
Apple's operating system natively supports formats like APFS, HFS+, FAT32, and exFAT, but it completely lacks native read/write support for Linux filesystems such as ext4, ext3, or ext2. When you connect an ext4 drive to a Mac, macOS typically prompts you with an annoying "The disk you attached was not readable by this computer" error, leaving you with no way to access your data. Furthermore, if your Linux partition is secured with LUKS encryption, the situation becomes even more complicated, as there are no native macOS tools to decrypt and mount these volumes.
This is where Linsk comes to the rescue. First, you need to follow the installation instructions.
Linsk is an open-source utility that allows you to mount Linux filesystems on macOS (Intel and Apple Silicon) by running a lightweight, headless Linux virtual machine in the background using QEMU. It passes the physical block device to the VM, which then mounts the Linux filesystem and shares it back to your macOS host via a network file sharing protocol (AFP). This allows you to read and write to your ext4/LUKS drives directly from the macOS Finder.
While Linsk is a powerful tool, its usage requires multiple manual steps: finding the correct disk identifier, checking whether the partition is standard or LUKS-encrypted, launching the command with the right flags, and manually connecting to the network share via Finder once the password is generated.
To streamline this process, I created a Bash script to automate the entire workflow. My motivation was to make accessing Linux drives on a Mac as close to a "one-click" experience as possible.
The script automatically detects connected external drives, locates the Linux partition, and checks for LUKS encryption by reading the partition header magic bytes. It then runs Linsk with the correct parameters, intercepts the generated AFP password from the background logs, and automatically mounts the network share in the macOS Finder for the current user. Additionally, it implements lock files to prevent multiple instances from running and handles safe cleanups upon exit.
How to use the script
Getting started is very simple. Follow these steps in your macOS terminal:
- Download the script: You can download the script directly from this link:
https://www.informatica-libera.net/files/linsk_manager.txt - Rename the file: Since it is hosted as a text file, you need to change the extension to
.shto treat it as a shell script:
mv linsk_manager.txt linsk_manager.sh - Make it executable: Grant execution permissions to the script:
chmod +x linsk_manager.sh - Run the script: Because the script needs to access raw block devices and interact with system-level utilities, it must be run with root privileges:
sudo ./linsk_manager.sh
Example Log
Below is an example log of the script in action on macOS Sequoia:
% sudo ./linsk_manager.sh
Password:
============================================================
linsk source code and documentation: https://github.com/AlexSSD7/linsk
Script created by Francesco Galgani: https://www.informatica-libera.net
============================================================
>>> DISCLAIMER: This script does not support LVM volumes.
If macOS shows the 'disk not readable' popup, click 'Ignore'.
============================================================
[INFO] Searching for Linux partitions on external disks...
[INFO] Automatically selected partition: /dev/disk2s1
[INFO] Checking partition type (LUKS vs standard)...
[INFO] LUKS encryption detected automatically.
>>> NOTE: When the terminal prompts 'Enter Password:', enter your LUKS decryption password.
[INFO] Starting linsk...
============================================================
>>> IMPORTANT: When you are finished using the disk:
1. Eject the 'linsk' network drive in Finder (Right-click -> Eject)
2. Then return to this terminal and press Ctrl+C to exit.
============================================================
time=2026-07-25T19:22:51.051+02:00 level=WARN msg="Using raw block device passthrough. Please note that it's YOUR responsibility to ensure that no device is mounted in your OS and the VM at the same time. Otherwise, you run serious risks. No further warnings will be issued." caller=vm
time=2026-07-25T19:22:51.086+02:00 level=INFO msg="Booting the VM" caller=vm
time=2026-07-25T19:23:03.105+02:00 level=INFO msg="The VM is up, setting it up" caller=vm
time=2026-07-25T19:23:06.007+02:00 level=INFO msg="The VM is ready" caller=vm
time=2026-07-25T19:23:06.277+02:00 level=INFO msg="Mounting the device" dev=vdb fs=<auto> luks=true
time=2026-07-25T19:23:06.364+02:00 level=INFO msg="Attempting to open a LUKS device" caller=file-manager vm-path=/dev/vdb
Enter Password:
time=2026-07-25T19:23:20.983+02:00 level=INFO msg="LUKS device opened successfully" caller=file-manager vm-path=/dev/vdb
time=2026-07-25T19:23:21.819+02:00 level=INFO msg="Started the network share successfully" backend=afp
===========================
[Network File Share Config]
The network file share was started. Please use the credentials below to connect to the file server.
Type: AFP
URL: afp://127.0.0.1:9000/linsk
Username: linsk
Password: o281095Tp3c674Ek
===========================
. Mounting automatically in Finder..., you may need to enter manually the password: o281095Tp3c674Ek
[INFO] Finder window should open shortly.
^Ctime=2026-07-25T19:23:57.891+02:00 level=WARN msg="Caught interrupt, safely shutting down" signal=interrupt
time=2026-07-25T19:23:57.891+02:00 level=WARN msg="Canceling the VM context" caller=vm
time=2026-07-25T19:23:57.970+02:00 level=WARN msg="Sending poweroff command to the VM" caller=vm
time=2026-07-25T19:23:57.993+02:00 level=INFO msg="Shutting the VM down safely" caller=vm
[INFO] Script interrupted. Cleaning up...(July 25, 2026)