Hello Audrius,

Audrius aiknas:
> What I would like, is for the files to remain in their current branches
> even they were modified.
> Is there such feature implemented?

How about copyup= mount option?

(from the aufs manual)
----------------------------------------------------------------------
.SH Policies to Select One among Multiple Writable Branches
Aufs has some policies to select one among multiple writable branches
when you are going to write/modify something. There are two kinds of
policies, one is for newly create something and the other is for
internal copy-up.
You can select them by specifying mount option `create=CREATE_POLICY'
or `cpup=COPYUP_POLICY.'
These policies have no meaning when you have only one writable
branch. If there is some meaning, it must hurt the performance.

.SS Exceptions for Policies
In every cases below, even if the policy says that the branch where a
new file should be created is /rw2, the file will be created on /rw1.
.
.Bu
If there is a readonly branch with `wh' attribute above the
policy-selected branch and the parent dir is marked as opaque,
or the target (creating) file is whiteouted on the ro+wh branch, then
the policy will be ignored and the target file will be created on the
nearest upper writable branch than the ro+wh branch.
.RS
.nf
/aufs = /rw1 + /ro+wh/diropq + /rw2
/aufs = /rw1 + /ro+wh/wh.tgt + /rw2
.fi
.RE
.
.Bu
If there is a writable branch above the policy-selected branch and the
parent dir is marked as opaque or the target file is whiteouted on the
branch, then the policy will be ignored and the target file will be
created on the highest one among the upper writable branches who has
diropq or whiteout. In case of whiteout, aufs removes it as usual.
.RS
.nf
/aufs = /rw1/diropq + /rw2
/aufs = /rw1/wh.tgt + /rw2
.fi
.RE
.
.Bu
link(2) and rename(2) systemcalls are exceptions in every policy.
They try selecting the branch where the source exists as possible since
copyup a large file will take long time. If it can't be, ie. the
branch where the source exists is readonly, then they will follow the
copyup policy.
.
.Bu
There is an exception for rename(2) when the target exists.
If the rename target exists, aufs compares the index of the branches
where the source and the target are existing and selects the higher
one. If the selected branch is readonly, then aufs follows the copyup
policy.

.SS Policies for Creating
.
.TP
.B create=tdp | top\-down\-parent
Selects the highest writable branch where the parent dir exists. If
the parent dir does not exist on a writable branch, then the internal
copyup will happen. The policy for this copyup is always `bottom-up.'
This is the default policy.
.
.TP
.B create=rr | round\-robin
Selects a writable branch in round robin. When you have two writable
branches and creates 10 new files, 5 files will be created for each
branch.
mkdir(2) systemcall is an exception. When you create 10 new directories,
all are created on the same branch.
.
.TP
.B create=mfs[:second] | most\-free\-space[:second]
Selects a writable branch which has most free space. In order to keep
the performance, you can specify the duration (`second') which makes
aufs hold the index of last selected writable branch until the
specified seconds expires. The first time you create something in aufs
after the specified seconds expired, aufs checks the amount of free
space of all writable branches by internal statfs call
and the held branch index will be updated.
The default value is \*[AUFS_MFS_SECOND_DEF] seconds.
.
.TP
.B create=mfsrr:low[:second]
Selects a writable branch in most-free-space mode first, and then
round-robin mode. If the selected branch has less free space than the
specified value `low' in bytes, then aufs re-tries in round-robin mode.
.\" `G', `M' and `K' (case insensitive) can be followed after `low.' Or
Try an arithmetic expansion of shell which is defined by POSIX.
For example, $((10 * 1024 * 1024)) for 10M.
You can also specify the duration (`second') which is equivalent to
the `mfs' mode.
.
.TP
.B create=pmfs[:second]
Selects a writable branch where the parent dir exists, such as tdp
mode. When the parent dir exists on multiple writable branches, aufs
selects the one which has most free space, such as mfs mode.

.SS Policies for Copy-Up
.
.TP
.B cpup=tdp | top\-down\-parent
Equivalent to the same named policy for create.
This is the default policy.
.
.TP
.B cpup=bup | bottom\-up\-parent
Selects the writable branch where the parent dir exists and the branch
is nearest upper one from the copyup-source.
.
.TP
.B cpup=bu | bottom\-up
Selects the nearest upper writable branch from the copyup-source,
regardless the existence of the parent dir.
----------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

Reply via email to