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.

1976 lines
75 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
8 years ago
9 years ago
7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
  1. .\"t
  2. .\" Automatically generated by Pandoc 1.19.2.4
  3. .\"
  4. .TH "mergerfs" "1" "2019\-01\-15" "mergerfs user manual" ""
  5. .hy
  6. .SH NAME
  7. .PP
  8. mergerfs \- a featureful union filesystem
  9. .SH SYNOPSIS
  10. .PP
  11. mergerfs \-o<options> <branches> <mountpoint>
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]mergerfs\f[] is a union filesystem geared towards simplifying
  15. storage and management of files across numerous commodity storage
  16. devices.
  17. It is similar to \f[B]mhddfs\f[], \f[B]unionfs\f[], and \f[B]aufs\f[].
  18. .SH FEATURES
  19. .IP \[bu] 2
  20. Runs in userspace (FUSE)
  21. .IP \[bu] 2
  22. Configurable behaviors
  23. .IP \[bu] 2
  24. Support for extended attributes (xattrs)
  25. .IP \[bu] 2
  26. Support for file attributes (chattr)
  27. .IP \[bu] 2
  28. Runtime configurable (via xattrs)
  29. .IP \[bu] 2
  30. Safe to run as root
  31. .IP \[bu] 2
  32. Opportunistic credential caching
  33. .IP \[bu] 2
  34. Works with heterogeneous filesystem types
  35. .IP \[bu] 2
  36. Handling of writes to full drives (transparently move file to drive with
  37. capacity)
  38. .IP \[bu] 2
  39. Handles pool of read\-only and read/write drives
  40. .IP \[bu] 2
  41. Turn read\-only files into symlinks to increase read performance
  42. .SH How it works
  43. .PP
  44. mergerfs logically merges multiple paths together.
  45. Think a union of sets.
  46. The file/s or directory/s acted on or presented through mergerfs are
  47. based on the policy chosen for that particular action.
  48. Read more about policies below.
  49. .IP
  50. .nf
  51. \f[C]
  52. A\ \ \ \ \ \ \ \ \ +\ \ \ \ \ \ B\ \ \ \ \ \ \ \ =\ \ \ \ \ \ \ C
  53. /disk1\ \ \ \ \ \ \ \ \ \ \ /disk2\ \ \ \ \ \ \ \ \ \ \ /merged
  54. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  55. +\-\-\ /dir1\ \ \ \ \ \ \ \ +\-\-\ /dir1\ \ \ \ \ \ \ \ +\-\-\ /dir1
  56. |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |
  57. |\ \ \ +\-\-\ file1\ \ \ \ |\ \ \ +\-\-\ file2\ \ \ \ |\ \ \ +\-\-\ file1
  58. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file3\ \ \ \ |\ \ \ +\-\-\ file2
  59. +\-\-\ /dir2\ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file3
  60. |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir3\ \ \ \ \ \ \ \ |
  61. |\ \ \ +\-\-\ file4\ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir2
  62. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ file5\ \ \ |\ \ \ |
  63. +\-\-\ file6\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file4
  64. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  65. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir3
  66. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |
  67. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file5
  68. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  69. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ file6
  70. \f[]
  71. .fi
  72. .PP
  73. mergerfs does \f[B]not\f[] support the copy\-on\-write (CoW) behavior
  74. found in \f[B]aufs\f[] and \f[B]overlayfs\f[].
  75. You can \f[B]not\f[] mount a read\-only filesystem and write to it.
  76. However, mergerfs will ignore read\-only drives when creating new files
  77. so you can mix rw and ro drives.
  78. .SH OPTIONS
  79. .SS mount options
  80. .IP \[bu] 2
  81. \f[B]defaults\f[]: a shortcut for FUSE\[aq]s \f[B]atomic_o_trunc\f[],
  82. \f[B]auto_cache\f[], \f[B]big_writes\f[], \f[B]default_permissions\f[],
  83. \f[B]splice_move\f[], \f[B]splice_read\f[], and \f[B]splice_write\f[].
  84. These options seem to provide the best performance.
  85. .IP \[bu] 2
  86. \f[B]allow_other\f[]: a libfuse option which allows users besides the
  87. one which ran mergerfs to see the filesystem.
  88. This is required for most use\-cases.
  89. .IP \[bu] 2
  90. \f[B]direct_io\f[]: causes FUSE to bypass caching which can increase
  91. write speeds at the detriment of reads.
  92. Note that not enabling \f[C]direct_io\f[] will cause double caching of
  93. files and therefore less memory for caching generally (enable
  94. \f[B]dropcacheonclose\f[] to help with this problem).
  95. However, \f[C]mmap\f[] does not work when \f[C]direct_io\f[] is enabled.
  96. .IP \[bu] 2
  97. \f[B]minfreespace=value\f[]: the minimum space value used for creation
  98. policies.
  99. Understands \[aq]K\[aq], \[aq]M\[aq], and \[aq]G\[aq] to represent
  100. kilobyte, megabyte, and gigabyte respectively.
  101. (default: 4G)
  102. .IP \[bu] 2
  103. \f[B]moveonenospc=true|false\f[]: when enabled (set to \f[B]true\f[]) if
  104. a \f[B]write\f[] fails with \f[B]ENOSPC\f[] or \f[B]EDQUOT\f[] a scan of
  105. all drives will be done looking for the drive with the most free space
  106. which is at least the size of the file plus the amount which failed to
  107. write.
  108. An attempt to move the file to that drive will occur (keeping all
  109. metadata possible) and if successful the original is unlinked and the
  110. write retried.
  111. (default: false)
  112. .IP \[bu] 2
  113. \f[B]use_ino\f[]: causes mergerfs to supply file/directory inodes rather
  114. than libfuse.
  115. While not a default it is generally recommended it be enabled so that
  116. hard linked files share the same inode value.
  117. .IP \[bu] 2
  118. \f[B]hard_remove\f[]: force libfuse to immedately remove files when
  119. unlinked.
  120. This will keep the \f[C]\&.fuse_hidden\f[] files from showing up but if
  121. software uses an opened but unlinked file in certain ways it could
  122. result in errors.
  123. .IP \[bu] 2
  124. \f[B]dropcacheonclose=true|false\f[]: when a file is requested to be
  125. closed call \f[C]posix_fadvise\f[] on it first to instruct the kernel
  126. that we no longer need the data and it can drop its cache.
  127. Recommended when \f[B]direct_io\f[] is not enabled to limit double
  128. caching.
  129. (default: false)
  130. .IP \[bu] 2
  131. \f[B]symlinkify=true|false\f[]: when enabled (set to \f[B]true\f[]) and
  132. a file is not writable and its mtime or ctime is older than
  133. \f[B]symlinkify_timeout\f[] files will be reported as symlinks to the
  134. original files.
  135. Please read more below before using.
  136. (default: false)
  137. .IP \[bu] 2
  138. \f[B]symlinkify_timeout=value\f[]: time to wait, in seconds, to activate
  139. the \f[B]symlinkify\f[] behavior.
  140. (default: 3600)
  141. .IP \[bu] 2
  142. \f[B]nullrw=true|false\f[]: turns reads and writes into no\-ops.
  143. The request will succeed but do nothing.
  144. Useful for benchmarking mergerfs.
  145. (default: false)
  146. .IP \[bu] 2
  147. \f[B]ignorepponrename=true|false\f[]: ignore path preserving on rename.
  148. Typically rename and link act differently depending on the policy of
  149. \f[C]create\f[] (read below).
  150. Enabling this will cause rename and link to always use the non\-path
  151. preserving behavior.
  152. This means files, when renamed or linked, will stay on the same drive.
  153. (default: false)
  154. .IP \[bu] 2
  155. \f[B]security_capability=true|false\f[]: If false return ENOATTR when
  156. xattr security.capability is queried.
  157. (default: true)
  158. .IP \[bu] 2
  159. \f[B]xattr=passthrough|noattr|nosys\f[]: Runtime control of xattrs.
  160. Default is to passthrough xattr requests.
  161. \[aq]noattr\[aq] will short circuit as if nothing exists.
  162. \[aq]nosys\[aq] will respond with ENOSYS as if xattrs are not supported
  163. or disabled.
  164. (default: passthrough)
  165. .IP \[bu] 2
  166. \f[B]link_cow=true|false\f[]: When enabled if a regular file is opened
  167. which has a link count > 1 it will copy the file to a temporary file and
  168. rename over the original.
  169. Breaking the link and providing a basic copy\-on\-write function similar
  170. to cow\-shell.
  171. (default: false)
  172. .IP \[bu] 2
  173. \f[B]statfs=base|full\f[]: Controls how statfs works.
  174. \[aq]base\[aq] means it will always use all branches in statfs
  175. calculations.
  176. \[aq]full\[aq] is in effect path preserving and only includes drives
  177. where the path exists.
  178. (default: base)
  179. .IP \[bu] 2
  180. \f[B]statfs_ignore=none|ro|nc\f[]: \[aq]ro\[aq] will cause statfs
  181. calculations to ignore available space for branches mounted or tagged as
  182. \[aq]read\-only\[aq] or \[aq]no create\[aq].
  183. \[aq]nc\[aq] will ignore available space for branches tagged as \[aq]no
  184. create\[aq].
  185. (default: none)
  186. .IP \[bu] 2
  187. \f[B]threads=num\f[]: number of threads to use in multithreaded mode.
  188. When set to zero (the default) it will attempt to discover and use the
  189. number of logical cores.
  190. If the lookup fails it will fall back to using 4.
  191. If the thread count is set negative it will look up the number of cores
  192. then divide by the absolute value.
  193. ie.
  194. threads=\-2 on an 8 core machine will result in 8 / 2 = 4 threads.
  195. There will always be at least 1 thread.
  196. NOTE: higher number of threads increases parallelism but usually
  197. decreases throughput.
  198. (default: number of cores) \f[I]NOTE2:\f[] the option is unavailable
  199. when built with system libfuse.
  200. .IP \[bu] 2
  201. \f[B]fsname=name\f[]: sets the name of the filesystem as seen in
  202. \f[B]mount\f[], \f[B]df\f[], etc.
  203. Defaults to a list of the source paths concatenated together with the
  204. longest common prefix removed.
  205. .IP \[bu] 2
  206. \f[B]func.<func>=<policy>\f[]: sets the specific FUSE function\[aq]s
  207. policy.
  208. See below for the list of value types.
  209. Example: \f[B]func.getattr=newest\f[]
  210. .IP \[bu] 2
  211. \f[B]category.<category>=<policy>\f[]: Sets policy of all FUSE functions
  212. in the provided category.
  213. Example: \f[B]category.create=mfs\f[]
  214. .IP \[bu] 2
  215. \f[B]cache.open=\f[]: \[aq]open\[aq] policy cache timeout in seconds.
  216. (default: 0)
  217. .IP \[bu] 2
  218. \f[B]cache.statfs=\f[]: \[aq]statfs\[aq] cache timeout in seconds.
  219. (default: 0)
  220. .PP
  221. \f[B]NOTE:\f[] Options are evaluated in the order listed so if the
  222. options are \f[B]func.rmdir=rand,category.action=ff\f[] the
  223. \f[B]action\f[] category setting will override the \f[B]rmdir\f[]
  224. setting.
  225. .SS branches
  226. .PP
  227. The \[aq]branches\[aq] (formerly \[aq]srcmounts\[aq]) argument is a
  228. colon (\[aq]:\[aq]) delimited list of paths to be pooled together.
  229. It does not matter if the paths are on the same or different drives nor
  230. does it matter the filesystem.
  231. Used and available space will not be duplicated for paths on the same
  232. device and any features which aren\[aq]t supported by the underlying
  233. filesystem (such as file attributes or extended attributes) will return
  234. the appropriate errors.
  235. .PP
  236. To make it easier to include multiple branches mergerfs supports
  237. globbing (http://linux.die.net/man/7/glob).
  238. \f[B]The globbing tokens MUST be escaped when using via the shell else
  239. the shell itself will apply the glob itself.\f[]
  240. .PP
  241. Each branch can have a suffix of \f[C]=RW\f[] (read / write),
  242. \f[C]=RO\f[] (read\-only), or \f[C]=NC\f[] (no create).
  243. These suffixes work with globs as well and will apply to each path
  244. found.
  245. \f[C]RW\f[] is the default behavior and those paths will be eligible for
  246. all policy categories.
  247. \f[C]RO\f[] will exclude those paths from \f[C]create\f[] and
  248. \f[C]action\f[] policies (just as a filesystem being mounted \f[C]ro\f[]
  249. would).
  250. \f[C]NC\f[] will exclude those paths from \f[C]create\f[] policies (you
  251. can\[aq]t create but you can change / delete).
  252. .IP
  253. .nf
  254. \f[C]
  255. $\ mergerfs\ \-o\ defaults,allow_other,use_ino\ /mnt/disk\\*:/mnt/cdrom\ /media/drives
  256. \f[]
  257. .fi
  258. .PP
  259. The above line will use all mount points in /mnt prefixed with
  260. \f[B]disk\f[] and the \f[B]cdrom\f[].
  261. .PP
  262. To have the pool mounted at boot or otherwise accessable from related
  263. tools use \f[B]/etc/fstab\f[].
  264. .IP
  265. .nf
  266. \f[C]
  267. #\ <file\ system>\ \ \ \ \ \ \ \ <mount\ point>\ \ <type>\ \ \ \ \ \ \ \ \ <options>\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <dump>\ \ <pass>
  268. /mnt/disk*:/mnt/cdrom\ \ /media/drives\ \ fuse.mergerfs\ \ defaults,allow_other,use_ino\ \ \ 0\ \ \ \ \ \ \ 0
  269. \f[]
  270. .fi
  271. .PP
  272. \f[B]NOTE:\f[] the globbing is done at mount or xattr update time (see
  273. below).
  274. If a new directory is added matching the glob after the fact it will not
  275. be automatically included.
  276. .PP
  277. \f[B]NOTE:\f[] for mounting via \f[B]fstab\f[] to work you must have
  278. \f[B]mount.fuse\f[] installed.
  279. For Ubuntu/Debian it is included in the \f[B]fuse\f[] package.
  280. .SS symlinkify
  281. .PP
  282. Due to the levels of indirection introduced by mergerfs and the
  283. underlying technology FUSE there can be varying levels of performance
  284. degredation.
  285. This feature will turn non\-directories which are not writable into
  286. symlinks to the original file found by the \f[C]readlink\f[] policy
  287. after the mtime and ctime are older than the timeout.
  288. .PP
  289. \f[B]WARNING:\f[] The current implementation has a known issue in which
  290. if the file is open and being used when the file is converted to a
  291. symlink then the application which has that file open will receive an
  292. error when using it.
  293. This is unlikely to occur in practice but is something to keep in mind.
  294. .PP
  295. \f[B]WARNING:\f[] Some backup solutions, such as CrashPlan, do not
  296. backup the target of a symlink.
  297. If using this feature it will be necessary to point any backup software
  298. to the original drives or configure the software to follow symlinks if
  299. such an option is available.
  300. Alternatively create two mounts.
  301. One for backup and one for general consumption.
  302. .SS nullrw
  303. .PP
  304. Due to how FUSE works there is an overhead to all requests made to a
  305. FUSE filesystem.
  306. Meaning that even a simple passthrough will have some slowdown.
  307. However, generally the overhead is minimal in comparison to the cost of
  308. the underlying I/O.
  309. By disabling the underlying I/O we can test the theoretical performance
  310. boundries.
  311. .PP
  312. By enabling \f[C]nullrw\f[] mergerfs will work as it always does
  313. \f[B]except\f[] that all reads and writes will be no\-ops.
  314. A write will succeed (the size of the write will be returned as if it
  315. were successful) but mergerfs does nothing with the data it was given.
  316. Similarly a read will return the size requested but won\[aq]t touch the
  317. buffer.
  318. .PP
  319. Example:
  320. .IP
  321. .nf
  322. \f[C]
  323. $\ dd\ if=/dev/zero\ of=/path/to/mergerfs/mount/benchmark\ ibs=1M\ obs=512\ count=1024\ conv=fdatasync
  324. 1024+0\ records\ in
  325. 2097152+0\ records\ out
  326. 1073741824\ bytes\ (1.1\ GB,\ 1.0\ GiB)\ copied,\ 15.4067\ s,\ 69.7\ MB/s
  327. $\ dd\ if=/dev/zero\ of=/path/to/mergerfs/mount/benchmark\ ibs=1M\ obs=1M\ count=1024\ conv=fdatasync
  328. 1024+0\ records\ in
  329. 1024+0\ records\ out
  330. 1073741824\ bytes\ (1.1\ GB,\ 1.0\ GiB)\ copied,\ 0.219585\ s,\ 4.9\ GB/s
  331. $\ dd\ if=/path/to/mergerfs/mount/benchmark\ of=/dev/null\ bs=512\ count=102400\ conv=fdatasync
  332. 102400+0\ records\ in
  333. 102400+0\ records\ out
  334. 52428800\ bytes\ (52\ MB,\ 50\ MiB)\ copied,\ 0.757991\ s,\ 69.2\ MB/s
  335. $\ dd\ if=/path/to/mergerfs/mount/benchmark\ of=/dev/null\ bs=1M\ count=1024\ conv=fdatasync
  336. 1024+0\ records\ in
  337. 1024+0\ records\ out
  338. 1073741824\ bytes\ (1.1\ GB,\ 1.0\ GiB)\ copied,\ 0.18405\ s,\ 5.8\ GB/s
  339. \f[]
  340. .fi
  341. .PP
  342. It\[aq]s important to test with different \f[C]obs\f[] (output block
  343. size) values since the relative overhead is greater with smaller values.
  344. As you can see above the size of a read or write can massively impact
  345. theoretical performance.
  346. If an application performs much worse through mergerfs it could very
  347. well be that it doesn\[aq]t optimally size its read and write requests.
  348. In such cases contact the mergerfs author so it can be investigated.
  349. .SS xattr
  350. .PP
  351. Runtime extended attribute support can be managed via the \f[C]xattr\f[]
  352. option.
  353. By default it will passthrough any xattr calls.
  354. Given xattr support is rarely used and can have significant performance
  355. implications mergerfs allows it to be disabled at runtime.
  356. .PP
  357. \f[C]noattr\f[] will cause mergerfs to short circuit all xattr calls and
  358. return ENOATTR where appropriate.
  359. mergerfs still gets all the requests but they will not be forwarded on
  360. to the underlying filesystems.
  361. The runtime control will still function in this mode.
  362. .PP
  363. \f[C]nosys\f[] will cause mergerfs to return ENOSYS for any xattr call.
  364. The difference with \f[C]noattr\f[] is that the kernel will cache this
  365. fact and itself short circuit future calls.
  366. This will be more efficient than \f[C]noattr\f[] but will cause
  367. mergerfs\[aq] runtime control via the hidden file to stop working.
  368. .SH FUNCTIONS / POLICIES / CATEGORIES
  369. .PP
  370. The POSIX filesystem API is made up of a number of functions.
  371. \f[B]creat\f[], \f[B]stat\f[], \f[B]chown\f[], etc.
  372. In mergerfs most of the core functions are grouped into 3 categories:
  373. \f[B]action\f[], \f[B]create\f[], and \f[B]search\f[].
  374. These functions and categories can be assigned a policy which dictates
  375. what file or directory is chosen when performing that behavior.
  376. Any policy can be assigned to a function or category though some may not
  377. be very useful in practice.
  378. For instance: \f[B]rand\f[] (random) may be useful for file creation
  379. (create) but could lead to very odd behavior if used for \f[C]chmod\f[]
  380. if there were more than one copy of the file.
  381. .PP
  382. Some functions, listed in the category \f[C]N/A\f[] below, can not be
  383. assigned the normal policies.
  384. All functions which work on file handles use the handle which was
  385. acquired by \f[C]open\f[] or \f[C]create\f[].
  386. \f[C]readdir\f[] has no real need for a policy given the purpose is
  387. merely to return a list of entries in a directory.
  388. \f[C]statfs\f[]\[aq]s behavior can be modified via other options.
  389. .PP
  390. When using policies which are based on a branch\[aq]s available space
  391. the base path provided is used.
  392. Not the full path to the file in question.
  393. Meaning that sub mounts won\[aq]t be considered in the space
  394. calculations.
  395. The reason is that it doesn\[aq]t really work for non\-path preserving
  396. policies and can lead to non\-obvious behaviors.
  397. .SS Function / Category classifications
  398. .PP
  399. .TS
  400. tab(@);
  401. lw(7.9n) lw(62.1n).
  402. T{
  403. Category
  404. T}@T{
  405. FUSE Functions
  406. T}
  407. _
  408. T{
  409. action
  410. T}@T{
  411. chmod, chown, link, removexattr, rename, rmdir, setxattr, truncate,
  412. unlink, utimens
  413. T}
  414. T{
  415. create
  416. T}@T{
  417. create, mkdir, mknod, symlink
  418. T}
  419. T{
  420. search
  421. T}@T{
  422. access, getattr, getxattr, ioctl, listxattr, open, readlink
  423. T}
  424. T{
  425. N/A
  426. T}@T{
  427. fallocate, fgetattr, fsync, ftruncate, ioctl, read, readdir, release,
  428. statfs, write
  429. T}
  430. .TE
  431. .PP
  432. In cases where something may be searched (to confirm a directory exists
  433. across all source mounts) \f[B]getattr\f[] will be used.
  434. .SS Path Preservation
  435. .PP
  436. Policies, as described below, are of two basic types.
  437. \f[C]path\ preserving\f[] and \f[C]non\-path\ preserving\f[].
  438. .PP
  439. All policies which start with \f[C]ep\f[] (\f[B]epff\f[],
  440. \f[B]eplfs\f[], \f[B]eplus\f[], \f[B]epmfs\f[], \f[B]eprand\f[]) are
  441. \f[C]path\ preserving\f[].
  442. \f[C]ep\f[] stands for \f[C]existing\ path\f[].
  443. .PP
  444. A path preserving policy will only consider drives where the relative
  445. path being accessed already exists.
  446. .PP
  447. When using non\-path preserving policies paths will be cloned to target
  448. drives as necessary.
  449. .SS Filters
  450. .PP
  451. Policies basically search branches and create a list of files / paths
  452. for functions to work on.
  453. The policy is responsible for filtering and sorting.
  454. The policy type defines the sorting but filtering is mostly uniform as
  455. described below.
  456. .IP \[bu] 2
  457. No \f[B]search\f[] policies filter.
  458. .IP \[bu] 2
  459. All \f[B]action\f[] policies will filter out branches which are mounted
  460. \f[B]read\-only\f[] or tagged as \f[B]RO (read\-only)\f[].
  461. .IP \[bu] 2
  462. All \f[B]create\f[] policies will filter out branches which are mounted
  463. \f[B]read\-only\f[], tagged \f[B]RO (read\-only)\f[] or \f[B]NC (no
  464. create)\f[], or has available space less than \f[C]minfreespace\f[].
  465. .PP
  466. If all branches are filtered an error will be returned.
  467. Typically \f[B]EROFS\f[] or \f[B]ENOSPC\f[] depending on the reasons.
  468. .SS Policy descriptions
  469. .PP
  470. .TS
  471. tab(@);
  472. lw(16.6n) lw(53.4n).
  473. T{
  474. Policy
  475. T}@T{
  476. Description
  477. T}
  478. _
  479. T{
  480. all
  481. T}@T{
  482. Search category: same as \f[B]epall\f[].
  483. Action category: same as \f[B]epall\f[].
  484. Create category: for \f[B]mkdir\f[], \f[B]mknod\f[], and
  485. \f[B]symlink\f[] it will apply to all branches.
  486. \f[B]create\f[] works like \f[B]ff\f[].
  487. T}
  488. T{
  489. epall (existing path, all)
  490. T}@T{
  491. Search category: same as \f[B]epff\f[] (but more expensive because it
  492. doesn\[aq]t stop after finding a valid branch).
  493. Action category: apply to all found.
  494. Create category: for \f[B]mkdir\f[], \f[B]mknod\f[], and
  495. \f[B]symlink\f[] it will apply to all found.
  496. \f[B]create\f[] works like \f[B]epff\f[] (but more expensive because it
  497. doesn\[aq]t stop after finding a valid branch).
  498. T}
  499. T{
  500. epff (existing path, first found)
  501. T}@T{
  502. Given the order of the branches, as defined at mount time or configured
  503. at runtime, act on the first one found where the relative path exists.
  504. T}
  505. T{
  506. eplfs (existing path, least free space)
  507. T}@T{
  508. Of all the branches on which the relative path exists choose the drive
  509. with the least free space.
  510. T}
  511. T{
  512. eplus (existing path, least used space)
  513. T}@T{
  514. Of all the branches on which the relative path exists choose the drive
  515. with the least used space.
  516. T}
  517. T{
  518. epmfs (existing path, most free space)
  519. T}@T{
  520. Of all the branches on which the relative path exists choose the drive
  521. with the most free space.
  522. T}
  523. T{
  524. eprand (existing path, random)
  525. T}@T{
  526. Calls \f[B]epall\f[] and then randomizes.
  527. T}
  528. T{
  529. erofs
  530. T}@T{
  531. Exclusively return \f[B]\-1\f[] with \f[B]errno\f[] set to
  532. \f[B]EROFS\f[] (read\-only filesystem).
  533. T}
  534. T{
  535. ff (first found)
  536. T}@T{
  537. Search category: same as \f[B]epff\f[].
  538. Action category: same as \f[B]epff\f[].
  539. Create category: Given the order of the drives, as defined at mount time
  540. or configured at runtime, act on the first one found.
  541. T}
  542. T{
  543. lfs (least free space)
  544. T}@T{
  545. Search category: same as \f[B]eplfs\f[].
  546. Action category: same as \f[B]eplfs\f[].
  547. Create category: Pick the drive with the least available free space.
  548. T}
  549. T{
  550. lus (least used space)
  551. T}@T{
  552. Search category: same as \f[B]eplus\f[].
  553. Action category: same as \f[B]eplus\f[].
  554. Create category: Pick the drive with the least used space.
  555. T}
  556. T{
  557. mfs (most free space)
  558. T}@T{
  559. Search category: same as \f[B]epmfs\f[].
  560. Action category: same as \f[B]epmfs\f[].
  561. Create category: Pick the drive with the most available free space.
  562. T}
  563. T{
  564. newest
  565. T}@T{
  566. Pick the file / directory with the largest mtime.
  567. T}
  568. T{
  569. rand (random)
  570. T}@T{
  571. Calls \f[B]all\f[] and then randomizes.
  572. T}
  573. .TE
  574. .SS Defaults
  575. .PP
  576. .TS
  577. tab(@);
  578. l l.
  579. T{
  580. Category
  581. T}@T{
  582. Policy
  583. T}
  584. _
  585. T{
  586. action
  587. T}@T{
  588. epall
  589. T}
  590. T{
  591. create
  592. T}@T{
  593. epmfs
  594. T}
  595. T{
  596. search
  597. T}@T{
  598. ff
  599. T}
  600. .TE
  601. .SS rename & link
  602. .PP
  603. \f[B]NOTE:\f[] If you\[aq]re receiving errors from software when files
  604. are moved / renamed / linked then you should consider changing the
  605. create policy to one which is \f[B]not\f[] path preserving, enabling
  606. \f[C]ignorepponrename\f[], or contacting the author of the offending
  607. software and requesting that \f[C]EXDEV\f[] be properly handled.
  608. .PP
  609. \f[C]rename\f[] and \f[C]link\f[] are tricky functions in a union
  610. filesystem.
  611. \f[C]rename\f[] only works within a single filesystem or device.
  612. If a rename can\[aq]t be done atomically due to the source and
  613. destination paths existing on different mount points it will return
  614. \f[B]\-1\f[] with \f[B]errno = EXDEV\f[] (cross device).
  615. So if a \f[C]rename\f[]\[aq]s source and target are on different drives
  616. within the pool it creates an issue.
  617. .PP
  618. Originally mergerfs would return EXDEV whenever a rename was requested
  619. which was cross directory in any way.
  620. This made the code simple and was technically complient with POSIX
  621. requirements.
  622. However, many applications fail to handle EXDEV at all and treat it as a
  623. normal error or otherwise handle it poorly.
  624. Such apps include: gvfsd\-fuse v1.20.3 and prior, Finder / CIFS/SMB
  625. client in Apple OSX 10.9+, NZBGet, Samba\[aq]s recycling bin feature.
  626. .PP
  627. As a result a compromise was made in order to get most software to work
  628. while still obeying mergerfs\[aq] policies.
  629. Below is the basic logic.
  630. .IP \[bu] 2
  631. If using a \f[B]create\f[] policy which tries to preserve directory
  632. paths (epff,eplfs,eplus,epmfs)
  633. .IP \[bu] 2
  634. Using the \f[B]rename\f[] policy get the list of files to rename
  635. .IP \[bu] 2
  636. For each file attempt rename:
  637. .RS 2
  638. .IP \[bu] 2
  639. If failure with ENOENT run \f[B]create\f[] policy
  640. .IP \[bu] 2
  641. If create policy returns the same drive as currently evaluating then
  642. clone the path
  643. .IP \[bu] 2
  644. Re\-attempt rename
  645. .RE
  646. .IP \[bu] 2
  647. If \f[B]any\f[] of the renames succeed the higher level rename is
  648. considered a success
  649. .IP \[bu] 2
  650. If \f[B]no\f[] renames succeed the first error encountered will be
  651. returned
  652. .IP \[bu] 2
  653. On success:
  654. .RS 2
  655. .IP \[bu] 2
  656. Remove the target from all drives with no source file
  657. .IP \[bu] 2
  658. Remove the source from all drives which failed to rename
  659. .RE
  660. .IP \[bu] 2
  661. If using a \f[B]create\f[] policy which does \f[B]not\f[] try to
  662. preserve directory paths
  663. .IP \[bu] 2
  664. Using the \f[B]rename\f[] policy get the list of files to rename
  665. .IP \[bu] 2
  666. Using the \f[B]getattr\f[] policy get the target path
  667. .IP \[bu] 2
  668. For each file attempt rename:
  669. .RS 2
  670. .IP \[bu] 2
  671. If the source drive != target drive:
  672. .IP \[bu] 2
  673. Clone target path from target drive to source drive
  674. .IP \[bu] 2
  675. Rename
  676. .RE
  677. .IP \[bu] 2
  678. If \f[B]any\f[] of the renames succeed the higher level rename is
  679. considered a success
  680. .IP \[bu] 2
  681. If \f[B]no\f[] renames succeed the first error encountered will be
  682. returned
  683. .IP \[bu] 2
  684. On success:
  685. .RS 2
  686. .IP \[bu] 2
  687. Remove the target from all drives with no source file
  688. .IP \[bu] 2
  689. Remove the source from all drives which failed to rename
  690. .RE
  691. .PP
  692. The the removals are subject to normal entitlement checks.
  693. .PP
  694. The above behavior will help minimize the likelihood of EXDEV being
  695. returned but it will still be possible.
  696. .PP
  697. \f[B]link\f[] uses the same strategy but without the removals.
  698. .SS readdir
  699. .PP
  700. readdir (http://linux.die.net/man/3/readdir) is different from all other
  701. filesystem functions.
  702. While it could have it\[aq]s own set of policies to tweak its behavior
  703. at this time it provides a simple union of files and directories found.
  704. Remember that any action or information queried about these files and
  705. directories come from the respective function.
  706. For instance: an \f[B]ls\f[] is a \f[B]readdir\f[] and for each
  707. file/directory returned \f[B]getattr\f[] is called.
  708. Meaning the policy of \f[B]getattr\f[] is responsible for choosing the
  709. file/directory which is the source of the metadata you see in an
  710. \f[B]ls\f[].
  711. .SS statfs / statvfs
  712. .PP
  713. statvfs (http://linux.die.net/man/2/statvfs) normalizes the source
  714. drives based on the fragment size and sums the number of adjusted blocks
  715. and inodes.
  716. This means you will see the combined space of all sources.
  717. Total, used, and free.
  718. The sources however are dedupped based on the drive so multiple sources
  719. on the same drive will not result in double counting it\[aq]s space.
  720. Filesystems mounted further down the tree of the branch will not be
  721. included when checking the mount\[aq]s stats.
  722. .PP
  723. The options \f[C]statfs\f[] and \f[C]statfs_ignore\f[] can be used to
  724. modify \f[C]statfs\f[] behavior.
  725. .SH BUILDING
  726. .PP
  727. \f[B]NOTE:\f[] Prebuilt packages can be found at:
  728. https://github.com/trapexit/mergerfs/releases
  729. .PP
  730. First get the code from github (https://github.com/trapexit/mergerfs).
  731. .IP
  732. .nf
  733. \f[C]
  734. $\ git\ clone\ https://github.com/trapexit/mergerfs.git
  735. $\ #\ or
  736. $\ wget\ https://github.com/trapexit/mergerfs/releases/download/<ver>/mergerfs\-<ver>.tar.gz
  737. \f[]
  738. .fi
  739. .SS Debian / Ubuntu
  740. .IP
  741. .nf
  742. \f[C]
  743. $\ cd\ mergerfs
  744. $\ sudo\ tools/install\-build\-pkgs
  745. $\ make\ deb
  746. $\ sudo\ dpkg\ \-i\ ../mergerfs_version_arch.deb
  747. \f[]
  748. .fi
  749. .SS Fedora
  750. .IP
  751. .nf
  752. \f[C]
  753. $\ su\ \-
  754. #\ cd\ mergerfs
  755. #\ tools/install\-build\-pkgs
  756. #\ make\ rpm
  757. #\ rpm\ \-i\ rpmbuild/RPMS/<arch>/mergerfs\-<verion>.<arch>.rpm
  758. \f[]
  759. .fi
  760. .SS Generically
  761. .PP
  762. Have git, g++, make, python, automake, libtool installed.
  763. .IP
  764. .nf
  765. \f[C]
  766. $\ cd\ mergerfs
  767. $\ make
  768. $\ sudo\ make\ install
  769. \f[]
  770. .fi
  771. .SS Generically with system libfuse
  772. .PP
  773. \f[B]NOTE:\f[] Configurable threading and thus \f[C]\-o\ threads=num\f[]
  774. option will be unavailable when built with system libfuse.
  775. .PP
  776. Have git, g++, make, python, pkg\-config installed.
  777. Also, install libfuse >= 2.9.7 (but not libfuse\-3.x) and matching
  778. libfuse\-dev (or libfuse\-devel).
  779. .IP
  780. .nf
  781. \f[C]
  782. $\ cd\ mergerfs
  783. $\ make\ INTERNAL_FUSE=0
  784. $\ sudo\ make\ INTERNAL_FUSE=0\ install
  785. \f[]
  786. .fi
  787. .SS Other build options
  788. .IP
  789. .nf
  790. \f[C]
  791. $\ make\ STATIC=1\ #\ builds\ a\ static\ binary
  792. $\ make\ LTO=1\ \ \ \ #\ perform\ link\ time\ optimization
  793. \f[]
  794. .fi
  795. .SH RUNTIME CONFIG
  796. .SS .mergerfs pseudo file
  797. .IP
  798. .nf
  799. \f[C]
  800. <mountpoint>/.mergerfs
  801. \f[]
  802. .fi
  803. .PP
  804. There is a pseudo file available at the mount point which allows for the
  805. runtime modification of certain \f[B]mergerfs\f[] options.
  806. The file will not show up in \f[B]readdir\f[] but can be
  807. \f[B]stat\f[]\[aq]ed and manipulated via
  808. {list,get,set}xattrs (http://linux.die.net/man/2/listxattr) calls.
  809. .PP
  810. Any changes made at runtime are \f[B]not\f[] persisted.
  811. If you wish for values to persist they must be included as options
  812. wherever you configure the mounting of mergerfs (/etc/fstab).
  813. .SS Keys
  814. .PP
  815. Use \f[C]xattr\ \-l\ /mountpoint/.mergerfs\f[] to see all supported
  816. keys.
  817. Some are informational and therefore read\-only.
  818. .SS user.mergerfs.branches
  819. .PP
  820. \f[B]NOTE:\f[] formerly \f[C]user.mergerfs.srcmounts\f[] but said key is
  821. still supported.
  822. .PP
  823. Used to query or modify the list of branches.
  824. When modifying there are several shortcuts to easy manipulation of the
  825. list.
  826. .PP
  827. .TS
  828. tab(@);
  829. l l.
  830. T{
  831. Value
  832. T}@T{
  833. Description
  834. T}
  835. _
  836. T{
  837. [list]
  838. T}@T{
  839. set
  840. T}
  841. T{
  842. +<[list]
  843. T}@T{
  844. prepend
  845. T}
  846. T{
  847. +>[list]
  848. T}@T{
  849. append
  850. T}
  851. T{
  852. \-[list]
  853. T}@T{
  854. remove all values provided
  855. T}
  856. T{
  857. \-<
  858. T}@T{
  859. remove first in list
  860. T}
  861. T{
  862. \->
  863. T}@T{
  864. remove last in list
  865. T}
  866. .TE
  867. .PP
  868. \f[C]xattr\ \-w\ user.mergerfs.branches\ +</mnt/drive3\ /mnt/pool/.mergerfs\f[]
  869. .PP
  870. The \f[C]=NC\f[], \f[C]=RO\f[], \f[C]=RW\f[] syntax works just as on the
  871. command line.
  872. .SS minfreespace
  873. .PP
  874. Input: interger with an optional multiplier suffix.
  875. \f[B]K\f[], \f[B]M\f[], or \f[B]G\f[].
  876. .PP
  877. Output: value in bytes
  878. .SS moveonenospc
  879. .PP
  880. Input: \f[B]true\f[] and \f[B]false\f[]
  881. .PP
  882. Ouput: \f[B]true\f[] or \f[B]false\f[]
  883. .SS categories / funcs
  884. .PP
  885. Input: short policy string as described elsewhere in this document
  886. .PP
  887. Output: the policy string except for categories where its funcs have
  888. multiple types.
  889. In that case it will be a comma separated list
  890. .SS Example
  891. .IP
  892. .nf
  893. \f[C]
  894. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-l\ .mergerfs
  895. user.mergerfs.branches:\ /mnt/a:/mnt/b
  896. user.mergerfs.minfreespace:\ 4294967295
  897. user.mergerfs.moveonenospc:\ false
  898. \&...
  899. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.category.search\ .mergerfs
  900. ff
  901. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.category.search\ newest\ .mergerfs
  902. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.category.search\ .mergerfs
  903. newest
  904. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ +/mnt/c\ .mergerfs
  905. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  906. /mnt/a:/mnt/b:/mnt/c
  907. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ =/mnt/c\ .mergerfs
  908. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  909. /mnt/c
  910. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ \[aq]+</mnt/a:/mnt/b\[aq]\ .mergerfs
  911. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  912. /mnt/a:/mnt/b:/mnt/c
  913. \f[]
  914. .fi
  915. .SS file / directory xattrs
  916. .PP
  917. While they won\[aq]t show up when using
  918. listxattr (http://linux.die.net/man/2/listxattr) \f[B]mergerfs\f[]
  919. offers a number of special xattrs to query information about the files
  920. served.
  921. To access the values you will need to issue a
  922. getxattr (http://linux.die.net/man/2/getxattr) for one of the following:
  923. .IP \[bu] 2
  924. \f[B]user.mergerfs.basepath:\f[] the base mount point for the file given
  925. the current getattr policy
  926. .IP \[bu] 2
  927. \f[B]user.mergerfs.relpath:\f[] the relative path of the file from the
  928. perspective of the mount point
  929. .IP \[bu] 2
  930. \f[B]user.mergerfs.fullpath:\f[] the full path of the original file
  931. given the getattr policy
  932. .IP \[bu] 2
  933. \f[B]user.mergerfs.allpaths:\f[] a NUL (\[aq]\[aq]) separated list of
  934. full paths to all files found
  935. .IP
  936. .nf
  937. \f[C]
  938. [trapexit:/mnt/mergerfs]\ $\ ls
  939. A\ B\ C
  940. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.fullpath\ A
  941. /mnt/a/full/path/to/A
  942. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.basepath\ A
  943. /mnt/a
  944. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.relpath\ A
  945. /full/path/to/A
  946. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.allpaths\ A\ |\ tr\ \[aq]\\0\[aq]\ \[aq]\\n\[aq]
  947. /mnt/a/full/path/to/A
  948. /mnt/b/full/path/to/A
  949. \f[]
  950. .fi
  951. .SH TOOLING
  952. .IP \[bu] 2
  953. https://github.com/trapexit/mergerfs\-tools
  954. .IP \[bu] 2
  955. mergerfs.ctl: A tool to make it easier to query and configure mergerfs
  956. at runtime
  957. .IP \[bu] 2
  958. mergerfs.fsck: Provides permissions and ownership auditing and the
  959. ability to fix them
  960. .IP \[bu] 2
  961. mergerfs.dedup: Will help identify and optionally remove duplicate files
  962. .IP \[bu] 2
  963. mergerfs.dup: Ensure there are at least N copies of a file across the
  964. pool
  965. .IP \[bu] 2
  966. mergerfs.balance: Rebalance files across drives by moving them from the
  967. most filled to the least filled
  968. .IP \[bu] 2
  969. mergerfs.mktrash: Creates FreeDesktop.org Trash specification compatible
  970. directories on a mergerfs mount
  971. .IP \[bu] 2
  972. https://github.com/trapexit/scorch
  973. .IP \[bu] 2
  974. scorch: A tool to help discover silent corruption of files and keep
  975. track of files
  976. .IP \[bu] 2
  977. https://github.com/trapexit/bbf
  978. .IP \[bu] 2
  979. bbf (bad block finder): a tool to scan for and \[aq]fix\[aq] hard drive
  980. bad blocks and find the files using those blocks
  981. .SH CACHING
  982. .SS page caching
  983. .PP
  984. The kernel performs caching of data pages on all files not opened with
  985. \f[C]O_DIRECT\f[].
  986. Due to mergerfs using FUSE and therefore being a userland process the
  987. kernel can double cache the content being read through mergerfs.
  988. Once from the underlying filesystem and once for mergerfs.
  989. Using \f[C]direct_io\f[] and/or \f[C]dropcacheonclose\f[] help minimize
  990. the double caching.
  991. \f[C]direct_io\f[] will instruct the kernel to bypass the page cache for
  992. files opened through mergerfs.
  993. \f[C]dropcacheonclose\f[] will cause mergerfs to instruct the kernel to
  994. flush a file\[aq]s page cache for which it had opened when closed.
  995. If most data is read once its probably best to enable both (read above
  996. for details and limitations).
  997. .PP
  998. If a cache is desired for mergerfs do not enable \f[C]direct_io\f[] and
  999. instead possibly use \f[C]auto_cache\f[] or \f[C]kernel_cache\f[].
  1000. By default FUSE will invalidate cached pages when a file is opened.
  1001. By using \f[C]auto_cache\f[] it will instead use \f[C]getattr\f[] to
  1002. check if a file has changed when the file is opened and if so will flush
  1003. the cache.
  1004. \f[C]ac_attr_timeout\f[] is the timeout for keeping said cache.
  1005. Alternatively \f[C]kernel_cache\f[] will keep the cache across opens
  1006. unless invalidated through other means.
  1007. You should only uses these if you do not plan to write/modify the same
  1008. files through mergerfs and the underlying filesystem at the same time.
  1009. It could lead to corruption.
  1010. Then again doing so without caching can also cause issues.
  1011. .PP
  1012. It\[aq]s a difficult balance between memory usage, cache bloat &
  1013. duplication, and performance.
  1014. Ideally mergerfs would be able to disable caching for the files it
  1015. reads/writes but allow page caching for itself.
  1016. That would limit the FUSE overhead.
  1017. However, there isn\[aq]t good way to achieve this.
  1018. .SS entry & attribute caching
  1019. .PP
  1020. Given the relatively high cost of FUSE due to the kernel <\-> userspace
  1021. round trips there are kernel side caches for file entries and
  1022. attributes.
  1023. The entry cache limits the \f[C]lookup\f[] calls to mergerfs which ask
  1024. if a file exists.
  1025. The attribute cache limits the need to make \f[C]getattr\f[] calls to
  1026. mergerfs which provide file attributes (mode, size, type, etc.).
  1027. As with the page cache these should not be used if the underlying
  1028. filesystems are being manipulated at the same time as it could lead to
  1029. odd behavior or data corruption.
  1030. The options for setting these are \f[C]entry_timeout\f[] and
  1031. \f[C]negative_timeout\f[] for the entry cache and \f[C]attr_timeout\f[]
  1032. for the attributes cache.
  1033. \f[C]negative_timeout\f[] refers to the timeout for negative responses
  1034. to lookups (non\-existant files).
  1035. .SS policy caching
  1036. .PP
  1037. Policies are run every time a function is called.
  1038. These policies can be expensive depending on the setup and usage
  1039. patterns.
  1040. Generally we wouldn\[aq]t want to cache policy results because it may
  1041. result in stale responses if the underlying drives are used directly.
  1042. .PP
  1043. The \f[C]open\f[] policy cache will cache the result of an \f[C]open\f[]
  1044. policy for a particular input for \f[C]cache.open\f[] seconds or until
  1045. the file is unlinked.
  1046. Each file close (release) will randomly chose to clean up the cache of
  1047. expired entries.
  1048. .PP
  1049. This cache is useful in cases like that of \f[B]Transmission\f[] which
  1050. has a "open, read/write, close" pattern (which is much more costly due
  1051. to the FUSE overhead than normal.)
  1052. .SS statfs caching
  1053. .PP
  1054. Of the syscalls used by mergerfs in policies the \f[C]statfs\f[] /
  1055. \f[C]statvfs\f[] call is perhaps the most expensive.
  1056. It\[aq]s used to find out the available space of a drive and whether it
  1057. is mounted read\-only.
  1058. Depending on the setup and usage pattern these queries can be relatively
  1059. costly.
  1060. When \f[C]cache.statfs\f[] is enabled all calls to \f[C]statfs\f[] by a
  1061. policy will be cached for the number of seconds its set to.
  1062. .PP
  1063. Example: If the create policy is \f[C]mfs\f[] and the timeout is 60 then
  1064. for that 60 seconds the same drive will be returned as the target for
  1065. creates because the available space won\[aq]t be updated for that time.
  1066. .SS writeback caching
  1067. .PP
  1068. writeback caching is a technique for improving write speeds by batching
  1069. writes at a faster device and then bulk writing to the slower device.
  1070. With FUSE the kernel will wait for a number of writes to be made and
  1071. then send it to the filesystem as one request.
  1072. mergerfs currently uses a slightly modified and vendored libfuse 2.9.7
  1073. which does not support writeback caching.
  1074. However, a prototype port to libfuse 3.x has been made and the writeback
  1075. cache appears to work as expected (though performance improvements
  1076. greatly depend on the way the client app writes data).
  1077. Once the port is complete and thoroughly tested writeback caching will
  1078. be available.
  1079. .SS tiered caching
  1080. .PP
  1081. Some storage technologies support what some call "tiered" caching.
  1082. The placing of usually smaller, faster storage as a transparent cache to
  1083. larger, slower storage.
  1084. NVMe, SSD, Optane in front of traditional HDDs for instance.
  1085. .PP
  1086. MergerFS does not natively support any sort of tiered caching.
  1087. Most users have no use for such a feature and its inclusion would
  1088. complicate the code.
  1089. However, there are a few situations where a cache drive could help with
  1090. a typical mergerfs setup.
  1091. .IP "1." 3
  1092. Fast network, slow drives, many readers: You\[aq]ve a 10+Gbps network
  1093. with many readers and your regular drives can\[aq]t keep up.
  1094. .IP "2." 3
  1095. Fast network, slow drives, small\[aq]ish bursty writes: You have a
  1096. 10+Gbps network and wish to transfer amounts of data less than your
  1097. cache drive but wish to do so quickly.
  1098. .PP
  1099. With #1 its arguable if you should be using mergerfs at all.
  1100. RAID would probably be the better solution.
  1101. If you\[aq]re going to use mergerfs there are other tactics that may
  1102. help: spreading the data across drives (see the mergerfs.dup tool) and
  1103. setting \f[C]func.open=rand\f[], using \f[C]symlinkify\f[], or using
  1104. dm\-cache or a similar technology to add tiered cache to the underlying
  1105. device.
  1106. .PP
  1107. With #2 one could use dm\-cache as well but there is another solution
  1108. which requires only mergerfs and a cronjob.
  1109. .IP "1." 3
  1110. Create 2 mergerfs pools.
  1111. One which includes just the slow drives and one which has both the fast
  1112. drives (SSD,NVME,etc.) and slow drives.
  1113. .IP "2." 3
  1114. The \[aq]cache\[aq] pool should have the cache drives listed first.
  1115. .IP "3." 3
  1116. The best \f[C]create\f[] policies to use for the \[aq]cache\[aq] pool
  1117. would probably be \f[C]ff\f[], \f[C]epff\f[], \f[C]lfs\f[], or
  1118. \f[C]eplfs\f[].
  1119. The latter two under the assumption that the cache drive(s) are far
  1120. smaller than the backing drives.
  1121. If using path preserving policies remember that you\[aq]ll need to
  1122. manually create the core directories of those paths you wish to be
  1123. cached.
  1124. Be sure the permissions are in sync.
  1125. Use \f[C]mergerfs.fsck\f[] to check / correct them.
  1126. You could also tag the slow drives as \f[C]=NC\f[] though that\[aq]d
  1127. mean if the cache drives fill you\[aq]d get "out of space" errors.
  1128. .IP "4." 3
  1129. Enable \f[C]moveonenospc\f[] and set \f[C]minfreespace\f[]
  1130. appropriately.
  1131. Perhaps setting \f[C]minfreespace\f[] to the size of the largest cache
  1132. drive.
  1133. .IP "5." 3
  1134. Set your programs to use the cache pool.
  1135. .IP "6." 3
  1136. Save one of the below scripts or create you\[aq]re own.
  1137. .IP "7." 3
  1138. Use \f[C]cron\f[] (as root) to schedule the command at whatever
  1139. frequency is appropriate for your workflow.
  1140. .SS time based expiring
  1141. .PP
  1142. Move files from cache to backing pool based only on the last time the
  1143. file was accessed.
  1144. Replace \f[C]\-atime\f[] with \f[C]\-amin\f[] if you want minutes rather
  1145. than days.
  1146. May want to use the \f[C]fadvise\f[] / \f[C]\-\-drop\-cache\f[] version
  1147. of rsync or run rsync with the tool "nocache".
  1148. .IP
  1149. .nf
  1150. \f[C]
  1151. #!/bin/bash
  1152. if\ [\ $#\ !=\ 3\ ];\ then
  1153. \ \ echo\ "usage:\ $0\ <cache\-drive>\ <backing\-pool>\ <days\-old>"
  1154. \ \ exit\ 1
  1155. fi
  1156. CACHE="${1}"
  1157. BACKING="${2}"
  1158. N=${3}
  1159. find\ "${CACHE}"\ \-type\ f\ \-atime\ +${N}\ \-printf\ \[aq]%P\\n\[aq]\ |\ \\
  1160. \ \ rsync\ \-\-files\-from=\-\ \-axqHAXWES\ \-\-preallocate\ \-\-remove\-source\-files\ "${CACHE}/"\ "${BACKING}/"
  1161. \f[]
  1162. .fi
  1163. .SS percentage full expiring
  1164. .PP
  1165. Move the oldest file from the cache to the backing pool.
  1166. Continue till below percentage threshold.
  1167. .IP
  1168. .nf
  1169. \f[C]
  1170. #!/bin/bash
  1171. if\ [\ $#\ !=\ 3\ ];\ then
  1172. \ \ echo\ "usage:\ $0\ <cache\-drive>\ <backing\-pool>\ <percentage>"
  1173. \ \ exit\ 1
  1174. fi
  1175. CACHE="${1}"
  1176. BACKING="${2}"
  1177. PERCENTAGE=${3}
  1178. set\ \-o\ errexit
  1179. while\ [\ $(df\ \-\-output=pcent\ "${CACHE}"\ |\ grep\ \-v\ Use\ |\ cut\ \-d\[aq]%\[aq]\ \-f1)\ \-gt\ ${PERCENTAGE}\ ]
  1180. do
  1181. \ \ \ \ FILE=$(find\ "${CACHE}"\ \-type\ f\ \-printf\ \[aq]%A\@\ %P\\n\[aq]\ |\ \\
  1182. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sort\ |\ \\
  1183. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ head\ \-n\ 1\ |\ \\
  1184. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cut\ \-d\[aq]\ \[aq]\ \-f2\-)
  1185. \ \ \ \ test\ \-n\ "${FILE}"
  1186. \ \ \ \ rsync\ \-axqHAXWES\ \-\-preallocate\ \-\-remove\-source\-files\ "${CACHE}/./${FILE}"\ "${BACKING}/"
  1187. done
  1188. \f[]
  1189. .fi
  1190. .SH TIPS / NOTES
  1191. .IP \[bu] 2
  1192. The recommended base options are
  1193. \f[B]defaults,allow_other,direct_io,use_ino\f[].
  1194. (\f[B]use_ino\f[] will only work when used with mergerfs 2.18.0 and
  1195. above.)
  1196. .IP \[bu] 2
  1197. Run mergerfs as \f[C]root\f[] unless you\[aq]re merging paths which are
  1198. owned by the same user otherwise strange permission issues may arise.
  1199. .IP \[bu] 2
  1200. https://github.com/trapexit/backup\-and\-recovery\-howtos : A set of
  1201. guides / howtos on creating a data storage system, backing it up,
  1202. maintaining it, and recovering from failure.
  1203. .IP \[bu] 2
  1204. If you don\[aq]t see some directories and files you expect in a merged
  1205. point or policies seem to skip drives be sure the user has permission to
  1206. all the underlying directories.
  1207. Use \f[C]mergerfs.fsck\f[] to audit the drive for out of sync
  1208. permissions.
  1209. .IP \[bu] 2
  1210. Do \f[B]not\f[] use \f[C]direct_io\f[] if you expect applications (such
  1211. as rtorrent) to mmap (http://linux.die.net/man/2/mmap) files.
  1212. It is not currently supported in FUSE w/ \f[C]direct_io\f[] enabled.
  1213. Enabling \f[C]dropcacheonclose\f[] is recommended when
  1214. \f[C]direct_io\f[] is disabled.
  1215. .IP \[bu] 2
  1216. Since POSIX gives you only error or success on calls its difficult to
  1217. determine the proper behavior when applying the behavior to multiple
  1218. targets.
  1219. \f[B]mergerfs\f[] will return an error only if all attempts of an action
  1220. fail.
  1221. Any success will lead to a success returned.
  1222. This means however that some odd situations may arise.
  1223. .IP \[bu] 2
  1224. Kodi (http://kodi.tv), Plex (http://plex.tv),
  1225. Subsonic (http://subsonic.org), etc.
  1226. can use directory mtime (http://linux.die.net/man/2/stat) to more
  1227. efficiently determine whether to scan for new content rather than simply
  1228. performing a full scan.
  1229. If using the default \f[B]getattr\f[] policy of \f[B]ff\f[] its possible
  1230. those programs will miss an update on account of it returning the first
  1231. directory found\[aq]s \f[B]stat\f[] info and its a later directory on
  1232. another mount which had the \f[B]mtime\f[] recently updated.
  1233. To fix this you will want to set \f[B]func.getattr=newest\f[].
  1234. Remember though that this is just \f[B]stat\f[].
  1235. If the file is later \f[B]open\f[]\[aq]ed or \f[B]unlink\f[]\[aq]ed and
  1236. the policy is different for those then a completely different file or
  1237. directory could be acted on.
  1238. .IP \[bu] 2
  1239. Some policies mixed with some functions may result in strange behaviors.
  1240. Not that some of these behaviors and race conditions couldn\[aq]t happen
  1241. outside \f[B]mergerfs\f[] but that they are far more likely to occur on
  1242. account of the attempt to merge together multiple sources of data which
  1243. could be out of sync due to the different policies.
  1244. .IP \[bu] 2
  1245. For consistency its generally best to set \f[B]category\f[] wide
  1246. policies rather than individual \f[B]func\f[]\[aq]s.
  1247. This will help limit the confusion of tools such as
  1248. rsync (http://linux.die.net/man/1/rsync).
  1249. However, the flexibility is there if needed.
  1250. .SH KNOWN ISSUES / BUGS
  1251. .SS directory mtime is not being updated
  1252. .PP
  1253. Remember that the default policy for \f[C]getattr\f[] is \f[C]ff\f[].
  1254. The information for the first directory found will be returned.
  1255. If it wasn\[aq]t the directory which had been updated then it will
  1256. appear outdated.
  1257. .PP
  1258. The reason this is the default is because any other policy would be far
  1259. more expensive and for many applications it is unnecessary.
  1260. To always return the directory with the most recent mtime or a faked
  1261. value based on all found would require a scan of all drives.
  1262. That alone is far more expensive than \f[C]ff\f[] but would also
  1263. possibly spin up sleeping drives.
  1264. .PP
  1265. If you always want the directory information from the one with the most
  1266. recent mtime then use the \f[C]newest\f[] policy for \f[C]getattr\f[].
  1267. .SS \f[C]mv\ /mnt/pool/foo\ /mnt/disk1/foo\f[] removes \f[C]foo\f[]
  1268. .PP
  1269. This is not a bug.
  1270. .PP
  1271. Run in verbose mode to better undertand what\[aq]s happening:
  1272. .IP
  1273. .nf
  1274. \f[C]
  1275. $\ mv\ \-v\ /mnt/pool/foo\ /mnt/disk1/foo
  1276. copied\ \[aq]/mnt/pool/foo\[aq]\ \->\ \[aq]/mnt/disk1/foo\[aq]
  1277. removed\ \[aq]/mnt/pool/foo\[aq]
  1278. $\ ls\ /mnt/pool/foo
  1279. ls:\ cannot\ access\ \[aq]/mnt/pool/foo\[aq]:\ No\ such\ file\ or\ directory
  1280. \f[]
  1281. .fi
  1282. .PP
  1283. \f[C]mv\f[], when working across devices, is copying the source to
  1284. target and then removing the source.
  1285. Since the source \f[B]is\f[] the target in this case, depending on the
  1286. unlink policy, it will remove the just copied file and other files
  1287. across the branches.
  1288. .PP
  1289. If you want to move files to one drive just copy them there and use
  1290. mergerfs.dedup to clean up the old paths or manually remove them from
  1291. the branches directly.
  1292. .SS cached memory appears greater than it should be
  1293. .PP
  1294. Use the \f[C]direct_io\f[] option as described above.
  1295. Due to what mergerfs is doing there ends up being two caches of a file
  1296. under normal usage.
  1297. One from the underlying filesystem and one from mergerfs.
  1298. Enabling \f[C]direct_io\f[] removes the mergerfs cache.
  1299. This saves on memory but means the kernel needs to communicate with
  1300. mergerfs more often and can therefore result in slower speeds.
  1301. .PP
  1302. Since enabling \f[C]direct_io\f[] disables \f[C]mmap\f[] this is not an
  1303. ideal situation however write speeds should be increased.
  1304. .PP
  1305. If \f[C]direct_io\f[] is disabled it is probably a good idea to enable
  1306. \f[C]dropcacheonclose\f[] to minimize double caching.
  1307. .SS NFS clients returning ESTALE / Stale file handle
  1308. .PP
  1309. Be sure to use \f[C]noforget\f[] and \f[C]use_ino\f[] arguments.
  1310. .SS NFS clients don\[aq]t work
  1311. .PP
  1312. Some NFS clients appear to fail when a mergerfs mount is exported.
  1313. Kodi in particular seems to have issues.
  1314. .PP
  1315. Try enabling the \f[C]use_ino\f[] option.
  1316. Some have reported that it fixes the issue.
  1317. .SS rtorrent fails with ENODEV (No such device)
  1318. .PP
  1319. Be sure to turn off \f[C]direct_io\f[].
  1320. rtorrent and some other applications use
  1321. mmap (http://linux.die.net/man/2/mmap) to read and write to files and
  1322. offer no failback to traditional methods.
  1323. FUSE does not currently support mmap while using \f[C]direct_io\f[].
  1324. There may be a performance penalty on writes with \f[C]direct_io\f[] off
  1325. as well as the problem of double caching but it\[aq]s the only way to
  1326. get such applications to work.
  1327. If the performance loss is too high for other apps you can mount
  1328. mergerfs twice.
  1329. Once with \f[C]direct_io\f[] enabled and one without it.
  1330. Be sure to set \f[C]dropcacheonclose=true\f[] if not using
  1331. \f[C]direct_io\f[].
  1332. .SS Plex doesn\[aq]t work with mergerfs
  1333. .PP
  1334. It does.
  1335. If you\[aq]re trying to put Plex\[aq]s config / metadata on mergerfs you
  1336. have to leave \f[C]direct_io\f[] off because Plex is using sqlite which
  1337. apparently needs mmap.
  1338. mmap doesn\[aq]t work with \f[C]direct_io\f[].
  1339. To fix this place the data elsewhere or disable \f[C]direct_io\f[] (with
  1340. \f[C]dropcacheonclose=true\f[]).
  1341. .PP
  1342. If the issue is that scanning doesn\[aq]t seem to pick up media then be
  1343. sure to set \f[C]func.getattr=newest\f[] as mentioned above.
  1344. .SS mmap performance is really bad
  1345. .PP
  1346. There is a bug (https://lkml.org/lkml/2016/3/16/260) in caching which
  1347. affects overall performance of mmap through FUSE in Linux 4.x kernels.
  1348. It is fixed in 4.4.10 and 4.5.4 (https://lkml.org/lkml/2016/5/11/59).
  1349. .SS When a program tries to move or rename a file it fails
  1350. .PP
  1351. Please read the section above regarding rename & link (#rename--link).
  1352. .PP
  1353. The problem is that many applications do not properly handle
  1354. \f[C]EXDEV\f[] errors which \f[C]rename\f[] and \f[C]link\f[] may return
  1355. even though they are perfectly valid situations which do not indicate
  1356. actual drive or OS errors.
  1357. The error will only be returned by mergerfs if using a path preserving
  1358. policy as described in the policy section above.
  1359. If you do not care about path preservation simply change the mergerfs
  1360. policy to the non\-path preserving version.
  1361. For example: \f[C]\-o\ category.create=mfs\f[]
  1362. .PP
  1363. Ideally the offending software would be fixed and it is recommended that
  1364. if you run into this problem you contact the software\[aq]s author and
  1365. request proper handling of \f[C]EXDEV\f[] errors.
  1366. .SS Samba: Moving files / directories fails
  1367. .PP
  1368. Workaround: Copy the file/directory and then remove the original rather
  1369. than move.
  1370. .PP
  1371. This isn\[aq]t an issue with Samba but some SMB clients.
  1372. GVFS\-fuse v1.20.3 and prior (found in Ubuntu 14.04 among others) failed
  1373. to handle certain error codes correctly.
  1374. Particularly \f[B]STATUS_NOT_SAME_DEVICE\f[] which comes from the
  1375. \f[B]EXDEV\f[] which is returned by \f[B]rename\f[] when the call is
  1376. crossing mount points.
  1377. When a program gets an \f[B]EXDEV\f[] it needs to explicitly take an
  1378. alternate action to accomplish it\[aq]s goal.
  1379. In the case of \f[B]mv\f[] or similar it tries \f[B]rename\f[] and on
  1380. \f[B]EXDEV\f[] falls back to a manual copying of data between the two
  1381. locations and unlinking the source.
  1382. In these older versions of GVFS\-fuse if it received \f[B]EXDEV\f[] it
  1383. would translate that into \f[B]EIO\f[].
  1384. This would cause \f[B]mv\f[] or most any application attempting to move
  1385. files around on that SMB share to fail with a IO error.
  1386. .PP
  1387. GVFS\-fuse v1.22.0 (https://bugzilla.gnome.org/show_bug.cgi?id=734568)
  1388. and above fixed this issue but a large number of systems use the older
  1389. release.
  1390. On Ubuntu the version can be checked by issuing
  1391. \f[C]apt\-cache\ showpkg\ gvfs\-fuse\f[].
  1392. Most distros released in 2015 seem to have the updated release and will
  1393. work fine but older systems may not.
  1394. Upgrading gvfs\-fuse or the distro in general will address the problem.
  1395. .PP
  1396. In Apple\[aq]s MacOSX 10.9 they replaced Samba (client and server) with
  1397. their own product.
  1398. It appears their new client does not handle \f[B]EXDEV\f[] either and
  1399. responds similar to older release of gvfs on Linux.
  1400. .SS Trashing files occasionally fails
  1401. .PP
  1402. This is the same issue as with Samba.
  1403. \f[C]rename\f[] returns \f[C]EXDEV\f[] (in our case that will really
  1404. only happen with path preserving policies like \f[C]epmfs\f[]) and the
  1405. software doesn\[aq]t handle the situtation well.
  1406. This is unfortunately a common failure of software which moves files
  1407. around.
  1408. The standard indicates that an implementation \f[C]MAY\f[] choose to
  1409. support non\-user home directory trashing of files (which is a
  1410. \f[C]MUST\f[]).
  1411. The implementation \f[C]MAY\f[] also support "top directory trashes"
  1412. which many probably do.
  1413. .PP
  1414. To create a \f[C]$topdir/.Trash\f[] directory as defined in the standard
  1415. use the mergerfs\-tools (https://github.com/trapexit/mergerfs-tools)
  1416. tool \f[C]mergerfs.mktrash\f[].
  1417. .SS tar: Directory renamed before its status could be extracted
  1418. .PP
  1419. Make sure to use the \f[C]use_ino\f[] option.
  1420. .SS Supplemental user groups
  1421. .PP
  1422. Due to the overhead of
  1423. getgroups/setgroups (http://linux.die.net/man/2/setgroups) mergerfs
  1424. utilizes a cache.
  1425. This cache is opportunistic and per thread.
  1426. Each thread will query the supplemental groups for a user when that
  1427. particular thread needs to change credentials and will keep that data
  1428. for the lifetime of the thread.
  1429. This means that if a user is added to a group it may not be picked up
  1430. without the restart of mergerfs.
  1431. However, since the high level FUSE API\[aq]s (at least the standard
  1432. version) thread pool dynamically grows and shrinks it\[aq]s possible
  1433. that over time a thread will be killed and later a new thread with no
  1434. cache will start and query the new data.
  1435. .PP
  1436. The gid cache uses fixed storage to simplify the design and be
  1437. compatible with older systems which may not have C++11 compilers.
  1438. There is enough storage for 256 users\[aq] supplemental groups.
  1439. Each user is allowed upto 32 supplemental groups.
  1440. Linux >= 2.6.3 allows upto 65535 groups per user but most other *nixs
  1441. allow far less.
  1442. NFS allowing only 16.
  1443. The system does handle overflow gracefully.
  1444. If the user has more than 32 supplemental groups only the first 32 will
  1445. be used.
  1446. If more than 256 users are using the system when an uncached user is
  1447. found it will evict an existing user\[aq]s cache at random.
  1448. So long as there aren\[aq]t more than 256 active users this should be
  1449. fine.
  1450. If either value is too low for your needs you will have to modify
  1451. \f[C]gidcache.hpp\f[] to increase the values.
  1452. Note that doing so will increase the memory needed by each thread.
  1453. .SS mergerfs or libfuse crashing
  1454. .PP
  1455. \f[B]NOTE:\f[] as of mergerfs 2.22.0 it includes the most recent version
  1456. of libfuse (or requires libfuse\-2.9.7) so any crash should be reported.
  1457. For older releases continue reading...
  1458. .PP
  1459. If suddenly the mergerfs mount point disappears and
  1460. \f[C]Transport\ endpoint\ is\ not\ connected\f[] is returned when
  1461. attempting to perform actions within the mount directory \f[B]and\f[]
  1462. the version of libfuse (use \f[C]mergerfs\ \-v\f[] to find the version)
  1463. is older than \f[C]2.9.4\f[] its likely due to a bug in libfuse.
  1464. Affected versions of libfuse can be found in Debian Wheezy, Ubuntu
  1465. Precise and others.
  1466. .PP
  1467. In order to fix this please install newer versions of libfuse.
  1468. If using a Debian based distro (Debian,Ubuntu,Mint) you can likely just
  1469. install newer versions of
  1470. libfuse (https://packages.debian.org/unstable/libfuse2) and
  1471. fuse (https://packages.debian.org/unstable/fuse) from the repo of a
  1472. newer release.
  1473. .SS mergerfs appears to be crashing or exiting
  1474. .PP
  1475. There seems to be an issue with Linux version \f[C]4.9.0\f[] and above
  1476. in which an invalid message appears to be transmitted to libfuse (used
  1477. by mergerfs) causing it to exit.
  1478. No messages will be printed in any logs as its not a proper crash.
  1479. Debugging of the issue is still ongoing and can be followed via the
  1480. fuse\-devel
  1481. thread (https://sourceforge.net/p/fuse/mailman/message/35662577).
  1482. .SS mergerfs under heavy load and memory preasure leads to kernel panic
  1483. .PP
  1484. https://lkml.org/lkml/2016/9/14/527
  1485. .IP
  1486. .nf
  1487. \f[C]
  1488. [25192.515454]\ kernel\ BUG\ at\ /build/linux\-a2WvEb/linux\-4.4.0/mm/workingset.c:346!
  1489. [25192.517521]\ invalid\ opcode:\ 0000\ [#1]\ SMP
  1490. [25192.519602]\ Modules\ linked\ in:\ netconsole\ ip6t_REJECT\ nf_reject_ipv6\ ipt_REJECT\ nf_reject_ipv4\ configfs\ binfmt_misc\ veth\ bridge\ stp\ llc\ nf_conntrack_ipv6\ nf_defrag_ipv6\ xt_conntrack\ ip6table_filter\ ip6_tables\ xt_multiport\ iptable_filter\ ipt_MASQUERADE\ nf_nat_masquerade_ipv4\ xt_comment\ xt_nat\ iptable_nat\ nf_conntrack_ipv4\ nf_defrag_ipv4\ nf_nat_ipv4\ nf_nat\ nf_conntrack\ xt_CHECKSUM\ xt_tcpudp\ iptable_mangle\ ip_tables\ x_tables\ intel_rapl\ x86_pkg_temp_thermal\ intel_powerclamp\ eeepc_wmi\ asus_wmi\ coretemp\ sparse_keymap\ kvm_intel\ ppdev\ kvm\ irqbypass\ mei_me\ 8250_fintek\ input_leds\ serio_raw\ parport_pc\ tpm_infineon\ mei\ shpchp\ mac_hid\ parport\ lpc_ich\ autofs4\ drbg\ ansi_cprng\ dm_crypt\ algif_skcipher\ af_alg\ btrfs\ raid456\ async_raid6_recov\ async_memcpy\ async_pq\ async_xor\ async_tx\ xor\ raid6_pq\ libcrc32c\ raid0\ multipath\ linear\ raid10\ raid1\ i915\ crct10dif_pclmul\ crc32_pclmul\ aesni_intel\ i2c_algo_bit\ aes_x86_64\ drm_kms_helper\ lrw\ gf128mul\ glue_helper\ ablk_helper\ syscopyarea\ cryptd\ sysfillrect\ sysimgblt\ fb_sys_fops\ drm\ ahci\ r8169\ libahci\ mii\ wmi\ fjes\ video\ [last\ unloaded:\ netconsole]
  1491. [25192.540910]\ CPU:\ 2\ PID:\ 63\ Comm:\ kswapd0\ Not\ tainted\ 4.4.0\-36\-generic\ #55\-Ubuntu
  1492. [25192.543411]\ Hardware\ name:\ System\ manufacturer\ System\ Product\ Name/P8H67\-M\ PRO,\ BIOS\ 3904\ 04/27/2013
  1493. [25192.545840]\ task:\ ffff88040cae6040\ ti:\ ffff880407488000\ task.ti:\ ffff880407488000
  1494. [25192.548277]\ RIP:\ 0010:[<ffffffff811ba501>]\ \ [<ffffffff811ba501>]\ shadow_lru_isolate+0x181/0x190
  1495. [25192.550706]\ RSP:\ 0018:ffff88040748bbe0\ \ EFLAGS:\ 00010002
  1496. [25192.553127]\ RAX:\ 0000000000001c81\ RBX:\ ffff8802f91ee928\ RCX:\ ffff8802f91eeb38
  1497. [25192.555544]\ RDX:\ ffff8802f91ee938\ RSI:\ ffff8802f91ee928\ RDI:\ ffff8804099ba2c0
  1498. [25192.557914]\ RBP:\ ffff88040748bc08\ R08:\ 000000000001a7b6\ R09:\ 000000000000003f
  1499. [25192.560237]\ R10:\ 000000000001a750\ R11:\ 0000000000000000\ R12:\ ffff8804099ba2c0
  1500. [25192.562512]\ R13:\ ffff8803157e9680\ R14:\ ffff8803157e9668\ R15:\ ffff8804099ba2c8
  1501. [25192.564724]\ FS:\ \ 0000000000000000(0000)\ GS:ffff88041f280000(0000)\ knlGS:0000000000000000
  1502. [25192.566990]\ CS:\ \ 0010\ DS:\ 0000\ ES:\ 0000\ CR0:\ 0000000080050033
  1503. [25192.569201]\ CR2:\ 00007ffabb690000\ CR3:\ 0000000001e0a000\ CR4:\ 00000000000406e0
  1504. [25192.571419]\ Stack:
  1505. [25192.573550]\ \ ffff8804099ba2c0\ ffff88039e4f86f0\ ffff8802f91ee928\ ffff8804099ba2c8
  1506. [25192.575695]\ \ ffff88040748bd08\ ffff88040748bc58\ ffffffff811b99bf\ 0000000000000052
  1507. [25192.577814]\ \ 0000000000000000\ ffffffff811ba380\ 000000000000008a\ 0000000000000080
  1508. [25192.579947]\ Call\ Trace:
  1509. [25192.582022]\ \ [<ffffffff811b99bf>]\ __list_lru_walk_one.isra.3+0x8f/0x130
  1510. [25192.584137]\ \ [<ffffffff811ba380>]\ ?\ memcg_drain_all_list_lrus+0x190/0x190
  1511. [25192.586165]\ \ [<ffffffff811b9a83>]\ list_lru_walk_one+0x23/0x30
  1512. [25192.588145]\ \ [<ffffffff811ba544>]\ scan_shadow_nodes+0x34/0x50
  1513. [25192.590074]\ \ [<ffffffff811a0e9d>]\ shrink_slab.part.40+0x1ed/0x3d0
  1514. [25192.591985]\ \ [<ffffffff811a53da>]\ shrink_zone+0x2ca/0x2e0
  1515. [25192.593863]\ \ [<ffffffff811a64ce>]\ kswapd+0x51e/0x990
  1516. [25192.595737]\ \ [<ffffffff811a5fb0>]\ ?\ mem_cgroup_shrink_node_zone+0x1c0/0x1c0
  1517. [25192.597613]\ \ [<ffffffff810a0808>]\ kthread+0xd8/0xf0
  1518. [25192.599495]\ \ [<ffffffff810a0730>]\ ?\ kthread_create_on_node+0x1e0/0x1e0
  1519. [25192.601335]\ \ [<ffffffff8182e34f>]\ ret_from_fork+0x3f/0x70
  1520. [25192.603193]\ \ [<ffffffff810a0730>]\ ?\ kthread_create_on_node+0x1e0/0x1e0
  1521. \f[]
  1522. .fi
  1523. .PP
  1524. There is a bug in the kernel.
  1525. A work around appears to be turning off \f[C]splice\f[].
  1526. Add \f[C]no_splice_write,no_splice_move,no_splice_read\f[] to
  1527. mergerfs\[aq] options.
  1528. Should be placed after \f[C]defaults\f[] if it is used since it will
  1529. turn them on.
  1530. This however is not guaranteed to work.
  1531. .SS rm: fts_read failed: No such file or directory
  1532. .PP
  1533. Not \f[I]really\f[] a bug.
  1534. The FUSE library will move files when asked to delete them as a way to
  1535. deal with certain edge cases and then later delete that file when its
  1536. clear the file is no longer needed.
  1537. This however can lead to two issues.
  1538. One is that these hidden files are noticed by \f[C]rm\ \-rf\f[] or
  1539. \f[C]find\f[] when scanning directories and they may try to remove them
  1540. and they might have disappeared already.
  1541. There is nothing \f[I]wrong\f[] about this happening but it can be
  1542. annoying.
  1543. The second issue is that a directory might not be able to removed on
  1544. account of the hidden file being still there.
  1545. .PP
  1546. Using the \f[B]hard_remove\f[] option will make it so these temporary
  1547. files are not used and files are deleted immedately.
  1548. That has a side effect however.
  1549. Files which are unlinked and then they are still used (in certain forms)
  1550. will result in an error.
  1551. .PP
  1552. A fix is in the works for this.
  1553. .SH FAQ
  1554. .SS How well does mergerfs scale? Is it "production ready?"
  1555. .PP
  1556. Users have reported running mergerfs on everything from a Raspberry Pi
  1557. to dual socket Xeon systems with >20 cores.
  1558. I\[aq]m aware of at least a few companies which use mergerfs in
  1559. production.
  1560. Open Media Vault (https://www.openmediavault.org) includes mergerfs is
  1561. it\[aq]s sole solution for pooling drives.
  1562. .SS Can mergerfs be used with drives which already have data / are in
  1563. use?
  1564. .PP
  1565. Yes.
  1566. MergerFS is a proxy and does \f[B]NOT\f[] interfere with the normal form
  1567. or function of the drives / mounts / paths it manages.
  1568. .PP
  1569. MergerFS is \f[B]not\f[] a traditional filesystem.
  1570. MergerFS is \f[B]not\f[] RAID.
  1571. It does \f[B]not\f[] manipulate the data that passes through it.
  1572. It does \f[B]not\f[] shard data across drives.
  1573. It merely shards some \f[B]behavior\f[] and aggregates others.
  1574. .SS Can mergerfs be removed without affecting the data?
  1575. .PP
  1576. See the previous question\[aq]s answer.
  1577. .SS Do hard links work?
  1578. .PP
  1579. Yes.
  1580. You need to use \f[C]use_ino\f[] to support proper reporting of inodes.
  1581. .PP
  1582. What mergerfs does not do is fake hard links across branches.
  1583. Read the section "rename & link" for how it.
  1584. .SS Does mergerfs support CoW / copy\-on\-write?
  1585. .PP
  1586. Not in the sense of a filesystem like BTRFS or ZFS nor in the overlayfs
  1587. or aufs sense.
  1588. It does offer a
  1589. cow\-shell (http://manpages.ubuntu.com/manpages/bionic/man1/cow-shell.1.html)
  1590. like hard link breaking (copy to temp file then rename over original)
  1591. which can be useful when wanting to save space by hardlinking duplicate
  1592. files but wish to treat each name as if it were a unique and separate
  1593. file.
  1594. .SS Why can\[aq]t I see my files / directories?
  1595. .PP
  1596. It\[aq]s almost always a permissions issue.
  1597. Unlike mhddfs, which runs as root and attempts to access content as
  1598. such, mergerfs always changes it\[aq]s credentials to that of the
  1599. caller.
  1600. This means that if the user does not have access to a file or directory
  1601. than neither will mergerfs.
  1602. However, because mergerfs is creating a union of paths it may be able to
  1603. read some files and directories on one drive but not another resulting
  1604. in an incomplete set.
  1605. .PP
  1606. Whenever you run into a split permission issue (seeing some but not all
  1607. files) try using
  1608. mergerfs.fsck (https://github.com/trapexit/mergerfs-tools) tool to check
  1609. for and fix the mismatch.
  1610. If you aren\[aq]t seeing anything at all be sure that the basic
  1611. permissions are correct.
  1612. The user and group values are correct and that directories have their
  1613. executable bit set.
  1614. A common mistake by users new to Linux is to \f[C]chmod\ \-R\ 644\f[]
  1615. when they should have \f[C]chmod\ \-R\ u=rwX,go=rX\f[].
  1616. .PP
  1617. If using a network filesystem such as NFS, SMB, CIFS (Samba) be sure to
  1618. pay close attention to anything regarding permissioning and users.
  1619. Root squashing and user translation for instance has bitten a few
  1620. mergerfs users.
  1621. Some of these also affect the use of mergerfs from container platforms
  1622. such as Docker.
  1623. .SS Why is only one drive being used?
  1624. .PP
  1625. Are you using a path preserving policy?
  1626. The default policy for file creation is \f[C]epmfs\f[].
  1627. That means only the drives with the path preexisting will be considered
  1628. when creating a file.
  1629. If you don\[aq]t care about where files and directories are created you
  1630. likely shouldn\[aq]t be using a path preserving policy and instead
  1631. something like \f[C]mfs\f[].
  1632. .PP
  1633. This can be especially apparent when filling an empty pool from an
  1634. external source.
  1635. If you do want path preservation you\[aq]ll need to perform the manual
  1636. act of creating paths on the drives you want the data to land on before
  1637. transfering your data.
  1638. Setting \f[C]func.mkdir=epall\f[] can simplify managing path
  1639. perservation for \f[C]create\f[].
  1640. .SS Why was libfuse embedded into mergerfs?
  1641. .PP
  1642. A significant number of users use mergerfs on distros with old versions
  1643. of libfuse which have serious bugs.
  1644. Requiring updated versions of libfuse on those distros isn\[aq]t
  1645. pratical (no package offered, user inexperience, etc.).
  1646. The only practical way to provide a stable runtime on those systems was
  1647. to "vendor" the library into the project.
  1648. .SS Why use mergerfs over mhddfs?
  1649. .PP
  1650. mhddfs is no longer maintained and has some known stability and security
  1651. issues (see below).
  1652. MergerFS provides a superset of mhddfs\[aq] features and should offer
  1653. the same or maybe better performance.
  1654. .PP
  1655. Below is an example of mhddfs and mergerfs setup to work similarly.
  1656. .PP
  1657. \f[C]mhddfs\ \-o\ mlimit=4G,allow_other\ /mnt/drive1,/mnt/drive2\ /mnt/pool\f[]
  1658. .PP
  1659. \f[C]mergerfs\ \-o\ minfreespace=4G,defaults,allow_other,category.create=ff\ /mnt/drive1:/mnt/drive2\ /mnt/pool\f[]
  1660. .SS Why use mergerfs over aufs?
  1661. .PP
  1662. aufs is mostly abandoned and no longer available in many distros.
  1663. .PP
  1664. While aufs can offer better peak performance mergerfs provides more
  1665. configurability and is generally easier to use.
  1666. mergerfs however does not offer the overlay / copy\-on\-write (CoW)
  1667. features which aufs and overlayfs have.
  1668. .SS Why use mergerfs over unionfs?
  1669. .PP
  1670. UnionFS is more like aufs then mergerfs in that it offers overlay / CoW
  1671. features.
  1672. If you\[aq]re just looking to create a union of drives and want
  1673. flexibility in file/directory placement then mergerfs offers that
  1674. whereas unionfs is more for overlaying RW filesystems over RO ones.
  1675. .SS Why use mergerfs over LVM/ZFS/BTRFS/RAID0 drive concatenation /
  1676. striping?
  1677. .PP
  1678. With simple JBOD / drive concatenation / stripping / RAID0 a single
  1679. drive failure will result in full pool failure.
  1680. mergerfs performs a similar behavior without the possibility of
  1681. catastrophic failure and the difficulties in recovery.
  1682. Drives may fail however all other data will continue to be accessable.
  1683. .PP
  1684. When combined with something like SnapRaid (http://www.snapraid.it)
  1685. and/or an offsite backup solution you can have the flexibilty of JBOD
  1686. without the single point of failure.
  1687. .SS Why use mergerfs over ZFS?
  1688. .PP
  1689. MergerFS is not intended to be a replacement for ZFS.
  1690. MergerFS is intended to provide flexible pooling of arbitrary drives
  1691. (local or remote), of arbitrary sizes, and arbitrary filesystems.
  1692. For \f[C]write\ once,\ read\ many\f[] usecases such as bulk media
  1693. storage.
  1694. Where data integrity and backup is managed in other ways.
  1695. In that situation ZFS can introduce major maintance and cost burdens as
  1696. described
  1697. here (http://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html).
  1698. .SS Can drives be written to directly? Outside of mergerfs while pooled?
  1699. .PP
  1700. Yes, however its not recommended to use the same file from within the
  1701. pool and from without at the same time.
  1702. Especially if using caching of any kind (entry_timeout, attr_timeout,
  1703. ac_attr_timeout, negative_timeout, auto_cache, kernel_cache).
  1704. .SS Why do I get an "out of space" / "no space left on device" / ENOSPC
  1705. error even though there appears to be lots of space available?
  1706. .PP
  1707. First make sure you\[aq]ve read the sections above about policies, path
  1708. preservation, branch filtering, and the options \f[B]minfreespace\f[],
  1709. \f[B]moveonenospc\f[], \f[B]statfs\f[], and \f[B]statfs_ignore\f[].
  1710. .PP
  1711. mergerfs is simply presenting a union of the content within multiple
  1712. branches.
  1713. The reported free space is an aggregate of space available within the
  1714. pool (behavior modified by \f[B]statfs\f[] and \f[B]statfs_ignore\f[]).
  1715. It does not represent a contiguous space.
  1716. In the same way that read\-only filesystems, those with quotas, or
  1717. reserved space report the full theoretical space available.
  1718. .PP
  1719. Due to path preservation, branch tagging, read\-only status, and
  1720. \f[B]minfreespace\f[] settings it is perfectly valid that
  1721. \f[C]ENOSPC\f[] / "out of space" / "no space left on device" be
  1722. returned.
  1723. It is doing what was asked of it: filtering possible branches due to
  1724. those settings.
  1725. Only one error can be returned and if one of the reasons for filtering a
  1726. branch was \f[B]minfreespace\f[] then it will be returned as such.
  1727. \f[B]moveonenospc\f[] is only relevant to writing a file which is too
  1728. large for the drive its currently on.
  1729. .PP
  1730. It is also possible that the filesystem selected has run out of inodes.
  1731. Use \f[C]df\ \-i\f[] to list the total and available inodes per
  1732. filesystem.
  1733. .PP
  1734. If you don\[aq]t care about path preservation then simply change the
  1735. \f[C]create\f[] policy to one which isn\[aq]t.
  1736. \f[C]mfs\f[] is probably what most are looking for.
  1737. The reason its not default is because it was originally set to
  1738. \f[C]epmfs\f[] and changing it now would change people\[aq]s setup.
  1739. Such a setting change will likely occur in mergerfs 3.
  1740. .SS Can mergerfs mounts be exported over NFS?
  1741. .PP
  1742. Yes.
  1743. Due to current usage of libfuse by mergerfs and how NFS interacts with
  1744. it it is necessary to add \f[C]noforget\f[] to mergerfs options to keep
  1745. from getting "stale file handle" errors.
  1746. .PP
  1747. Some clients (Kodi) have issues in which the contents of the NFS mount
  1748. will not be presented but users have found that enabling the
  1749. \f[C]use_ino\f[] option often fixes that problem.
  1750. .SS Can mergerfs mounts be exported over Samba / SMB?
  1751. .PP
  1752. Yes.
  1753. While some users have reported problems it appears to always be related
  1754. to how Samba is setup in relation to permissions.
  1755. .SS How are inodes calculated?
  1756. .PP
  1757. mergerfs\-inode = (original\-inode | (device\-id << 32))
  1758. .PP
  1759. While \f[C]ino_t\f[] is 64 bits only a few filesystems use more than 32.
  1760. Similarly, while \f[C]dev_t\f[] is also 64 bits it was traditionally 16
  1761. bits.
  1762. Bitwise or\[aq]ing them together should work most of the time.
  1763. While totally unique inodes are preferred the overhead which would be
  1764. needed does not seem to outweighted by the benefits.
  1765. .PP
  1766. While atypical, yes, inodes can be reused and not refer to the same
  1767. file.
  1768. The internal id used to reference a file in FUSE is different from the
  1769. inode value presented.
  1770. The former is the \f[C]nodeid\f[] and is actually a tuple of
  1771. (nodeid,generation).
  1772. That tuple is not user facing.
  1773. The inode is merely metadata passed through the kernel and found using
  1774. the \f[C]stat\f[] family of calls or \f[C]readdir\f[].
  1775. .PP
  1776. From FUSE docs regarding \f[C]use_ino\f[]:
  1777. .IP
  1778. .nf
  1779. \f[C]
  1780. Honor\ the\ st_ino\ field\ in\ the\ functions\ getattr()\ and
  1781. fill_dir().\ This\ value\ is\ used\ to\ fill\ in\ the\ st_ino\ field
  1782. in\ the\ stat(2),\ lstat(2),\ fstat(2)\ functions\ and\ the\ d_ino
  1783. field\ in\ the\ readdir(2)\ function.\ The\ filesystem\ does\ not
  1784. have\ to\ guarantee\ uniqueness,\ however\ some\ applications
  1785. rely\ on\ this\ value\ being\ unique\ for\ the\ whole\ filesystem.
  1786. Note\ that\ this\ does\ *not*\ affect\ the\ inode\ that\ libfuse
  1787. and\ the\ kernel\ use\ internally\ (also\ called\ the\ "nodeid").
  1788. \f[]
  1789. .fi
  1790. .SS I notice massive slowdowns of writes over NFS
  1791. .PP
  1792. Due to how NFS works and interacts with FUSE when not using
  1793. \f[C]direct_io\f[] its possible that a getxattr for
  1794. \f[C]security.capability\f[] will be issued prior to any write.
  1795. This will usually result in a massive slowdown for writes.
  1796. Using \f[C]direct_io\f[] will keep this from happening (and generally
  1797. good to enable unless you need the features it disables) but the
  1798. \f[C]security_capability\f[] option can also help by short circuiting
  1799. the call and returning \f[C]ENOATTR\f[].
  1800. .PP
  1801. You could also set \f[C]xattr\f[] to \f[C]noattr\f[] or \f[C]nosys\f[]
  1802. to short circuit or stop all xattr requests.
  1803. .SS What are these .fuse_hidden files?
  1804. .PP
  1805. When not using \f[C]hard_remove\f[] libfuse will create
  1806. \&.fuse_hiddenXXXXXXXX files when an opened file is unlinked.
  1807. This is to simplify "use after unlink" usecases.
  1808. There is a possibility these files end up being picked up by software
  1809. scanning directories and not ignoring hidden files.
  1810. This is rarely a problem but a solution is in the works.
  1811. .PP
  1812. The files are cleaned up once the file is finally closed.
  1813. Only if mergerfs crashes or is killed would they be left around.
  1814. They are safe to remove as they are already unlinked files.
  1815. .SS It\[aq]s mentioned that there are some security issues with mhddfs.
  1816. What are they? How does mergerfs address them?
  1817. .PP
  1818. mhddfs (https://github.com/trapexit/mhddfs) manages running as
  1819. \f[B]root\f[] by calling
  1820. getuid() (https://github.com/trapexit/mhddfs/blob/cae96e6251dd91e2bdc24800b4a18a74044f6672/src/main.c#L319)
  1821. and if it returns \f[B]0\f[] then it will
  1822. chown (http://linux.die.net/man/1/chown) the file.
  1823. Not only is that a race condition but it doesn\[aq]t handle other
  1824. situations.
  1825. Rather than attempting to simulate POSIX ACL behavior the proper way to
  1826. manage this is to use seteuid (http://linux.die.net/man/2/seteuid) and
  1827. setegid (http://linux.die.net/man/2/setegid), in effect becoming the
  1828. user making the original call, and perform the action as them.
  1829. This is what mergerfs does and why mergerfs should always run as root.
  1830. .PP
  1831. In Linux setreuid syscalls apply only to the thread.
  1832. GLIBC hides this away by using realtime signals to inform all threads to
  1833. change credentials.
  1834. Taking after \f[B]Samba\f[], mergerfs uses
  1835. \f[B]syscall(SYS_setreuid,...)\f[] to set the callers credentials for
  1836. that thread only.
  1837. Jumping back to \f[B]root\f[] as necessary should escalated privileges
  1838. be needed (for instance: to clone paths between drives).
  1839. .PP
  1840. For non\-Linux systems mergerfs uses a read\-write lock and changes
  1841. credentials only when necessary.
  1842. If multiple threads are to be user X then only the first one will need
  1843. to change the processes credentials.
  1844. So long as the other threads need to be user X they will take a readlock
  1845. allowing multiple threads to share the credentials.
  1846. Once a request comes in to run as user Y that thread will attempt a
  1847. write lock and change to Y\[aq]s credentials when it can.
  1848. If the ability to give writers priority is supported then that flag will
  1849. be used so threads trying to change credentials don\[aq]t starve.
  1850. This isn\[aq]t the best solution but should work reasonably well
  1851. assuming there are few users.
  1852. .SH PERFORMANCE TWEAKING
  1853. .IP \[bu] 2
  1854. try adding (or removing) \f[C]direct_io\f[]
  1855. .IP \[bu] 2
  1856. try adding (or removing) \f[C]auto_cache\f[] / \f[C]noauto_cache\f[]
  1857. (included in \f[C]defaults\f[])
  1858. .IP \[bu] 2
  1859. try adding (or removing) \f[C]kernel_cache\f[] (don\[aq]t use the
  1860. underlying filesystems directly if enabling \f[C]kernel_cache\f[])
  1861. .IP \[bu] 2
  1862. try adding (or removing) \f[C]splice_move\f[], \f[C]splice_read\f[], and
  1863. \f[C]splice_write\f[] (all three included in \f[C]defaults\f[])
  1864. .IP \[bu] 2
  1865. try increasing cache timeouts \f[C]attr_timeout\f[],
  1866. \f[C]entry_timeout\f[], \f[C]ac_attr_timeout\f[],
  1867. \f[C]negative_timeout\f[]
  1868. .IP \[bu] 2
  1869. try changing the number of worker threads
  1870. .IP \[bu] 2
  1871. try disabling \f[C]security_capability\f[] or \f[C]xattr\f[]
  1872. .IP \[bu] 2
  1873. test theoretical performance using \f[C]nullrw\f[] or mounting a ram
  1874. disk
  1875. .IP \[bu] 2
  1876. use \f[C]symlinkify\f[] if your data is largely static and you need
  1877. native speed reads
  1878. .IP \[bu] 2
  1879. use lvm and lvm cache to place a SSD in front of your HDDs (howto
  1880. coming)
  1881. .SH SUPPORT
  1882. .PP
  1883. Filesystems are very complex and difficult to debug.
  1884. mergerfs, while being just a proxy of sorts, is also very difficult to
  1885. debug given the large number of possible settings it can have itself and
  1886. the massive number of environments it can run in.
  1887. When reporting on a suspected issue \f[B]please, please\f[] include as
  1888. much of the below information as possible otherwise it will be difficult
  1889. or impossible to diagnose.
  1890. Also please make sure to read all of the above documentation as it
  1891. includes nearly every known system or user issue previously encountered.
  1892. .SS Information to include in bug reports
  1893. .IP \[bu] 2
  1894. Version of mergerfs: \f[C]mergerfs\ \-V\f[]
  1895. .IP \[bu] 2
  1896. mergerfs settings: from \f[C]/etc/fstab\f[] or command line execution
  1897. .IP \[bu] 2
  1898. Version of Linux: \f[C]uname\ \-a\f[]
  1899. .IP \[bu] 2
  1900. Versions of any additional software being used
  1901. .IP \[bu] 2
  1902. List of drives, their filesystems, and sizes (before and after issue):
  1903. \f[C]df\ \-h\f[]
  1904. .IP \[bu] 2
  1905. A \f[C]strace\f[] of the app having problems:
  1906. .IP \[bu] 2
  1907. \f[C]strace\ \-f\ \-o\ /tmp/app.strace.txt\ <cmd>\f[]
  1908. .IP \[bu] 2
  1909. A \f[C]strace\f[] of mergerfs while the program is trying to do whatever
  1910. it\[aq]s failing to do:
  1911. .IP \[bu] 2
  1912. \f[C]strace\ \-f\ \-p\ <mergerfsPID>\ \-o\ /tmp/mergerfs.strace.txt\f[]
  1913. .IP \[bu] 2
  1914. \f[B]Precise\f[] directions on replicating the issue.
  1915. Do not leave \f[B]anything\f[] out.
  1916. .IP \[bu] 2
  1917. Try to recreate the problem in the simplist way using standard programs.
  1918. .SS Contact / Issue submission
  1919. .IP \[bu] 2
  1920. github.com: https://github.com/trapexit/mergerfs/issues
  1921. .IP \[bu] 2
  1922. email: trapexit\@spawn.link
  1923. .IP \[bu] 2
  1924. twitter: https://twitter.com/_trapexit
  1925. .IP \[bu] 2
  1926. reddit: https://www.reddit.com/user/trapexit
  1927. .SS Support development
  1928. .PP
  1929. This software is free to use and released under a very liberal license.
  1930. That said if you like this software and would like to support its
  1931. development donations are welcome.
  1932. .IP \[bu] 2
  1933. PayPal: trapexit\@spawn.link
  1934. .IP \[bu] 2
  1935. Patreon: https://www.patreon.com/trapexit
  1936. .IP \[bu] 2
  1937. SubscribeStar: https://www.subscribestar.com/trapexit
  1938. .IP \[bu] 2
  1939. Bitcoin (BTC): 12CdMhEPQVmjz3SSynkAEuD5q9JmhTDCZA
  1940. .IP \[bu] 2
  1941. Bitcoin Cash (BCH): 1AjPqZZhu7GVEs6JFPjHmtsvmDL4euzMzp
  1942. .IP \[bu] 2
  1943. Ethereum (ETH): 0x09A166B11fCC127324C7fc5f1B572255b3046E94
  1944. .IP \[bu] 2
  1945. Litecoin (LTC): LXAsq6yc6zYU3EbcqyWtHBrH1Ypx4GjUjm
  1946. .IP \[bu] 2
  1947. Ripple (XRP): rNACR2hqGjpbHuCKwmJ4pDpd2zRfuRATcE
  1948. .SH LINKS
  1949. .IP \[bu] 2
  1950. https://spawn.link
  1951. .IP \[bu] 2
  1952. https://github.com/trapexit/mergerfs
  1953. .IP \[bu] 2
  1954. https://github.com/trapexit/mergerfs\-tools
  1955. .IP \[bu] 2
  1956. https://github.com/trapexit/scorch
  1957. .IP \[bu] 2
  1958. https://github.com/trapexit/bbf
  1959. .IP \[bu] 2
  1960. https://github.com/trapexit/backup\-and\-recovery\-howtos
  1961. .SH AUTHORS
  1962. Antonio SJ Musumeci <trapexit@spawn.link>.