Hello Erez,

I was trying to merge all branches which is mounted using unionfs , but
couldn't find any standard process to achieve this.  Using unionfs we can
only create unionised view but can we create merged directory (which will
contain contents of all branches).  I thought i could mount two branches on
/merge (See details below) and copy or archive the directory into another
directory but not sure is this is correct approach.  ?

My only intent is to create merged directory of all branches.

Here are the steps i have tried.

[r...@cogdm52_1 ~]# mkdir /d1
[r...@cogdm52_1 ~]# mkdir /d2
[r...@cogdm52_1 ~]# touch /d1/f1
[r...@cogdm52_1 ~]# touch /d2/f2
[r...@cogdm52_1 ~]#mount -t unionfs -o dirs=/d1:/d2=ro none /merge
[r...@cogdm52_1 ~]# ls /merge/
f1  f2

[r...@cogdm52_1 ~]# rm /merge/f1
[r...@cogdm52_1 ~]# touch /merge/.hide
[r...@cogdm52_1 merge]# cd /merge
[r...@cogdm52_1 merge]# ls -la
total 8
drwxr-xr-x  2 root root 4096 Jul  2 06:52 .
drwxr-xr-x 29 root root 4096 Jul  2 06:46 ..
-rw-r--r--  1 root root    0 Jul  2 06:46 f2
-rw-r--r--  1 root root    0 Jul  2 06:52 .hide



When i Option 1 this command it copies hidden file as well which is right
also.
*Option 1
-------------------
*[r...@cogdm52_1 ~]# find . | cpio -p /opt/test/

[r...@cogdm52_1 ~]# ls -la /opt/test/
drwxr-xr-x 7 root root 4096 Jul  2 07:13 .
drwxr-xr-x 3 root root 4096 Jul  2 07:13 ..
-rw-r--r--  1 root root    0 Jul  2 06:46 f2
-rw-r--r--  1 root root    0 Jul  2 06:52 .hide

*Option 2
-------------------*
[r...@cogdm52_1 merge]# cp -ax * /opt/test/
[r...@cogdm52_1 ~]# ls -la /opt/test/
drwxr-xr-x 7 root root 4096 Jul  2 07:13 .
drwxr-xr-x 3 root root 4096 Jul  2 07:13 ..
-rw-r--r--  1 root root    0 Jul  2 06:46 f2


Is there any better utility to merge and create one single directory of all
branches ?




-- 
Regards
Arun Sharma
_______________________________________________
unionfs mailing list: http://unionfs.filesystems.org/
unionfs@mail.fsl.cs.sunysb.edu
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to