mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 11:56:31 -05:00
try to clarify how path preserving policies work and other tweaks to docs
This commit is contained in:
parent
09dabc7b4c
commit
94ebccc6ed
2 changed files with 134 additions and 109 deletions
182
man/mergerfs.1
182
man/mergerfs.1
|
|
@ -1,5 +1,8 @@
|
|||
.\"t
|
||||
.\" Automatically generated by Pandoc 1.16.0.2
|
||||
.\"
|
||||
.TH "mergerfs" "1" "2017\-02\-18" "mergerfs user manual" ""
|
||||
.hy
|
||||
.SH NAME
|
||||
.PP
|
||||
mergerfs \- another (FUSE based) union filesystem
|
||||
|
|
@ -144,22 +147,21 @@ In mergerfs these functions are grouped into 3 categories:
|
|||
\f[B]action\f[], \f[B]create\f[], and \f[B]search\f[].
|
||||
Functions and categories can be assigned a policy which dictates how
|
||||
\f[B]mergerfs\f[] behaves.
|
||||
Any policy can be assigned to a function or category though some are not
|
||||
very practical.
|
||||
Any policy can be assigned to a function or category though some may not
|
||||
be very useful in practice.
|
||||
For instance: \f[B]rand\f[] (random) may be useful for file creation
|
||||
(create) but could lead to very odd behavior if used for \f[C]chmod\f[]
|
||||
(though only if there were more than one copy of the file).
|
||||
.PP
|
||||
Policies, when called to create, will ignore drives which are readonly
|
||||
or have less than \f[B]minfreespace\f[].
|
||||
This allows for read/write and readonly drives to be mixed together and
|
||||
keep drives which may remount as readonly on error from further
|
||||
affecting the pool.
|
||||
Policies, when called to create, will ignore drives which are readonly.
|
||||
This allows for readonly and read/write drives to be mixed together.
|
||||
Note that the drive must be explicitly mounted with the \f[B]ro\f[]
|
||||
mount option for this to work.
|
||||
.SS Function / Category classifications
|
||||
.PP
|
||||
.TS
|
||||
tab(@);
|
||||
l l.
|
||||
lw(10.7n) lw(16.5n).
|
||||
T{
|
||||
Category
|
||||
T}@T{
|
||||
|
|
@ -200,7 +202,7 @@ exists across all source mounts) \f[B]getattr\f[] will also be used.
|
|||
.PP
|
||||
.TS
|
||||
tab(@);
|
||||
l l.
|
||||
lw(14.6n) lw(13.6n).
|
||||
T{
|
||||
Policy
|
||||
T}@T{
|
||||
|
|
@ -226,99 +228,100 @@ Action category: apply to all found.
|
|||
Create category: for \f[B]mkdir\f[], \f[B]mknod\f[], and
|
||||
\f[B]symlink\f[] it will apply to all existing paths found.
|
||||
\f[B]create\f[] works like \f[B]epff\f[].
|
||||
It will exclude readonly drives and those with free space less than
|
||||
Excludes readonly drives and those with free space less than
|
||||
\f[B]minfreespace\f[].
|
||||
T}
|
||||
T{
|
||||
epff
|
||||
epff (existing path, first found)
|
||||
T}@T{
|
||||
Given the order of the drives, as defined at mount time or when
|
||||
configured via the xattr interface, act on the first one found where the
|
||||
path already exists.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[] (unless there is no
|
||||
other option).
|
||||
Given the order of the drives, as defined at mount time or configured at
|
||||
runtime, act on the first one found where the relative path already
|
||||
exists.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[] (unless there
|
||||
is no other option).
|
||||
Falls back to \f[B]ff\f[].
|
||||
T}
|
||||
T{
|
||||
eplfs (existing path, least free space)
|
||||
T}@T{
|
||||
If the path exists on multiple drives use the one with the least free
|
||||
space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[].
|
||||
Of all the drives on which the relative path exists choose the drive
|
||||
with the least free space.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[].
|
||||
Falls back to \f[B]lfs\f[].
|
||||
T}
|
||||
T{
|
||||
eplus (existing path, least used space)
|
||||
T}@T{
|
||||
If the path exists on multiple drives use the one with the least used
|
||||
space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[].
|
||||
Of all the drives on which the relative path exists choose the drive
|
||||
with the least used space.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[].
|
||||
Falls back to \f[B]lus\f[].
|
||||
T}
|
||||
T{
|
||||
epmfs (existing path, most free space)
|
||||
T}@T{
|
||||
If the path exists on multiple drives use the one with the most free
|
||||
space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[].
|
||||
Of all the drives on which the relative path exists choose the drive
|
||||
with the most free space.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[].
|
||||
Falls back to \f[B]mfs\f[].
|
||||
T}
|
||||
T{
|
||||
eprand (existing path, random)
|
||||
T}@T{
|
||||
Calls \f[B]epall\f[] and then randomizes.
|
||||
Otherwise behaves the same as \f[B]epall\f[].
|
||||
T}
|
||||
T{
|
||||
erofs
|
||||
T}@T{
|
||||
Exclusively return \f[B]\-1\f[] with \f[B]errno\f[] set to
|
||||
\f[B]EROFS\f[].
|
||||
\f[B]EROFS\f[] (Read\-only filesystem).
|
||||
By setting \f[B]create\f[] functions to this you can in effect turn the
|
||||
filesystem readonly.
|
||||
filesystem mostly readonly.
|
||||
T}
|
||||
T{
|
||||
ff (first found)
|
||||
T}@T{
|
||||
Given the order of the drives, as defined at mount time or when
|
||||
configured via xattr interface, act on the first one found.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[] (unless there is no
|
||||
other option).
|
||||
Given the order of the drives, as defined at mount time or configured at
|
||||
runtime, act on the first one found.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[] (unless there
|
||||
is no other option).
|
||||
T}
|
||||
T{
|
||||
lfs (least free space)
|
||||
T}@T{
|
||||
Pick the drive with the least available free space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[].
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[].
|
||||
Falls back to \f[B]mfs\f[].
|
||||
T}
|
||||
T{
|
||||
lus (least used space)
|
||||
T}@T{
|
||||
Pick the drive with the least used space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[].
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[].
|
||||
Falls back to \f[B]mfs\f[].
|
||||
T}
|
||||
T{
|
||||
mfs (most free space)
|
||||
T}@T{
|
||||
Pick the drive with the most available free space.
|
||||
For \f[B]create\f[] category it will exclude readonly drives.
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives.
|
||||
Falls back to \f[B]ff\f[].
|
||||
T}
|
||||
T{
|
||||
newest (newest file)
|
||||
newest
|
||||
T}@T{
|
||||
Pick the file / directory with the largest mtime.
|
||||
For \f[B]create\f[] category it will exclude readonly drives and those
|
||||
with free space less than \f[B]minfreespace\f[] (unless there is no
|
||||
other option).
|
||||
For \f[B]create\f[] category functions it will exclude readonly drives
|
||||
and those with free space less than \f[B]minfreespace\f[] (unless there
|
||||
is no other option).
|
||||
T}
|
||||
T{
|
||||
rand (random)
|
||||
|
|
@ -327,11 +330,12 @@ Calls \f[B]all\f[] and then randomizes.
|
|||
T}
|
||||
.TE
|
||||
.PP
|
||||
\f[B]epff\f[], \f[B]eplfs\f[], \f[B]eplus\f[], and \f[B]epmf\f[] are
|
||||
path preserving policies.
|
||||
\f[B]epff\f[], \f[B]eplfs\f[], \f[B]eplus\f[], \f[B]epmf\f[],
|
||||
\f[B]eprand\f[] are \f[C]path\ preserving\f[] policies.
|
||||
As the descriptions above explain they will only consider drives where
|
||||
the path being accessed exists.
|
||||
Non\-path preserving policies will clone paths as necessary.
|
||||
the relative path being accessed already exists.
|
||||
Non\-path preserving policies will result in paths being copied to
|
||||
drives as necessary.
|
||||
.SS Defaults
|
||||
.PP
|
||||
.TS
|
||||
|
|
@ -363,26 +367,24 @@ T}
|
|||
.PP
|
||||
rename (http://man7.org/linux/man-pages/man2/rename.2.html) is a tricky
|
||||
function in a merged system.
|
||||
Normally if a rename can\[aq]t be done atomically due to the source and
|
||||
Under normal situations rename only works within a single filesystem or
|
||||
device.
|
||||
If a rename can\[aq]t be done atomically due to the source and
|
||||
destination paths existing on different mount points it will return
|
||||
\f[B]\-1\f[] with \f[B]errno = EXDEV\f[].
|
||||
The atomic rename is most critical for replacing files in place
|
||||
atomically (such as securing writing to a temp file and then replacing a
|
||||
target).
|
||||
The problem is that by merging multiple paths you can have N instances
|
||||
of the source and destinations on different drives.
|
||||
This can lead to several undesirable situtations with or without errors
|
||||
and it\[aq]s not entirely obvious what to do when an error occurs.
|
||||
\f[B]\-1\f[] with \f[B]errno = EXDEV\f[] (cross device).
|
||||
.PP
|
||||
Originally mergerfs would return EXDEV whenever a rename was requested
|
||||
which was cross directory in any way.
|
||||
This made the code simple and was technically complient with POSIX
|
||||
requirements.
|
||||
However, many applications fail to handle EXDEV at all and treat it as a
|
||||
normal error or they only partially support EXDEV (don\[aq]t respond the
|
||||
same as \f[C]mv\f[] would).
|
||||
normal error or otherwise handle it poorly.
|
||||
Such apps include: gvfsd\-fuse v1.20.3 and prior, Finder / CIFS/SMB
|
||||
client in Apple OSX 10.9+, NZBGet, Samba\[aq]s recycling bin feature.
|
||||
.PP
|
||||
As a result a compromise was made in order to get most software to work
|
||||
while still obeying mergerfs\[aq] policies.
|
||||
Below is the rather complicated logic.
|
||||
.IP \[bu] 2
|
||||
If using a \f[B]create\f[] policy which tries to preserve directory
|
||||
paths (epff,eplfs,eplus,epmfs)
|
||||
|
|
@ -449,10 +451,12 @@ The the removals are subject to normal entitlement checks.
|
|||
.PP
|
||||
The above behavior will help minimize the likelihood of EXDEV being
|
||||
returned but it will still be possible.
|
||||
To remove the possibility all together mergerfs would need to perform
|
||||
the as \f[B]mv\f[] does when it receives EXDEV normally.
|
||||
.PP
|
||||
\f[B]link\f[] uses the same basic strategy.
|
||||
.PP
|
||||
If you\[aq]re receiving errors from software when files are moved /
|
||||
renamed then you should consider changing the create policy to one which
|
||||
is \f[B]not\f[] path preserving.
|
||||
.SS readdir
|
||||
.PP
|
||||
readdir (http://linux.die.net/man/3/readdir) is different from all other
|
||||
|
|
@ -691,12 +695,20 @@ ability to fix them
|
|||
.IP \[bu] 2
|
||||
mergerfs.dedup: Will help identify and optionally remove duplicate files
|
||||
.IP \[bu] 2
|
||||
mergerfs.balance: Rebalance files across drives by moving them from the
|
||||
most filled to the least filled
|
||||
.IP \[bu] 2
|
||||
mergerfs.mktrash: Creates FreeDesktop.org Trash specification compatible
|
||||
directories on a mergerfs mount
|
||||
.IP \[bu] 2
|
||||
https://github.com/trapexit/scorch
|
||||
.IP \[bu] 2
|
||||
scorch: A tool to help discover silent corruption of files
|
||||
.IP \[bu] 2
|
||||
https://github.com/trapexit/bbf
|
||||
.IP \[bu] 2
|
||||
bbf (bad block finder): a tool to scan for and \[aq]fix\[aq] hard drive
|
||||
bad blocks and find the files using those blocks
|
||||
.SH TIPS / NOTES
|
||||
.IP \[bu] 2
|
||||
The recommended options are
|
||||
|
|
@ -709,8 +721,9 @@ https://github.com/trapexit/backup\-and\-recovery\-howtos : A set of
|
|||
guides / howtos on creating a data storage system, backing it up,
|
||||
maintaining it, and recovering from failure.
|
||||
.IP \[bu] 2
|
||||
If you don\[aq]t see some directories / files you expect in a merged
|
||||
point be sure the user has permission to all the underlying directories.
|
||||
If you don\[aq]t see some directories and files you expect in a merged
|
||||
point or policies seem to skip drives be sure the user has permission to
|
||||
all the underlying directories.
|
||||
Use \f[C]mergerfs.fsck\f[] to audit the drive for out of sync
|
||||
permissions.
|
||||
.IP \[bu] 2
|
||||
|
|
@ -976,7 +989,7 @@ MergerFS provides a superset of mhddfs\[aq] features and should offer
|
|||
the same or maybe better performance.
|
||||
.SS Why use mergerfs over aufs?
|
||||
.PP
|
||||
While aufs can offer better peak performance mergerfs offers more
|
||||
While aufs can offer better peak performance mergerfs provides more
|
||||
configurability and is generally easier to use.
|
||||
mergerfs however does not offer the overlay / copy\-on\-write (COW)
|
||||
features which aufs and overlayfs have.
|
||||
|
|
@ -984,45 +997,48 @@ features which aufs and overlayfs have.
|
|||
striping?
|
||||
.PP
|
||||
With simple JBOD / drive concatenation / stripping / RAID0 a single
|
||||
drive failure will lead to full pool failure.
|
||||
mergerfs performs a similar behavior without the catastrophic failure
|
||||
and general lack of recovery.
|
||||
Drives can fail and all other data will continue to be accessable.
|
||||
drive failure will result in full pool failure.
|
||||
mergerfs performs a similar behavior without the possibility of
|
||||
catastrophic failure and difficulties in recovery.
|
||||
Drives may fail however all other data will continue to be accessable.
|
||||
.PP
|
||||
When combined with something like SnapRaid (http://www.snapraid.it)
|
||||
and/or an offsite full backup solution you can have the flexibilty of
|
||||
JBOD without the single point of failure.
|
||||
and/or an offsite backup solution you can have the flexibilty of JBOD
|
||||
without the single point of failure.
|
||||
.SS Why use mergerfs over ZFS?
|
||||
.PP
|
||||
MergerFS is not intended to be a replacement for ZFS.
|
||||
MergerFS is intended to provide flexible pooling of arbitrary drives
|
||||
(local or remote), of arbitrary sizes, and arbitrary filesystems.
|
||||
For \f[C]write\ once,\ read\ many\f[] usecases such as media storage.
|
||||
And where data integrity and backup can be managed in other ways.
|
||||
For \f[C]write\ once,\ read\ many\f[] usecases such as bulk media
|
||||
storage.
|
||||
Where data integrity and backup is managed in other ways.
|
||||
In that situation ZFS can introduce major maintance and cost burdens as
|
||||
described
|
||||
here (http://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html).
|
||||
.SS Can drives be written to directly? Outside of mergerfs while pooled?
|
||||
.PP
|
||||
Yes.
|
||||
It will be represented immediately in the pool as the policies would
|
||||
describe.
|
||||
It will be represented immediately in the pool as the policies
|
||||
perscribe.
|
||||
.SS Why do I get an "out of space" error even though the system says
|
||||
there\[aq]s lots of space left?
|
||||
.PP
|
||||
Please reread the sections above about policies, path preserving, and
|
||||
the \f[B]moveonenospc\f[] option.
|
||||
If the policy is path preserving and a drive is almost full and the
|
||||
drive the policy would pick then the writing of the file may fill the
|
||||
drive and receive ENOSPC errors.
|
||||
That is expected with those settings.
|
||||
If you don\[aq]t want that: enable \f[B]moveonenospc\f[] and don\[aq]t
|
||||
use a path preserving policy.
|
||||
.PP
|
||||
Remember that mergerfs is simply presenting a logical merging of the
|
||||
contents of the pooled drives.
|
||||
The reported free space is the aggregate space available \f[I]not\f[]
|
||||
the contiguous space available.
|
||||
If the writing of a file fills a drive and \f[B]moveonenospc\f[] is
|
||||
disabled it will return an ENOSPC error.
|
||||
.SS Can mergerfs mounts be exported over NFS?
|
||||
.PP
|
||||
Yes.
|
||||
Some clients (Kodi) have issues but users have found that enabling the
|
||||
\f[C]use_ino\f[] option often address the problem.
|
||||
Some clients (Kodi) have issues in which the contents of the NFS mount
|
||||
will not be presented but users have found that enabling the
|
||||
\f[C]use_ino\f[] option often fixes that problem.
|
||||
.SS Can mergerfs mounts be exported over Samba / SMB?
|
||||
.PP
|
||||
Yes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue