AUFS:coo - "Copy on Open" as a Way to Identified Needed Files

an incubator for software projects


Moderator: Forum moderators

Post Reply
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

AUFS:coo - "Copy on Open" as a Way to Identified Needed Files

Post by s243a »

I noticed from the aufs documentation that there is an option called "coo" which stands for "Copy on Open". From the documentation:

coo=none | leaf | all

Specifies copy-on-open level. When you open a file which is on readonly branch, aufs opens the file after copying-up it to the writable branch following this level. This option may be useful for who wants to spin down his hard drive in order to save battery power, or who wants to observe which files are accessed. When the keyword ’all’ is specified, aufs copies-up the opening object even if it is a directory. In this case, simple ’ls’ or ’find’ cause the copyup and your writable branch will have a lot of empty directories. When the keyword ’leaf’ is specified, aufs copies-up the opening object except directory. The keyword ’none’ disables copy-on-open. When aufs itself is mounted as readonly, ’coo=none’ is forced even if other value was specified. Otherwise returns an error. The default is ’coo=none’.

http://aufs.sourceforge.net/aufs.html

I noticed this because when I looked at my psandbox scripts I saw more files being created in the save file then I think would have changed. This coo feature might be nice if you want to have a system run in ram. For instance perhaps you put the top layer in zram (compressed ram) and then the aufs would copy the files into zram.

Files which are opened when running a system are likely the files which are needed, so by seeing which files coo creates within the rw layer (i.e. save layer) we see which files that we likely need in a running system. Needless to say for normal use I didn't want this behavior in my save file. I tried to fix this problem by setting "coo=none" that gave me an error. So maybe coo applies to a specific branch and can only be used when appending a layer (not sure). What did seem to work though was adding the following standard puppy options "udba=reval,diropq=w".

But if we want to experiment with this coo behavior then we can mount without these options.

Post Reply

Return to “Development”