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.

112 lines
4.9 KiB

  1. # "Why isn't it working?"
  2. ## I modified mergerfs' config but it still behaves the same.
  3. mergerfs, like most filesystems, are given their options/arguments
  4. at mount time. Unlike most filesystems, mergerfs also has the ability
  5. to modify certain options at [runtime](../runtime_interfaces.md).
  6. That said: mergerfs does not actively try to monitor typical methods
  7. of configuration (nor should it.) As such if changes are made to
  8. `/etc/fstab`, a systemd unit file, etc. it will have no knowledge of
  9. those changes. It is the user's responsibility to
  10. [restart](../setup/upgrade.md) mergerfs to pick up the changes or use
  11. the [runtime interface](../runtime_interfaces.md).
  12. ## Why are all my files ending up on 1 filesystem?!
  13. Did you start with empty filesystems? Did you explicitly configure a
  14. `category.create` policy? Are you using an `existing path` / `path
  15. preserving` policy?
  16. The default create policy is `epmfs`. That is a path preserving
  17. algorithm. With such a policy for `mkdir` and `create` with a set of
  18. empty filesystems it will select only 1 filesystem when the first
  19. directory is created. Anything, files or directories, created in that
  20. directory will be placed on the same branch because it is preserving
  21. paths. That is the expected behavior.
  22. This may catch new users off guard but this policy is the safest
  23. policy to start with as it will not change the general layout of the
  24. underlying branches. If you do not care about path preservation ([most
  25. should
  26. not](configuration_and_policies.md#how-can-i-ensure-files-are-collocated-on-the-same-branch))
  27. and wish your files to be spread across all your filesystems change to
  28. `pfrd`, `rand`, `mfs` or similar
  29. [policy](../config/functions_categories_and_policies.md).
  30. ## Why isn't the create policy working?
  31. It probably is. The policies rather straight forward and well tested.
  32. First, confirm the policy is configured as expected by using the
  33. [runtime interface](../runtime_interfaces.md).
  34. ```shell
  35. $ getfattr -n user.mergerfs.category.create /mnt/mergerfs/.mergerfs
  36. # file: mnt/mergerfs/.mergerfs
  37. user.mergerfs.category.create="mfs"
  38. ```
  39. Second, as discussed in the [support](../support.md) section, test the
  40. behavior using simple command line tools such as `touch` and then see
  41. where it was created.
  42. ```shell
  43. $ touch /mnt/mergerfs/new-file
  44. $ getfattr -n user.mergerfs.allpaths /mnt/mergerfs/new-file
  45. # file: mnt/mergerfs/new-file
  46. user.mergerfs.allpaths="/mnt/hdd/drive1/new-file"
  47. ```
  48. If the location of the file is where it should be according to the
  49. state of the system at the time and the policy selected then the
  50. "problem" lies elsewhere.
  51. [Keep in
  52. mind](technical_behavior_and_limitations.md/#how-does-mergerfs-handle-moving-and-copying-of-files)
  53. that files, when created, have no size. If a number of files are
  54. created at the same time, for example by a program downloading
  55. numerous files like a BitTorrent client, then depending on the policy
  56. the files could be created on the same branch. As the files are
  57. written to, or resized immediately afterwards to the total size of the
  58. file being downloaded, the files will take up more space but there is
  59. no mechanism to move them as they grow. Nor would it be a good idea to
  60. do so as it would be expensive to continuously calculate their size and
  61. perform the move while the file is still being written to. As such an
  62. imbalance will occur that wouldn't if the files had been downloaded
  63. one at a time.
  64. If you wish to reduce the likelihood of this happening a policy that
  65. does not make decisions on available space alone such as `pfrd` or
  66. `rand` should be used.
  67. ## Why can't I see my files / directories?
  68. It's almost always a permissions issue. Unlike mhddfs and
  69. unionfs-fuse, which accesses content as root, mergerfs always changes
  70. its credentials to that of the caller. This is done as it is the only
  71. properly secure way to manage permissions. This means that if the user
  72. does not have access to a file or directory than neither will
  73. mergerfs. However, because mergerfs is creating a union of paths it
  74. may be able to read some files and directories on one filesystem but
  75. not another resulting in an incomplete set. And if one of the branches
  76. it can access is empty then it will return an empty list.
  77. Try using [mergerfs.fsck](https://github.com/trapexit/mergerfs-tools)
  78. tool to check for and fix inconsistencies in permissions. If you
  79. aren't seeing anything at all be sure that the basic permissions are
  80. correct. The user and group values are correct and that directories
  81. have their executable bit set. A common mistake by users new to Linux
  82. is to `chmod -R 644` when they should have `chmod -R u=rwX,go=rX`.
  83. If using a [network filesystem](../remote_filesystems.md) such as NFS
  84. or SMB (Samba) be sure to pay close attention to anything regarding
  85. permissioning and users. Root squashing and user translation for
  86. instance has bitten a few mergerfs users. Some of these also affect
  87. the use of mergerfs from [container platforms such as
  88. Docker.](compatibility_and_integration.md)