Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a safe, stable application for reading from and writing to ext4 file systems on Mac OS X?

If not, what's the best way to access the contents of an ext4 file system on Mac OS X?

share|improve this question
    
It would be more than helpful if you specified what version of OS X you are running. There are compatibility issues with the solutions available depending on OS revision. – kopischke Nov 1 '11 at 8:30

10 Answers 10

up vote 50 down vote accepted

The answer depends on you willingness to invest in commercial software:

If you don’t mind spending some money on a commercial product, Paragon’s ExtFS driver will give you read and write access to ext2 / ext3 / ext4 file systems. Version 9 supports all versions of OS X from 10.5 to 10.11.

If you are looking for a free solution, you can setup a Linux virtual machine, mount your volume(s) there and share it / them via Samba or (S)FTP. This post has some details on how to achieve this using VirtualBox, a free virtual machine application. Note this is not exactly a lightweight solution, even if using a prebuilt VirtualBox VM will spare you installing and configuring a Linux distro from scratch.

share|improve this answer
    
Apparently Paragon's ExtFS driver was found to be unstable by people, so I'd recommend check out other answers if you want a filesystem driver. – Jeff Burdges Apr 5 '15 at 21:47
4  
@JeffBurdges quick googling didn't turn up any results for paragon being unstable - can you provide a link? – ptim Apr 21 '15 at 15:03
1  
@memeLab Check this‌​. It's Paragon’s ExtFS for Windows though. – user127684 May 13 '15 at 15:19
1  
This answer is about the OS X product, which uses another technology stack than the Windows version (no Dokan library, for one). – kopischke May 13 '15 at 15:28
1  
I have to say, after a frustrating time not getting FUSE to work, the Paragon product does the job. It's closed-source, but it's $20. – Joe Apr 22 at 15:16

Building on Ken's answer: I used fuse4x and fuse-ext2 successfully, and I recommend fuse-ext2 over ext4fuse.

ext4fuse was a hassle for me, because it requires manual compilation and has no support for fuse4x options that would allow me to set access control. fuse-ext2 provides downloadable packages, and the 0.0.7 version worked just fine. I copied a few large ISOs over without any problem.

share|improve this answer
1  
The fuse4x link is dead, it links to a construction site. Is there any other website? – Richard J. Ross III Jul 26 '13 at 13:31
    
Use fuse-ext2 :) – pwnall Aug 2 '13 at 0:53
1  
@RichardJ.RossIII if you google it, it comes up as fuse4x.github.io – tekknolagi Aug 23 '13 at 0:16
8  
From the fuse4x site (in case it disappears): 'To avoid confusion developers of Fuse4X have decided to merge the project into OSXFUSE' – reevesy Jun 7 '14 at 13:29
1  
Note this comes with a caveat if you require write support, as the OP did, as the fuse-ext2 README clearly states “altough, write support is available please do not mount your filesystems write support unless you do not have anything to loose.” – kopischke Apr 24 '15 at 8:59

One can also install OSXFUSE completely via the brew command line package manager:

brew install homebrew/fuse/ext4fuse

Note that the installation tells certain commands need to be run as 'sudo' in addition to this.


With Yosemite better have a look at this. And then make sure the directory is readable by your user by doing this. For it to work I had to use the wheel group like this:

sudo dscl . append /Groups/wheel GroupMembership <your-user>
share|improve this answer
2  
To mount use ext4fuse <device> <mountpoint> – Eun Jan 15 '15 at 9:31
1  
Note that ext4fuse is read-only. – Joost Jun 16 '15 at 7:22
2  
Any admin should be in wheel by default. The group I needed to add myself to is /Groups/operator. – 0942v8653 Aug 9 '15 at 12:48
    
Doesn't work as of now. – igaurav Oct 11 '15 at 10:14

You may be interested in fuse4x and ext4fuse, though the latter is read-only for now.

Others viewing this question may be interested in libguestfs. I'm not aware of an OS X port, but considering that VirtualBox has an API, it's not out of the question.

I wonder why no one has written a compatibility layer to allow Linux kernel filesystem code to run in userspace/fuse. Or has someone?

share|improve this answer

Just for the record, I have tested Paragon ExtFS driver (trial version) on my MacBook Pro to write to ext4 partition in Linux. I found that the driver was very unstable, and it created corruptions to the filesystem that fsck was not able to repair neither in Linux nor in Disk Utility.

My idea was to have access to my /home partition from Mac OS X using this Paragon driver, but I don't suggest to do this setup. So far, I have my /home partition in Linux formatted to hfsplus with no journaling, and then I can access my files from Mac OS X. Of course, from time to time I get some problems in my FS but is not very frequent. However, I don't suggest this setup either (at least that you have an up to date backup for your daily work).

Finally, I believe that Paragon is more suitable maybe to use for external hard disks but anyways it is not very reliable for being software which license is expensive.

Update: As of May 2015, I have formatted my /home to ext4, and I mount the filesystem using fuse-ext2 in combination with FUSE for OS X. I can access the ext4 partition to read and write. It is more solid setup than the one I previously described above.

share|improve this answer
    
