I have mounted a directory with the following command
sudo unionfs -o cow,max_files=32768 -o allow_other,use_ino,suid,dev,nonempty stuff-linux64=RW stuff
How do I change stuff-linux64 from RW to RO and add another directory (stuff-update64) on top?
The end result should look like I'd executed:
sudo unionfs -o cow,max_files=32768 -o allow_other,use_ino,suid,dev,nonempty stuff-update64=RW:stuff-linux64=RO stuff
after unmounting stuff.
For that matter, how do I unmount a filesystem that I mounted with unionfs?
unionfs
is a shorthand forunionfs-fuse
which is built atop the FUSE (Filesystem in Userspace) system. Therefore, the preferable way to unmount a unionfs-fuse is through the FUSE system directly usingfusermount -u ~/example-mount-point
(the-u
switch means "unmount").A big advantage of using
fusermount
instead ofumount
is it requires no privilege elevation. As the name implies, FUSE all happens in userspace. That means both mounting and unmounting can be accomplished from your limited user account, with no need forsudo
, provided of course that you have permission to access the directories you're working with.I think just
umount <the-mount-dir>
is enough.Here is an example: Say I have this directory structure under
/tmp/unionfs
:Now mount the
Fruits
andVegetables
on/tmp/mnt
:To unmount it do this: