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?
mount -unionappears to be working as documented: Causes the namespace at the mount point to appear as the union of the mounted filesystem root and the existing directory. Lookups will be done in the mounted filesystem first. That means when finds
d1in fs#1, that's used, instead of some virtual union directory being returned. So that's probably not a solution...