diff --git a/mkdocs/docs/config/options.md b/mkdocs/docs/config/options.md index 008ebd10..ecb4f88f 100644 --- a/mkdocs/docs/config/options.md +++ b/mkdocs/docs/config/options.md @@ -35,7 +35,7 @@ These options are the same regardless of whether you use them with the exceeded) the policy selected will run to find a new location for the file. An attempt to move the file to that branch will occur (keeping all metadata possible) and if successful the original is - unlinked and the write retried. (default: false, true = mfs) + unlinked and the write retried. (default: pfrd) - **[inodecalc](inodecalc.md)=passthrough|path-hash|devino-hash|hybrid-hash**: Selects the inode calculation algorithm. (default: hybrid-hash) - **dropcacheonclose=BOOL**: When a file is requested to be closed @@ -160,7 +160,7 @@ These options are the same regardless of whether you use them with the epall) - **[category.create](functions_categories_policies.md)=POLICY**: Sets policy of all FUSE functions in the create category. (default: - epmfs) + pfrd) - **[category.search](functions_categories_policies.md)=POLICY**: Sets policy of all FUSE functions in the search category. (default: ff) - **[cache.statfs](cache.md#cachestatfs)=UINT**: 'statfs' cache @@ -171,8 +171,8 @@ These options are the same regardless of whether you use them with the timeout in seconds. (default: 1) - **[cache.negative_entry](cache.md#cachenegative_entry)=UINT**: Negative file name lookup cache timeout in seconds. (default: 0) -- **[cache.files](cache.md#cachefiles)=libfuse|off|partial|full|auto-full|per-process**: - File page caching mode (default: libfuse) +- **[cache.files](cache.md#cachefiles)=off|partial|full|auto-full|per-process**: + File page caching mode (default: off) - **cache.files.process-names=LIST**: A pipe | delimited list of process [comm](https://man7.org/linux/man-pages/man5/proc.5.html) names to enable page caching for when diff --git a/mkdocs/docs/faq/configuration_and_policies.md b/mkdocs/docs/faq/configuration_and_policies.md index 0dad7868..78fcd429 100644 --- a/mkdocs/docs/faq/configuration_and_policies.md +++ b/mkdocs/docs/faq/configuration_and_policies.md @@ -19,12 +19,12 @@ filesystems and can be added or removed without any impact it is extremely easy to test and experiment with different settings. -## Why is epmfs the default create policy? +## Why is pfrd the default create policy? -Because it is a strict policy and therefore does not increase entropy -of the filesystem layout. If you don't explicitly choose a policy then -the layout stays the same. It is far easier to stop being strict than -fix the layout after having a loose policy. +Originally the default was `epmfs` however it was found to cause +significant confusion among new users who expected mergerfs to always +choose a branch with available space. For mergerfs v2.41.0 it was +decided to change the default to the less restrictive policy `pfrd`. ## How can I ensure files are collocated on the same branch? @@ -88,5 +88,5 @@ If you wish to move files around or balance the pool you can: in mind that this tool is really just an example of how to accomplish such a task. The tool does not keep track of links so you may encounter an increase in used space if you rely on links to - reduce redundency. However, you can run a file dedup program like + reduce redundancy. However, you can run a file dedup program like [rdfind](https://github.com/pauldreik/rdfind) to restore the links. diff --git a/mkdocs/docs/quickstart.md b/mkdocs/docs/quickstart.md index f5a210c0..81a71662 100644 --- a/mkdocs/docs/quickstart.md +++ b/mkdocs/docs/quickstart.md @@ -22,6 +22,7 @@ cases. * cache.files=off * category.create=pfrd +* func.getattr=newest * dropcacheonclose=false In previous versions of Linux it was unable to support `mmap` if [page @@ -44,6 +45,7 @@ IO.) * cache.files=auto-full * category.create=pfrd +* func.getattr=newest * dropcacheonclose=true @@ -51,6 +53,7 @@ IO.) * cache.files=off * category.create=pfrd +* func.getattr=newest * dropcacheonclose=false @@ -59,14 +62,14 @@ IO.) ### Command Line ``` -mergerfs -o cache.files=off,dropcacheonclose=false,category.create=pfrd /mnt/hdd0:/mnt/hdd1 /media +mergerfs -o cache.files=off,category.create=pfrd,func.getattr=newest,dropcacheonclose=false /mnt/hdd0:/mnt/hdd1 /media ``` ### /etc/fstab ``` -/mnt/hdd0:/mnt/hdd1 /media mergerfs cache.files=off,dropcacheonclose=false,category.create=pfrd 0 0 +/mnt/hdd0:/mnt/hdd1 /media mergerfs cache.files=off,category.create=pfrd,func.getattr=newest,dropcacheonclose=false 0 0 ``` ### /etc/fstab w/ config file @@ -86,6 +89,7 @@ For more complex setups it can be useful to separate out the config. ```ini title="media.ini" linenums="1" cache.files=off category.create=pfrd +func.getattr=newest dropcacheonclose=false ``` @@ -119,6 +123,7 @@ ExecStart=/usr/bin/mergerfs \ -f \ -o cache.files=off \ -o category.create=pfrd \ + -o func.getattr=newest \ -o dropcacheonclose=false \ /mnt/hdd0:/mnt/hdd1 \ /media @@ -182,6 +187,7 @@ ExecStart=/usr/bin/mergerfs \ -f \ -o cache.files=off \ -o category.create=pfrd \ + -o func.getattr=newest \ -o dropcacheonclose=false \ /mnt/hdd0:/mnt/hdd1 \ /media diff --git a/src/config.cpp b/src/config.cpp index 0a7ac7ef..3757f696 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -87,7 +87,7 @@ Config::Config() branches_mount_timeout(0), cache_attr(1), cache_entry(1), - cache_files(CacheFiles::ENUM::LIBFUSE), + cache_files(CacheFiles::ENUM::OFF), cache_files_process_names(CACHE_FILES_PROCESS_NAMES_DEFAULT), cache_negative_entry(0), cache_readdir(false), @@ -110,10 +110,10 @@ Config::Config() link_exdev(LinkEXDEV::ENUM::PASSTHROUGH), log_metrics(false), mountpoint(), - moveonenospc(false), + moveonenospc(true), nfsopenhack(NFSOpenHack::ENUM::OFF), nullrw(false), - parallel_direct_writes(false), + parallel_direct_writes(true), posix_acl(false), readahead(0), readdir("seq"), diff --git a/src/config_moveonenospc.cpp b/src/config_moveonenospc.cpp index 17950cc8..50fcc195 100644 --- a/src/config_moveonenospc.cpp +++ b/src/config_moveonenospc.cpp @@ -31,11 +31,13 @@ MoveOnENOSPC::from_string(const std::string &s_) rv = str::from(s_,&enabled); if((rv == 0) && (enabled == true)) - s = "mfs"; + s = "pfrd"; + ef((rv == 0) && (enabled == false)) + return (enabled = false,0); ef(rv != 0) s = s_; else - return 0; + return -EINVAL; tmp = Policies::Create::find(s); if(tmp == NULL) diff --git a/src/config_moveonenospc.hpp b/src/config_moveonenospc.hpp index 2aac71fb..a9c827c1 100644 --- a/src/config_moveonenospc.hpp +++ b/src/config_moveonenospc.hpp @@ -30,7 +30,7 @@ class MoveOnENOSPC : public ToFromString public: MoveOnENOSPC(const bool enabled_) : enabled(enabled_), - policy(&Policies::Create::mfs) + policy(&Policies::Create::pfrd) { } diff --git a/src/func.hpp b/src/func.hpp index 97ef6f64..d3c4aa69 100644 --- a/src/func.hpp +++ b/src/func.hpp @@ -87,7 +87,7 @@ namespace Func { public: CreateDefault() - : Func::Base::Create(&Policies::Create::epmfs) + : Func::Base::Create(&Policies::Create::pfrd) { } };