Posted Jan 17, 2008 11:42 UTC (Thu) by etienne_lorrain@yahoo.fr (guest, #38022)
Parent article: State of the unionfs
Not being a specialist, what is the real advantage of using unionfs compared to having a
small partition - lets call it /mnt/disk and a CDROM mounted as /mnt/cdrom - then doing a "cp
-lR /mnt/cdrom /mnt/disk"?
That is, using links to all the files. A link will not use a lot of space in the filesystem,
and solve the complex problem of mapping file attributes of different filesystem (how to deal
with r/w/x access restriction if the underlying filesystem is FAT, how to map a device onto a
FAT or ISOFS filesystem, how to deal with soft/hard links, how to deal with a file from the
source filesystem too big for the target filesystem...).
Posted Jan 17, 2008 13:24 UTC (Thu) by njh (subscriber, #4425)
[Link]
"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.
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.
State of the unionfs
Posted Jan 17, 2008 13:26 UTC (Thu) by rvfh (subscriber, #31018)
[Link]