31

I have got my paws on a large USB drive which I'd like to use as a backup/general storage at the office. I was thinking of having two partitions one of Time Machine backup and one for general storage. As I will be using the disk for both my Linux workstation and MacBook Pro I was wondering what file system to use.

I have been reading up on old forum threads and questions here, and my understanding is that Time Machine demands a volume with HFS+ file system, meaning it would not work with ext4. Likewise HFS+ will be read on Linux, but performance-wise it would be questionable. The majority of the info I found is from 2009-2010 era, so I am wondering if there has been any changes, could someone confirm or deny these statements? or perhaps add more info on the matter...

Would it be then advisable to have one partition with HFS+ and one with ext4? I am skeptical if that would be much better... Furthermore, the disk utility tool in OSX doesn't give the option to format with Linux native, apparently it's more likely that one uses Win/OSX than Linux/OSX..

2
  • I thought extended was a file system option? Commented Feb 22, 2012 at 10:39
  • You mean exFAT, or ext2/3/4? THe latter is not an supplied as an option, while the former is not particularly desirable :( Commented Feb 22, 2012 at 10:41

3 Answers 3

33

Linux can write to HFS+ without problems. If you really need read/write support from both OSes, then you only have one choice, namely to format as HFS+, since Time Machine won't work with others and macOS can't natively write to ext4 (see How can I mount an ext4 file system on OS X?)

Since Linux allows writing to journaled HFS+ volumes, use Disk Utility.app on your Mac to format the partition with HFS+ (journaled).

Newer macOS versions will by default use APFS instead of HFS+, but Linux support for APFS is still quite limited. There's a read-only FUSE driver, but in the future write support may be added.

10
  • thanks for the reply, I was wondering whether or not the second partition (the one for linux/osx) would better be ext4 or hfs+. I mean from what I understand both choices have drawbacks. Do you have any comments on that? Commented Feb 22, 2012 at 10:47
  • You won't be able to write to it from OS X when it's ext4, unless you plan using third party tools. I don't think writing speed to HFS+ from Linux would be a big issue on the other hand. Commented Feb 22, 2012 at 10:49
  • how about HFS+ Journaled and Linux. I read somewhere that Linux compatibility is depending on whether or not not the HFS+ volume is journaled or not (as in no joy if the HFS volume is journaled) Commented Feb 22, 2012 at 10:51
  • 1
    Also, there are mentions of problems for partitions larger than 2 Tb: "In 2009, these drivers were diagnosed to be corrupting HFS+ drives with a capacity greater than 2 TB. Consequently, Linux distributions such as Debian and Ubuntu also stopped allowing mounting of HFS+ drives or partitions greater than 2 TB. As of February 2011, work is in progress to lift this restriction." (wikipedia) Commented Oct 16, 2013 at 9:41
  • 1
    Update: Linux does now support writing to HFS+ journaled volumes: superuser.com/a/365270/89860 Commented Feb 22, 2018 at 15:46
12

Just to add to slhck's answer, formatting the partition as non-journaled was a little tricky using Disk Utility on OSX 10.7 as the option for HFS+ nonjournaled is not apparent in the formatting (erase) options.

The solution is to format it as HFS+ journaled then turn off journaling by selecting the partition then, while holding option key, open the "File" menu and select "Disable Journaling".

Weird.

See https://discussions.apple.com/thread/3232454?start=0&tstart=0

1
  • 2
    It seems (after trying it) that you can turn journaling on and off at any time (using the weird method of this answer), without affecting the contents of the partition. So if you like, you could turn on journaling whenever you're on a mac, as long as you remember to turn it off before ejecting (so that it mounts as read/write (instead of read only) on linux). (Too bad OSX can't do this automatically for us, with some 3rd option like "only journaled on macs (linux-friendly)"...) Commented Jan 28, 2014 at 7:59
8

There is a modern possibility now for macOS and Linux compatibility at the filesystem level: ZFS. It works well and it's supported in both environments (see https://zfsonlinux.org/ and https://openzfsonosx.org/).

It's a possibility I haven't seen mentioned until now in this context, here, or in answers to similar questions.

Pros:

  • Modern, actively developed, and future proof open-source filesystem.
  • It plays well with permissions and UNIX in general (FAT-like filesystems don't do that in any of their incarnations, as far as I know).
  • Extremely well suited for a shared partition in a dual-boot system.
  • As a bonus, ZFS offers a lot of unique features, like data integrity, pool management, copy on write, snapshots (https://itsfoss.com/what-is-zfs/). Only recently Btrfs (Linux) and APFS (macOS) have been trying to catch up with similar features.

Cons:

  • It might require a bit of knowledge and management, given that it's both a file system and a volume manager rolled into one.
  • It requires the installation of third-party system software on both macOS and Linux (on macOS it can be installed using brew cask and on Linux, it might be supported by distribution, as Ubuntu does for example).
  • It could be not that well suited to portable disks depending on the use case. Chances are most other people's macOS and Linux systems won't be able to read your ZFS formatted disks "as is" (see point above), and a connection failure, like detaching the cable inadvertently, might have annoying consequences.

Personally, I've used ZFS with a dual-boot (macOS/Linux) Macbook Pro for several years now, both with USB3 disks and internal SATA disks. Depending on the situation, it's a very good solution.

There is also an actively developed, albeit very recent, ZFS Windows port. It might be several years before it's usable in production though (https://github.com/openzfsonwindows/ZFSin).

2
  • 1
    This worked well for me. Just need to remember to turn off org.zfsonlinux:userobj_accounting and org.zfsonlinux:project_quota if using openzfsonosx and you want it writeable on MacOS. Commented Dec 30, 2020 at 3:59
  • 1
    @Karl good point. It was not a problem for me because I created my pools on macOS and then imported them on Linux. Keep in mind also that these could be transient problems, that happen now and won't happen in the near future. There's an ongoing effort into merging all the OpenZFS development effort into a single, multi-platform project, and into providing default feature-sets with different compatibility levels. See for instance this github issue. Commented Jan 1, 2021 at 11:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.