I have been trying to mount directories in linux additively and fail to do so. I have three directrories a, b and c. a contains file x, b contains file y and c contains file z. Now when i mount "a" and "b" into c and then open c there are only x and y present in "c". when i mount a, b and c into c the directory c is empty and ls says permission denied. i cannot also unmount c even with sudo. What i want to do is to mount a b and c in one of them and be able to see x y and z all together. is it possible or is there a solution to this problem please let me know.
[email protected]:~$ mkdir /tmp/test1 /tmp/test2 /tmp/test3
[email protected]:~$ touch /tmp/test{1,2,3}/{a,b,c}
[email protected]:~$ rm /tmp/test1/{b,c}
[email protected]:~$ rm /tmp/test2/{a,c}
[email protected]:~$ rm /tmp/test3/{a,b}
[email protected]:~$ ls -al /tmp/test*/
/tmp/test1/:
total 16
drwxrwxr-x 2 naveed naveed 4096 Mar 9 15:00 .
drwxrwxrwt 11 root root 12288 Mar 9 15:00 ..
-rw-rw-r-- 1 naveed naveed 0 Mar 9 15:00 a
/tmp/test2/:
total 16
drwxrwxr-x 2 naveed naveed 4096 Mar 9 15:00 .
drwxrwxrwt 11 root root 12288 Mar 9 15:00 ..
-rw-rw-r-- 1 naveed naveed 0 Mar 9 15:00 b
/tmp/test3/:
total 16
drwxrwxr-x 2 naveed naveed 4096 Mar 9 15:00 .
drwxrwxrwt 11 root root 12288 Mar 9 15:00 ..
-rw-rw-r-- 1 naveed naveed 0 Mar 9 15:00 c
[email protected]:~$ sudo unionfs-fuse -o nonempty /tmp/test1=RO:/tmp/test2=RO:/tmp/test3=RO /tmp/test1/
[email protected]:~$ ls -al /tmp/test1
ls: cannot access /tmp/test1: Permission denied
[email protected]:~$ sudo ls -al /tmp/test1
#nothing shows up here