Add FAQ section on common perceived problems

This commit is contained in:
Antonio SJ Musumeci 2025-02-22 22:18:20 -06:00
parent c0d5f4795a
commit 3a33a6db2b
5 changed files with 160 additions and 83 deletions

View file

@ -2,21 +2,26 @@
## Do hardlinks work?
Yes. See also the option `inodecalc` for how inode values are
calculated.
Yes. There is no option to enable or disable links. They are
fundimentally supported in compatible situations. That said the inode
of a file is not necessarily indicitive of two file names linking to
the same underlying data. See also the option `inodecalc` for how
inode values are calculated.
What mergerfs does not do is fake hard links across branches. Read
the section "rename & link" for how it works.
What mergerfs does not do is fake hard links across branches. Read the
section [rename & link](../config/rename_and_link.md) for how it
works.
Remember that hardlinks will **NOT** work across devices. That
includes between the original filesystem and a mergerfs pool, between
two separate pools of the same underlying filesystems, or bind mounts
of paths within the mergerfs pool. The latter is common when using
Docker or Podman. Multiple volumes (bind mounts) to the same
underlying filesystem are considered different devices. There is no
way to link or rename between them. You should mount in the highest
directory in the mergerfs pool that includes all the paths you need if
you want links and rename to work.
Remember that hardlinks will NOT work across devices. That includes
between the original filesystem and a mergerfs pool, between two
separate pools of the same underlying filesystems, or bind mounts of
paths within the mergerfs pool. The latter is common when using Docker
or Podman. Multiple volumes (bind mounts) to the same underlying
filesystem are considered different devices. There is no way to link
between them. You should mount in the highest directory in the
mergerfs pool that includes all the paths you need if you want links
to work.
## How does mergerfs handle moving and copying of files?
@ -27,8 +32,8 @@ individual filesystem functions.
A "move" can include a "copy" so lets describe copy first.
When an application copies a file from source to destination it can do
so in a number of ways but the basics are the following.
When an application copies a file from "source" to "destination" it
can do so in a number of ways but the basics are the following.
1. `open` the source file.
2. `create` the destination file.
@ -58,13 +63,16 @@ some low level settings for the operating system.
All of this means that mergerfs can not make decisions when a file is
created based on file size or the source of the data. That information
is simply not available. At best mergerfs could respond to files
reaching a certain size when writing data or when a file is closed.
reaching a certain size when writing data, a file is closed, or
renamed.
Related: if a user wished to have mergerfs perform certain activities
based on the name of a file it is common and even best practice for a
program to write to a temporary file first and then rename to its
final destination. That temporary file name will typically be random
and have no indication of the type of file being written.
and have no indication of the type of file being written. At best
something could be done on rename.
## Does FICLONE or FICLONERANGE work?
@ -75,26 +83,27 @@ an error back to the application making the request.
Should FUSE gain the ability mergerfs will be updated to support it.
## Why do I get an "out of space" / "no space left on device" / ENOSPC error even though there appears to be lots of space available?
First make sure you've read the sections above about policies, path
preservation, branch filtering, and the options **minfreespace**,
**moveonenospc**, **statfs**, and **statfs_ignore**.
preservation, branch filtering, and the options `minfreespace`,
`moveonenospc`, `statfs`, and `statfs_ignore`.
mergerfs is simply presenting a union of the content within multiple
branches. The reported free space is an aggregate of space available
within the pool (behavior modified by **statfs** and
**statfs_ignore**). It does not represent a contiguous space. In the
within the pool (behavior modified by `statfs` and
`statfs_ignore`). It does not represent a contiguous space. In the
same way that read-only filesystems, those with quotas, or reserved
space report the full theoretical space available.
Due to path preservation, branch tagging, read-only status, and
**minfreespace** settings it is perfectly valid that `ENOSPC` / "out
of space" / "no space left on device" be returned. It is doing what
was asked of it: filtering possible branches due to those
settings. Only one error can be returned and if one of the reasons for
filtering a branch was **minfreespace** then it will be returned as
such. **moveonenospc** is only relevant to writing a file which is too
`minfreespace` settings it is perfectly valid that `ENOSPC` / "out of
space" / "no space left on device" be returned. It is doing what was
asked of it: filtering possible branches due to those settings. Only
one error can be returned and if one of the reasons for filtering a
branch was `minfreespace` then it will be returned as
such. `moveonenospc` is only relevant to writing a file which is too
large for the filesystem it's currently on.
It is also possible that the filesystem selected has run out of
@ -107,6 +116,7 @@ looking for. The reason it's not default is because it was originally
set to `epmfs` and changing it now would change people's setup. Such a
setting change will likely occur in mergerfs 3.
## Why does the total available space in mergerfs not equal outside?
Are you using ext2/3/4? With reserve for root? mergerfs uses available
@ -115,6 +125,7 @@ it won't show up.
You can remove the reserve by running: `tune2fs -m 0 <device>`
## I notice massive slowdowns of writes when enabling cache.files.
When file caching is enabled in any form (`cache.files!=off`) it will
@ -141,32 +152,6 @@ To work around this situation mergerfs offers a few solutions.
`mmap` it's probably simpler to just disable it altogether. The
kernel won't send the requests when caching is disabled.
## Why can't I see my files / directories?
It's almost always a permissions issue. Unlike mhddfs and
unionfs-fuse, which runs as root and attempts to access content as
such, mergerfs always changes its credentials to that of the
caller. This means that if the user does not have access to a file or
directory than neither will mergerfs. However, because mergerfs is
creating a union of paths it may be able to read some files and
directories on one filesystem but not another resulting in an
incomplete set.
Whenever you run into a split permission issue (seeing some but not
all files) try using
[mergerfs.fsck](https://github.com/trapexit/mergerfs-tools) tool to
check for and fix the mismatch. If you aren't seeing anything at all
be sure that the basic permissions are correct. The user and group
values are correct and that directories have their executable bit
set. A common mistake by users new to Linux is to `chmod -R 644` when
they should have `chmod -R u=rwX,go=rX`.
If using a network filesystem such as NFS or SMB (Samba) be sure to
pay close attention to anything regarding permissioning and
users. Root squashing and user translation for instance has bitten a
few mergerfs users. Some of these also affect the use of mergerfs from
container platforms such as Docker.
## Why use FUSE? Why not a kernel based solution?