How to Mount Linux Filesystem on MacOS Finder

filesystemfindermountunix

I would like to read from an SD card containing the filesystem and OS from a Raspberry Pi running Raspbian / noobs. I have installed ext2fuse (on Mac El Capitan 10.11.6):

$ brew update
$ brew tap caskroom/cask
$ brew cask install osxfuse
$ sudo shutdown -r now
$ brew install ext2fuse
$ sudo shutdown -r now

Now when I put in an SD card (with Raspbian linux OS on it) I get the following:

$ diskutil list
/dev/disk2 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk2
   1:             Windows_FAT_16 RECOVERY                1.2 GB     disk2s1
   2:                      Linux                         33.6 MB    disk2s5
   3:             Windows_FAT_32 boot                    66.1 MB    disk2s6
   4:                      Linux                         6.8 GB     disk2s7

But calling the following results in an empty directory being mounted:

$ sudo /usr/local/opt/ext2fuse/bin/ext2fuse /dev/disk2s7 /sd
$ cd /sd
$ ls
.
$ sudo /usr/local/opt/ext2fuse/bin/ext2fuse /dev/disk2 /sd2
/dev/disk2 is to be mounted at /sd2
fuse-ext2fs: Resource busy while trying to open /dev/disk2

Additionally I can't figure out how to unmount them. Previously I used "eject all" option from clicking the eject icon next to the "boot" or "RECOVERY" mounted partitions in finder. Calling the following doesn't work:

$ diskutil unmount /sd
(null) was already unmounted
$ sudo umount /sd
umount(/sd): Resource busy -- try 'diskutil unmount'
$ rmdir /sd
rmdir: sd: Resource busy
$ sudo mkdir /sd
mkdir: /sd: File exists
$ diskutil umount force /sd
Unmount failed for /sd

** edit **
Don't know what I did but I can now sudo rmdir /sd and they are removed.

Best Answer

  • Remove ext2fuse with brew uninstall ext2fuse.
  • Download fuse-ext2 available at the git homepage and unzip it in your Downloads folder
  • Follow these instructions:

    brew install m4
    brew install e2fsprogs automake autoconf libtool
    cd ~/Downloads/fuse-ext2-master
    ./autogen.sh
    CFLAGS="-idirafter/$(brew --prefix e2fsprogs)/include -idirafter/usr/local/include/osxfuse" LDFLAGS="-L$(brew --prefix e2fsprogs)/lib" ./configure
    make 
    sudo make install
    
  • Mount the partition(s) e.g. disk2s7:

    sudo fuse-ext2 /dev/disk2s7 /sd -o allow_other,force,rw+
    

Tested & verified in a virtual 10.11.6 El Capitan machine!