unionfs と mount の union オプションの違い2008年05月04日 12時31分51秒

随分古いメールだが、unionfs と -o union の違いが Re: [ANN] 8-CURRENT, RELENG_7 and RELENG_6 have gotten latest ?unionfs improvements で紹介されている。これを読んだ時に、これらの二つの違いが分かった。-o union は未だに試したことは無いが、後学の為に簡単に訳しておく。

 > Btw, I was wondering: is unionfs related in any way with -ounion
 > option of mount_*?

No.  The union mount option (-o union) is completely separate
from UNIONFS, although it can be used to achieve a somewhat
similar effect.  It depends on your requirements whether it
is sufficient or not.
-o union と unionfs は別物だ。

 > I was told long time ago that -ounion is even
 > more broken than unionfs.

That's wrong.  The union mount option was _never_ really
broken.  I'm using it for almost as long as FreeBSD exists.

However UNIONFS was broken for a long time (along with
NULLFS and UMAPFS).  NULLFS has been fixed some time ago,
UMAPFS was abandoned apparently, i.e. nobody showed up to
fix it, and UNIONFS was pretty much completely overhauled
by Daichi GOTO and his team.  I would now regard it as
union オプションは FreeBSD が始まってから壊れていたことはない。しかし、unionfs は長い間壊れていた。ゴトウさん達によって修正された。

 > Though, those two features seem to do very
 > similar thing and I think that -ounion option is pretty useful.

Yes, it is useful.  The biggest differences are:
 - The union mount option newly mounts a filesystem on top
   of an arbitrary existing directory tree, while UNIONFS
   mounts another representation of one existing directory
   tree on top of another one.  That means UNIONFS does the
   same as NULLFS, but unlike NULLFS it does not hide the
   underlying directory tree.
unoin マウントオプションはファイルシステムを他のディレクトリの上にマウントする。unionfs は既にマウントされているファイルシステムを他のディレクトリ上に重ね合わせてマウントする事が出来る。
 - When using the union mount option, only the entries in
   the root directory show through from the "lower" file
   system.  When using UIONFS, _all_ entries in _all_
   directories are visible (unless masked by an identical
   entry in the upper file system, of course).
 - The implementation of the union mount option is rather
   simple has rather low overhead.  UNIONFS is much more
   complex and has some overhead for certain operations,
   especially when files and directories have to be created
   automatically in the upper layer.
union オプションの実装は unionfs に比べて単純だ。