4

I'm on Snow Leopard. I have both MacFUSE and fuse4x installed. Is there a copy-on-write filesystem that I can install?

I tried building UnionFS-FUSE 0.25 using fuse4x's includes and libs, but I get this error:

error: ‘AT_SYMLINK_NOFOLLOW’ undeclared

It seems that OS X doesn't define this constant (I grepped all of /usr/include and it wasn't found).

I also tried using OS X's built-in union mounts (mount -o union) but it didn't behave as expected. I mounted 2 filesystems (using dmg files) with the union option to the same mount point. The first was read-only, and had a directory called d1 containing some files. The second did not have a directory with that name. When I tried to create a file in d1 in the union mount, I got a read-only fs error. I expected it to automatically create the dir and the file under it, both in fs #2. I then tried to create d1 in fs #2, but then the contents of d1 in fs #1 were completely hidden (the dir appeared empty). Basically the union-ing behavior only happened at the root level of filesystems, and wasn't recursive.

If someone wants to try replicating the built-in union mount behavior, I used this guide.

I'm not familiar with copy-on-write filesystems - does my expectation match how copy-on-write filesystems should work?

Kelvin
  • 437

1 Answers1

3

After doing a little more research, I may have to give up on a pre-written solution and just write my own.

PyFilesystem looks like it has potential, particularly the MultiFS fs type. Its FUSE code needs a patch to work with fuse4x.

The MultiFS documentation isn't clear what whether it will create a directory on the writable fs, but I'll give it a try.

UPDATE

The patch introduced a bug when it moved this line before the iconv CDLL loading:

_libfuse = CDLL(_libfuse_path)

Just move it right after and it should work on OS X. (A general fix requires also adding the line after the if _system in block.)

So I tried the MultiFS and it does not create missing directories on the writable FS. But I'm guessing it's easy to add (even though I'm not a python expert). Also, trying to overwrite or append to a file on one of the read-only FS's doesn't consistently create the corresponding path on the writable one. I get a lot of errors and hangs (the fuse process then starts using a lot of CPU). This solution still looks very promising though.

Kelvin
  • 437