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?
2 Answers
unionfs is a shorthand for unionfs-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 using fusermount -u ~/example-mount-point (the -u switch means "unmount").
A big advantage of using fusermount instead of umount 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 for sudo, 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:
. ├── Fruits │ ├── Apple │ └── Tomato └── Vegetables ├── celery └── Tomato 2 directories, 4 files Now mount the Fruits and Vegetables on /tmp/mnt:
$ unionfs-fuse /tmp/unionfs/Fruits:/tmp/unionfs/Vegetables /tmp/mnt To unmount it do this:
# umount /tmp/mnt 1