You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.9 KiB

  1. # Configuration and Policies
  2. ## What policies should I use?
  3. Unless you're doing something more niche the average user is probably
  4. best off using `mfs` for `category.create`. It will spread files out
  5. across your branches based on available space. Use `mspmfs` if you
  6. want to try to colocate the data a bit more. You may want to use `lus`
  7. if you prefer a slightly different distribution of data if you have a
  8. mix of smaller and larger filesystems. Generally though `mfs`, `lus`,
  9. or even `rand` are good for the general use case. If you are starting
  10. with an imbalanced pool you can use the tool **mergerfs.balance** to
  11. redistribute files across the pool. That said "balancing" really
  12. should not be needed. There is really no inherent issue with being
  13. unbalanced. "Optimal" layout is related to usage patterns and most
  14. people don't have patterns that are performance sensitive or specific
  15. enough to do anything about. Additionally, the balance tool is very
  16. simplistic and was not written to be as serious tool that accounts for
  17. edge cases.
  18. If you really wish to try to colocate files based on directory you can
  19. set `func.create` to `epmfs` or similar and `func.mkdir` to `rand` or
  20. `eprand` depending on if you just want to colocate generally or on
  21. specific branches. Either way the _need_ to colocate is rare. For
  22. instance: if you wish to remove the device regularly and want the data
  23. to predictably be on that device or if you don't use backup at all and
  24. don't wish to replace that data piecemeal. In which case using path
  25. preservation can help but will require some manual
  26. attention. Colocating after the fact can be accomplished using the
  27. **mergerfs.consolidate** tool. If you don't need strict colocation
  28. which the `ep` policies provide then you can use the `msp` based
  29. policies which will walk back the path till finding a branch that
  30. works.
  31. Ultimately there is no correct answer. It is a preference or based on
  32. some particular need. mergerfs is very easy to test and experiment
  33. with. I suggest creating a test setup and experimenting to get a sense
  34. of what you want.
  35. `epmfs` is the default `category.create` policy because `ep` policies
  36. are not going to change the general layout of the branches. It won't
  37. place files/dirs on branches that don't already have the relative
  38. branch. So it keeps the system in a known state. It's much easier to
  39. stop using `epmfs` or redistribute files around the filesystem than it
  40. is to consolidate them back.
  41. ## What settings should I use?
  42. Depends on what features you want. Generally speaking, there are no
  43. "wrong" settings. All settings are feature related. The best bet is to
  44. read over the available options and choose what fits your
  45. situation. If something isn't clear from the documentation please
  46. reach out and the documentation will be improved.
  47. For the average person the settings described in the [Quick
  48. Start](../quickstart.md) are sufficient.
  49. ## Why are all my files ending up on 1 filesystem?!
  50. Did you start with empty filesystems? Did you explicitly configure a
  51. `category.create` policy? Are you using an `existing path` / `path
  52. preserving` policy?
  53. The default create policy is `epmfs`. That is a path preserving
  54. algorithm. With such a policy for `mkdir` and `create` with a set of
  55. empty filesystems it will select only 1 filesystem when the first
  56. directory is created. Anything, files or directories, created in that
  57. first directory will be placed on the same branch because it is
  58. preserving paths.
  59. This may catch new users off guard but this policy is the safest
  60. policy to start with as it will not change the general layout of the
  61. underlying filesystems. If you do not care about path preservation
  62. (most shouldn't) and wish your files to be spread across all your
  63. filesystems change to `mfs` or similar
  64. [policy](../config/functions_categories_and_policies.md). If you do
  65. want path preservation you'll need to perform the manual act of
  66. creating paths on the filesystems you want the data to land on before
  67. transferring your data.