LWN.net Logo

State of the unionfs

State of the unionfs

Posted Jan 17, 2008 13:24 UTC (Thu) by njh (subscriber, #4425)
In reply to: State of the unionfs by etienne_lorrain@yahoo.fr
Parent article: State of the unionfs

"cp -l" makes hard links. You can't make hard links between different filesystems.

You could set up a tree of symlinks, but a tree of links (hard or soft) also 
doesn't have the same behaviour as a true unionfs or union mount. If you
open a symlink to a read-only file on a CD-ROM then you get a file handle
that points to a read-only file. If you stack a writable layer on top of
a read-only layer using a union then you can open a file on the CD-ROM
for modification and the modified version will end up on the writable
layer and be seen by subsequent readers in place of the original on the lower 
layer. It works with existing applications that just call open() and write() 
naively. Without something like a union filesystem to do this for you, the
application would have to know about the tree of links trick and explicitly
do the "remove the link, copy the file, modify the copy" work itself.


(Log in to post comments)

State of the unionfs

Posted Jan 17, 2008 15:09 UTC (Thu) by etienne_lorrain@yahoo.fr (guest, #38022) [Link]

 It would not be simpler to do a patch to interpret differently the soft link, kind of: "if
sticky bit is set, the target file is read-only, and the soft link is itself writeable, when a
modified file is saved, the symlink is deleted and the content of the file is itself written
in the filesystem".
 That would imply the filesystem supports soft symlink and sticky bits, but would not be that
intrusive, and you can still have read-only files and manage a chmod on this "unionfs".

man chmod extract:
 chmod never changes the permissions of symbolic links; the chmod system
 call  cannot change their permissions.  This is not a problem since the
 permissions of symbolic links are never used.  However, for  each  sym-
 bolic link listed on the command line, chmod changes the permissions of
 the pointed-to file.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds