9

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.

  • Could you try sudo mkdir /sd, sudo /usr/local/opt/ext2fuse/bin/ext2fuse /dev/disk2s7 /sd and diskutil umount force /sd and report back the results? – jorvi Jun 7 '17 at 15:46
  • do you want read/write into ext2/3 file system? – Sairam Jun 7 '17 at 16:34
  • @jorvi haven't got sd card on me at the moment but sudo mkdir /sd => mkdir: /sd: File exists and diskutil umount force /sd => Unmount failed for /sd. – AJP Jun 7 '17 at 21:26
  • Just read ext2/3 file system would be great (though obviously write would be bonus but can't even get read working at the moment) @Sairam – AJP Jun 7 '17 at 21:27
  • @AJP, it would have been useful to know the problem you are solving in case the steps you were following were obsolete. Looks like there is an answer present now. – Sairam Jun 8 '17 at 6:50
1
+50
  • 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!

  • Would have preferred using brew but will give this a go when get back onto Wifi. – AJP Jun 7 '17 at 21:29
  • 1
    This works well. Do you know how you unmount too? (and bonus thanks for figuring out how to unmount the other drives) – AJP Jun 8 '17 at 8:06
  • With fuse-ext2 installed I always unmounted the volume by using the context menu > eject "Vol name". sudo umount diskXsY also works (with the proper X and Y). What do you mean with the "other" drives? – klanomath Jun 8 '17 at 8:13
  • ls /sd* => /sd: \n\n/sd2: \n\n/sd3: \n\n/sd4: \n (others are from previous attempts) and diskutil umount force /sd => Unmount failed for /sd. And restarting does not do anything, they're there when I come back. (Also re bounty I have awarded to you in case it expires and I'd have to reissue. Not sure how it works, don't want you to lose out after your excellent advice so far. Thanks.) – AJP Jun 8 '17 at 23:38
  • @AJP You can unmount the mount point (/sd*)!. You should be able to get the mount point(s) and the volume name by entering mount and then unmount the volumes with sudo umount [force] /mountpoint/vol_name(e.g. sudo umount /Volumes/SDData – klanomath Jun 8 '17 at 23:46

You must log in to answer this question.

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