I can confirm the last entry here where the Paragon ExtFS driver can make some bad trouble on your linux drives. For me, who is dualbooting OSX and Linux, paragon created corruptions on my / device. This was easy to resolve but however thats not a stable solution... – user67382 Jan 14 '14 at 6:04
    
Further bad experience with Paragon ExtFS driver. Consistent kernel panics leading to system rebooting, corruption of the files system (luckily fsck on Linux box did work). Tried on two different external drives with same results. – user83677 Jun 26 '14 at 21:17

I had an ext4 formatted USB drive that I was able to mount after I installed osxfuse. Reading from it works great, but I am not sure if writing is safe.

Also, for moving files from OS X's filesystem (HFS+) to ext4, you may first want to remove those hidden .DS_Store files the OS X filesystem sneaks in as they occasionally cause bad inodes.

find /my/data/to/move -name '*.DS_Store' -type f -delete

It is better than having to fix them after with an fsck command.

share|improve this answer

There is also e2fsprogs available in MacPorts. I haven't tested it yet myself but looks promising.

share|improve this answer

You can boot Linux VM quickly on your OS X using Vagrant. Install it either via .dmg file from the site or using brew cask.

Once you have vagrant command installed, run this in empty folder:

vagrant init ubuntu/vivid64; vagrant up --provider virtualbox

and you'll have Linux box within few minutes.

Then connect to it via: vagrant ssh and try to mount your device.

For more advanced options, you can create customized Vagrantfile with required configuration such as folder synching (config.vm.synced_folder), etc.


Alternatively install VirtualBox, then install and configure minimal version of Linux e.g. Ubuntu.


Above non-native solutions are not ideal, but at least your OSX would be more stable rather than installing unstable kernel extensions which could cause a lot of crashes.

share|improve this answer

If you're wondering what the command line is to mount an ext4 partition using fuse and ext2fuse (e.g. when installed using MacPorts port install ext2fuse) - then firstly you need to work out where the Linux partition is:

diskutil list

This will list all partitions for all disks and amongst them you should see the relevant ones listed under the TYPE column as Linux. Combine the diskX and partition number Y like this /dev/diskXsY - e.g:

mount -t fuse-ext2 /dev/disk1s2 ~/my_mount_point

It may complain about not being able to write to the log file but it should still mount the partition into your home mount point. But if you want to mount the partition into a system directory then you need to run it as root e.g:

sudo mount -t fuse-ext2 /dev/disk1s2 /sys_mount_point

If that doesn't work try:

sudo ext2fuse /dev/disk1s2 /sys_mount_point

Update: More recently I've found that fuse-ext2 has problems with certain newer ext4 features, so instead it is better to use ext4fuse (port install ext4fuse). Use the ext4fuse command directly:

sudo ext4fuse /dev/disk1s2 /sys_mount_point

It should be noted that you can only access the mounted filesystem as root/sudo. e.g.

sudo ls /sys_mount_point
share|improve this answer

Two packages are needed in order to enable EXT2/3/4 support on OSX: OSXFUSE and FUSE-EXT2.

The homebrew formulas for OSXFUSE and FUSE-EXT2 did not work for me on either mavericks or yosemite.

What did work was the following:

  1. Manually download and install the OSXFUSE DMG from http://osxfuse.github.io/. IMPORTANT: Once you launch the PKG installer, make sure you selected MacFUSE Compatibility Layer in the wizard (it is not enabled by default) - without it I was getting an error while trying to mount.
  2. Manually download FUSE-EXT2 from http://sourceforge.net/projects/fuse-ext2/ and run the PKG installer.

Once you have both OSXFUSE and FUSE-EXT2 installed you can mount the ext2/ext3/ext4 partitions as mentioned in other answers:

  1. Find the device name for the EXT partition you want to mount (e.g. disk0s2 in the example below):

    # diskutil list | grep Linux 1: Linux_Swap 8.2 GB disk0s1 2: Linux 119.9 GB disk0s2

  2. Mount the partition to an existing mount point:

    sudo mkdir -p /Volumes/ext4 sudo mount -t fuse-ext2 /dev/disk0s2 /Volumes/ext4

Mounting as a regular user did not work for me. Probably this can be fixed by fiddling with permissions, but I didn't look into it.

Note: My suspicion is that the homebrew formulas did not work because homebrew installs osxfuse without the MacFUSE Compatibility Layer.

There are two osxfuse packages in homebrew:

# brew search osxfuse
>>> osxfuse
>>> Caskroom/cask/osxfuse

Both versions fail to mount EXT partitions. Most likely, the DMG version (Caskroom/cask/osxfuse) fails because homebrew installs the package with default settings, which means that MacFUSE Compatibility Layer is not included. The main osxfuse version probably needs some special installation parameter to enable MacFUSE compatibility, so until this is fixed in homebrew the manual DMG method should be used.

This method worked for me on mavericks and yosemite, untested on elcapitan.

EXT2/3/4 mount script

To save some extra typing I use a tiny script which takes the partition name such as disk0s2 and mounts it under /Volumes/disk0s2, creating the folder if necessary:

### mount_ext4.sh
sudo mkdir -p "/Volumes/$1"
sudo mount -t fuse-ext2 "/dev/$1" "/Volumes/$1"
open "/Volumes/$1"

The script is called with the partition name, e.g. mount_ext4.sh disk2s3.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.