1

Is it possible to do an overlay mount when one of the paths has a colon in it? All of the FUSE overlay mounting solutions I've looked at use a colon to separate the paths in the overlay, and I can't find a way to escape it.

1 Answer 1

2

Directory Structure

Let's say we're trying to overlay foo:bar, and bar:baz. The mount point will be union

foo
└── a
bar
└── b
foo:bar
└── c
bar:baz
└── d
union

mergerfs

No matter what escaping you try to do, you can see from the source that it won't work. Annoyingly if you try to guess a way to escape it:

$ mergerfs 'foo\:bar':'bar\:baz' union

it won't throw an error, but will silently ignore directories that don't exist:

$ ls union
b

unionfs-fuse

Same problem as mergerfs, no way to escape a colon. At least it'll fail with an error though if a directory doesn't exist:

$ unionfs-fuse 'foo\:bar':'bar\:baz' union
Failed to open /foo\/: No such file or directory. Aborting!

overlayfs

overlayfs does allow escaping colons in paths, but it's not a FUSE filesystem.

$ mount -t overlay overlay -o lowerdir='foo\:bar':'bar\:baz' union
$ ls union
c  d

Workaround

A simple workaround that works with both mergerfs and unionfs-fuse is to use a symlink:

$ ln -s foo:bar foo_bar
$ ln -s bar:baz bar_baz
$ unionfs-fuse foo_bar:bar_baz union
$ ls union
c  d

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.