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?
|
|
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 10 supports all versions of OS X / macOS from 10.8 to 10.12. 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. |
|||||
|
|
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. |
||||
|
|
|
One can also install OSXFUSE completely via the brew command line package manager:
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:
|
||||
|
|
|
With recent changes to homebrew, this should be as simple as:
You may have to reboot. ext4fuse is read-only, unfortunately. And you may need to use a flag to get it to work as a normal user. 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? |
||||
|
|
|
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 My idea was to have access to my 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. |
|||||||||
|
|
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.
It is better than having to fix them after with an fsck command. |
||||
|
|
|
If you're wondering what the command line is to mount an ext4 partition using fuse and ext2fuse (e.g. when installed using MacPorts
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:
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:
If that doesn't work try:
Update: More recently I've found that fuse-ext2 has problems with certain newer ext4 features, so instead it is better to use ext4fuse (
It should be noted that you can only access the mounted filesystem as root/sudo. e.g.
|
|||||||||
|
|
You can boot Linux VM quickly on your OS X using Vagrant. You require to install VM provider such as VirtualBox and Vagrant either via .dmg file from the site or using brew cask. Once you have
This will generate and you'll have Linux box booted within few minutes (downloaded from Atlas Hashicorp repository). Then connect to the box via command: By default your current folder will be synched with So if you mount your filesystem within Alternatively you just need to install a VirtualBox, run the GUI app, install and boot a minimal version of Linux e.g. Ubuntu in order to achieve the same as explained above. Above non-native solution are not ideal, but at least your macOS would be more stable rather than installing unstable kernel extensions which may cause a lot of system crashes. |
|||||||||
|
|
There is also e2fsprogs available in MacPorts. I haven't tested it yet myself but looks promising. |
|||
|
|
Updated answer for (High) SierraFor Sierra and High Sierra ext4fuse seems to work well for read access only and therefore it could probably be considered the preferred option. While other answers already give some usage examples I'll repeat it once again with some important details: Install ext4fuse with:
You can mount as a normal user but in that case you'll only be able access world-readable files, that's why for full access you need to use
Here is a bash script which partially automates the process. When launched it will automatically create the mount point after you'll be prompted to enter one of the displayed device identifiers such as
To unmount you can use e.g. If you happen to have files owned by
Original answer for Yosemite and older (deprecated)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:
Once you have both OSXFUSE and FUSE-EXT2 installed you can mount the ext2/ext3/ext4 partitions as mentioned in other answers:
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 There are two
Both versions fail to mount EXT partitions. Most likely, the DMG version ( This method worked for me on mavericks, yosemite, elcapitan and sierra. EXT2/3/4 mount script for older OSX versions (deprecated)To save some extra typing I use a tiny script which takes the partition name such as
The script is called with the partition name that you look up via |
|||||
|