1

From man mount_unionfs:

BUGS:
THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR OWN
RISK. BEWARE OF DOG. SLIPPERY WHEN WET. BATTERIES NOT INCLUDED.

This code also needs an owner in order to be less dangerous 

Bit scarey eh? It goes on to explain some of the issues but it would need specialist knowledge of the file system handling to be sure what the extent of issues and edge cases are.

Nonetheless perhaps it is well known, or clear to someone with more knowledge:

Are the dangers well enough defined that it's only under certain uses, or certain less-likely/easily avoided edge-cases, that a serious issue might arise? Or is closer to being "if your data matters never, ever, ever, use unionfs mount with it, even with a gun to your head"

2 Answers 2

1

unionfs on FreeBSD really is that bad.

If there are files with the same name in both the lower and the upper layer, the kernel will return both, and the duplicates will have to be filtered out in userland.

Quoting from the source of opendir(3) in FreeBSD:

/*
 * The strategy here is to read all the directory
 * entries into a buffer, sort the buffer, and
 * remove duplicate entries by setting the inode
 * number to zero.
 *
 * We reopen the directory because _getdirentries()
 * on a MNT_UNION mount modifies the open directory,
 * making it refer to the lower directory after the
 * upper directory's entries are exhausted.
 * This would otherwise break software that uses
 * the directory descriptor for fchdir or *at
 * functions, such as fts.c.
 */

If that's not enough to turn one's stomach, then I don't know what will ;-)

0

Mount_unionfs should be used only in an environment where one of the two sources is read-only.

With that said, I've used it in that context on my NAS4Free server for over 5 years (to install additional packages onto my "embedded" install). I have not had a single problem w/ it in all that time. It's extremely quick and easy to setup, esp. compared to jails.

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.