10

I know this question has been asked many times. Everyone finds their own solution. I used to mount Ext4 via FUSE. But with the move to Big Sur I had to mount Ext4 using VirtualBox. But VirtualBox refuses to work with M1. I tried to do the same operation with QEMU. But I couldn't find anywhere guidance on how to integrate the disk connected to QEMU into Big Sur system. I would like to have the flash drive mounted automatically as soon as it is connected.

What is the easiest way to connect Ext4 to Macbook Air M1? Do I need to upgrade to a Macbook Pro M1Pro or M1Max? Maybe Apple has included support for the Ext4 driver in the Pro versions?

10
  • The change in processor won't make a difference - they run the same OS as other Apple Silicon
    – mmmmmm
    Commented Oct 21, 2021 at 13:38
  • @mmmmmm Why is Apple unable to implement Ext4 support? Couldn't Ext4 source code be open enough?
    – DiD
    Commented Oct 21, 2021 at 14:13
  • We have no idea why Apple does something. However in this case we know Apple does not support a much more common format NTFS why would they waste time on ext4
    – mmmmmm
    Commented Oct 21, 2021 at 14:16
  • 2
    If you are willing to pay, then Paragon will sell you the software needed. Commented Oct 21, 2021 at 14:26
  • 1
    You could equally ask why Windows doesn't support it either. I'd expect the answer to be something along the lines of 'it's not worth the effort'
    – Tetsujin
    Commented Oct 21, 2021 at 15:24

1 Answer 1

15

As long as brew install ext4fuse produces errors in the newest macOS system versions, I propose below workaround. Tested on MacBook Air M2 with macOS Monterey.

Custom install

Create empty script file and open with code editor

nano ext4fuse.rb

Paste this code (Source: Silicon related issue (66) from ext4fuse GitHub ) and save script

class MacFuseRequirement < Requirement
  fatal true

  satisfy(build_env: false) { self.class.binary_mac_fuse_installed? }

  def self.binary_mac_fuse_installed?
    File.exist?("/usr/local/include/fuse/fuse.h") &&
      !File.symlink?("/usr/local/include/fuse")
  end

  env do
    ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_LIBRARY/"Homebrew/os/mac/pkgconfig/fuse"
    ENV.append_path "PKG_CONFIG_PATH", "/usr/local/lib/pkgconfig"

    unless HOMEBREW_PREFIX.to_s == "/usr/local"
      ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
      ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include/fuse"
    end
  end

  def message
    "macFUSE is required. Please run `brew install --cask macfuse` first."
  end
end

class Ext4fuse < Formula
  desc "Read-only implementation of ext4 for FUSE"
  homepage "https://github.com/gerard/ext4fuse"
  url "https://github.com/gerard/ext4fuse/archive/v0.1.3.tar.gz"
  sha256 "550f1e152c4de7d4ea517ee1c708f57bfebb0856281c508511419db45aa3ca9f"
  license "GPL-2.0"
  head "https://github.com/gerard/ext4fuse.git"

  bottle do
    sha256 cellar: :any, catalina:    "446dde5e84b058966ead0cde5e38e9411f465732527f6decfa1c0dcdbd4abbef"
    sha256 cellar: :any, mojave:      "88c4918bf5218f99295e539fe4499152edb3b60b6659e44ddd68b22359f512ae"
    sha256 cellar: :any, high_sierra: "fc69c8993afd0ffc16a73c9c036ca8f83c77ac2a19b3237f76f9ccee8b30bbc9"
    sha256 cellar: :any, sierra:      "fe8bbe7cd5362f00ff06ef750926bf349d60563c20b0ecf212778631c8912ba2"
    sha256 cellar: :any, el_capitan:  "291047c821b7b205d85be853fb005510c6ab01bd4c2a2193c192299b6f049d35"
    sha256 cellar: :any, yosemite:    "b11f564b7e7c08af0b0a3e9854973d39809bf2d8a56014f4882772b2f7307ac1"
  end

  depends_on "pkg-config" => :build

  on_macos do
    depends_on MacFuseRequirement => :build
  end

  on_linux do
    depends_on "libfuse"
  end

  def install
    system "make"
    bin.install "ext4fuse"
  end
end

Run below command from the ext4fuse.rb directory. Install macFuse and ext4fuse

brew install macFuse
brew install --formula --build-from-source ext4fuse.rb

Usage: ext4fuse <disk> <mountpoint>

Therefore, for ext4 device as e.g./dev/disk4s2

sudo ext4fuse /dev/disk4s2 /Volumes/external_device -o allow_other

Volume is mounted, and you should be visible as:

  • 'macFUSE Volume' when shift+cmd+c in Finder
  • 'external_device' when ls /Volumes

If you would like to mount without sudo every time add macOS user to the operator group:

sudo dscl . append /Groups/operator GroupMembership <user>
6
  • 3
    sudo umount /Volumes/external_device to unmount it works great Commented Feb 12, 2023 at 22:57
  • 1
    Worked for me, Ventura 13.1.
    – Marco
    Commented Mar 31, 2023 at 22:03
  • I get Partition doesn't contain EXT4 filesystem, any help?
    – astroboy
    Commented Apr 19, 2023 at 10:52
  • For the SD Card I formatted on my Steam Deck, the mount path is /dev/disk4s1 - but thank you so much for this solution, where nothing else had worked (on MacOS Sonoma running on M1 Mac Mini).
    – RCross
    Commented Dec 30, 2023 at 12:02
  • @acmpo6ou run diskutil list and look for the line that says "Linux Filesystem". That's the disk "slice" you need to mount. On my SD Card, it was on slice 1 of disk 4, so the path was: /dev/disk4s1
    – RCross
    Commented Dec 30, 2023 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .