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.

2446 lines
94 KiB

7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
5 years ago
9 years ago
9 years ago
5 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
5 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
7 years ago
6 years ago
6 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
6 years ago
6 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
5 years ago
5 years ago
5 years ago
5 years ago
5 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" "2020\-03\-10" "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 / file placement
  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. Can turn read\-only files into symlinks to underlying file
  42. .IP \[bu] 2
  43. Hard link copy\-on\-write / CoW
  44. .IP \[bu] 2
  45. supports POSIX ACLs
  46. .SH How it works
  47. .PP
  48. mergerfs logically merges multiple paths together.
  49. Think a union of sets.
  50. The file/s or directory/s acted on or presented through mergerfs are
  51. based on the policy chosen for that particular action.
  52. Read more about policies below.
  53. .IP
  54. .nf
  55. \f[C]
  56. A\ \ \ \ \ \ \ \ \ +\ \ \ \ \ \ B\ \ \ \ \ \ \ \ =\ \ \ \ \ \ \ C
  57. /disk1\ \ \ \ \ \ \ \ \ \ \ /disk2\ \ \ \ \ \ \ \ \ \ \ /merged
  58. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  59. +\-\-\ /dir1\ \ \ \ \ \ \ \ +\-\-\ /dir1\ \ \ \ \ \ \ \ +\-\-\ /dir1
  60. |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |
  61. |\ \ \ +\-\-\ file1\ \ \ \ |\ \ \ +\-\-\ file2\ \ \ \ |\ \ \ +\-\-\ file1
  62. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file3\ \ \ \ |\ \ \ +\-\-\ file2
  63. +\-\-\ /dir2\ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file3
  64. |\ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir3\ \ \ \ \ \ \ \ |
  65. |\ \ \ +\-\-\ file4\ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir2
  66. |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ file5\ \ \ |\ \ \ |
  67. +\-\-\ file6\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file4
  68. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  69. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ /dir3
  70. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ |
  71. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ +\-\-\ file5
  72. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |
  73. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\-\-\ file6
  74. \f[]
  75. .fi
  76. .PP
  77. mergerfs does \f[B]not\f[] support the copy\-on\-write (CoW) behavior
  78. found in \f[B]aufs\f[] and \f[B]overlayfs\f[].
  79. You can \f[B]not\f[] mount a read\-only filesystem and write to it.
  80. However, mergerfs will ignore read\-only drives when creating new files
  81. so you can mix read\-write and read\-only drives.
  82. It also does \f[B]not\f[] split data across drives.
  83. It is not RAID0 / striping.
  84. It is simply a union.
  85. .SH OPTIONS
  86. .SS mount options
  87. .IP \[bu] 2
  88. \f[B]allow_other\f[]: A libfuse option which allows users besides the
  89. one which ran mergerfs to see the filesystem.
  90. This is required for most use\-cases.
  91. .IP \[bu] 2
  92. \f[B]minfreespace=SIZE\f[]: The minimum space value used for creation
  93. policies.
  94. Understands \[aq]K\[aq], \[aq]M\[aq], and \[aq]G\[aq] to represent
  95. kilobyte, megabyte, and gigabyte respectively.
  96. (default: 4G)
  97. .IP \[bu] 2
  98. \f[B]moveonenospc=BOOL\f[]: When enabled if a \f[B]write\f[] fails with
  99. \f[B]ENOSPC\f[] or \f[B]EDQUOT\f[] a scan of all drives will be done
  100. looking for the drive with the most free space which is at least the
  101. size of the file plus the amount which failed to write.
  102. An attempt to move the file to that drive will occur (keeping all
  103. metadata possible) and if successful the original is unlinked and the
  104. write retried.
  105. (default: false)
  106. .IP \[bu] 2
  107. \f[B]use_ino\f[]: Causes mergerfs to supply file/directory inodes rather
  108. than libfuse.
  109. While not a default it is recommended it be enabled so that linked files
  110. share the same inode value.
  111. .IP \[bu] 2
  112. \f[B]dropcacheonclose=BOOL\f[]: When a file is requested to be closed
  113. call \f[C]posix_fadvise\f[] on it first to instruct the kernel that we
  114. no longer need the data and it can drop its cache.
  115. Recommended when \f[B]cache.files=partial|full|auto\-full\f[] to limit
  116. double caching.
  117. (default: false)
  118. .IP \[bu] 2
  119. \f[B]symlinkify=BOOL\f[]: When enabled and a file is not writable and
  120. its mtime or ctime is older than \f[B]symlinkify_timeout\f[] files will
  121. be reported as symlinks to the original files.
  122. Please read more below before using.
  123. (default: false)
  124. .IP \[bu] 2
  125. \f[B]symlinkify_timeout=INT\f[]: Time to wait, in seconds, to activate
  126. the \f[B]symlinkify\f[] behavior.
  127. (default: 3600)
  128. .IP \[bu] 2
  129. \f[B]nullrw=BOOL\f[]: Turns reads and writes into no\-ops.
  130. The request will succeed but do nothing.
  131. Useful for benchmarking mergerfs.
  132. (default: false)
  133. .IP \[bu] 2
  134. \f[B]ignorepponrename=BOOL\f[]: Ignore path preserving on rename.
  135. Typically rename and link act differently depending on the policy of
  136. \f[C]create\f[] (read below).
  137. Enabling this will cause rename and link to always use the non\-path
  138. preserving behavior.
  139. This means files, when renamed or linked, will stay on the same drive.
  140. (default: false)
  141. .IP \[bu] 2
  142. \f[B]security_capability=BOOL\f[]: If false return ENOATTR when xattr
  143. security.capability is queried.
  144. (default: true)
  145. .IP \[bu] 2
  146. \f[B]xattr=passthrough|noattr|nosys\f[]: Runtime control of xattrs.
  147. Default is to passthrough xattr requests.
  148. \[aq]noattr\[aq] will short circuit as if nothing exists.
  149. \[aq]nosys\[aq] will respond with ENOSYS as if xattrs are not supported
  150. or disabled.
  151. (default: passthrough)
  152. .IP \[bu] 2
  153. \f[B]link_cow=BOOL\f[]: When enabled if a regular file is opened which
  154. has a link count > 1 it will copy the file to a temporary file and
  155. rename over the original.
  156. Breaking the link and providing a basic copy\-on\-write function similar
  157. to cow\-shell.
  158. (default: false)
  159. .IP \[bu] 2
  160. \f[B]statfs=base|full\f[]: Controls how statfs works.
  161. \[aq]base\[aq] means it will always use all branches in statfs
  162. calculations.
  163. \[aq]full\[aq] is in effect path preserving and only includes drives
  164. where the path exists.
  165. (default: base)
  166. .IP \[bu] 2
  167. \f[B]statfs_ignore=none|ro|nc\f[]: \[aq]ro\[aq] will cause statfs
  168. calculations to ignore available space for branches mounted or tagged as
  169. \[aq]read\-only\[aq] or \[aq]no create\[aq].
  170. \[aq]nc\[aq] will ignore available space for branches tagged as \[aq]no
  171. create\[aq].
  172. (default: none)
  173. .IP \[bu] 2
  174. \f[B]posix_acl=BOOL\f[]: Enable POSIX ACL support (if supported by
  175. kernel and underlying filesystem).
  176. (default: false)
  177. .IP \[bu] 2
  178. \f[B]async_read=BOOL\f[]: Perform reads asynchronously.
  179. If disabled or unavailable the kernel will ensure there is at most one
  180. pending read request per file handle and will attempt to order requests
  181. by offset.
  182. (default: true)
  183. .IP \[bu] 2
  184. \f[B]fuse_msg_size=INT\f[]: Set the max number of pages per FUSE
  185. message.
  186. Only available on Linux >= 4.20 and ignored otherwise.
  187. (min: 1; max: 256; default: 256)
  188. .IP \[bu] 2
  189. \f[B]threads=INT\f[]: Number of threads to use in multithreaded mode.
  190. When set to zero it will attempt to discover and use the number of
  191. logical cores.
  192. If the lookup fails it will fall back to using 4.
  193. If the thread count is set negative it will look up the number of cores
  194. then divide by the absolute value.
  195. ie.
  196. threads=\-2 on an 8 core machine will result in 8 / 2 = 4 threads.
  197. There will always be at least 1 thread.
  198. NOTE: higher number of threads increases parallelism but usually
  199. decreases throughput.
  200. (default: 0)
  201. .IP \[bu] 2
  202. \f[B]fsname=STR\f[]: Sets the name of the filesystem as seen in
  203. \f[B]mount\f[], \f[B]df\f[], etc.
  204. Defaults to a list of the source paths concatenated together with the
  205. longest common prefix removed.
  206. .IP \[bu] 2
  207. \f[B]func.FUNC=POLICY\f[]: Sets the specific FUSE function\[aq]s 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 in
  212. the provided category.
  213. See POLICIES section for defaults.
  214. Example: \f[B]category.create=mfs\f[]
  215. .IP \[bu] 2
  216. \f[B]cache.open=INT\f[]: \[aq]open\[aq] policy cache timeout in seconds.
  217. (default: 0)
  218. .IP \[bu] 2
  219. \f[B]cache.statfs=INT\f[]: \[aq]statfs\[aq] cache timeout in seconds.
  220. (default: 0)
  221. .IP \[bu] 2
  222. \f[B]cache.attr=INT\f[]: File attribute cache timeout in seconds.
  223. (default: 1)
  224. .IP \[bu] 2
  225. \f[B]cache.entry=INT\f[]: File name lookup cache timeout in seconds.
  226. (default: 1)
  227. .IP \[bu] 2
  228. \f[B]cache.negative_entry=INT\f[]: Negative file name lookup cache
  229. timeout in seconds.
  230. (default: 0)
  231. .IP \[bu] 2
  232. \f[B]cache.files=libfuse|off|partial|full|auto\-full\f[]: File page
  233. caching mode (default: libfuse)
  234. .IP \[bu] 2
  235. \f[B]cache.writeback=BOOL\f[]: Enable kernel writeback caching (default:
  236. false)
  237. .IP \[bu] 2
  238. \f[B]cache.symlinks=BOOL\f[]: Cache symlinks (if supported by kernel)
  239. (default: false)
  240. .IP \[bu] 2
  241. \f[B]cache.readdir=BOOL\f[]: Cache readdir (if supported by kernel)
  242. (default: false)
  243. .IP \[bu] 2
  244. \f[B]direct_io\f[]: deprecated \- Bypass page cache.
  245. Use \f[C]cache.files=off\f[] instead.
  246. (default: false)
  247. .IP \[bu] 2
  248. \f[B]kernel_cache\f[]: deprecated \- Do not invalidate data cache on
  249. file open.
  250. Use \f[C]cache.files=full\f[] instead.
  251. (default: false)
  252. .IP \[bu] 2
  253. \f[B]auto_cache\f[]: deprecated \- Invalidate data cache if file mtime
  254. or size change.
  255. Use \f[C]cache.files=auto\-full\f[] instead.
  256. (default: false)
  257. .IP \[bu] 2
  258. \f[B]async_read\f[]: deprecated \- Perform reads asynchronously.
  259. Use \f[C]async_read=true\f[] instead.
  260. .IP \[bu] 2
  261. \f[B]sync_read\f[]: deprecated \- Perform reads synchronously.
  262. Use \f[C]async_read=false\f[] instead.
  263. .PP
  264. \f[B]NOTE:\f[] Options are evaluated in the order listed so if the
  265. options are \f[B]func.rmdir=rand,category.action=ff\f[] the
  266. \f[B]action\f[] category setting will override the \f[B]rmdir\f[]
  267. setting.
  268. .SS Value Types
  269. .IP \[bu] 2
  270. BOOL = \[aq]true\[aq] | \[aq]false\[aq]
  271. .IP \[bu] 2
  272. INT = [0,MAX_INT]
  273. .IP \[bu] 2
  274. SIZE = \[aq]NNM\[aq]; NN = INT, M = \[aq]K\[aq] | \[aq]M\[aq] |
  275. \[aq]G\[aq] | \[aq]T\[aq]
  276. .IP \[bu] 2
  277. STR = string
  278. .IP \[bu] 2
  279. FUNC = FUSE function
  280. .IP \[bu] 2
  281. CATEGORY = FUSE function category
  282. .IP \[bu] 2
  283. POLICY = mergerfs function policy
  284. .SS branches
  285. .PP
  286. The \[aq]branches\[aq] (formerly \[aq]srcmounts\[aq]) argument is a
  287. colon (\[aq]:\[aq]) delimited list of paths to be pooled together.
  288. It does not matter if the paths are on the same or different drives nor
  289. does it matter the filesystem.
  290. Used and available space will not be duplicated for paths on the same
  291. device and any features which aren\[aq]t supported by the underlying
  292. filesystem (such as file attributes or extended attributes) will return
  293. the appropriate errors.
  294. .PP
  295. To make it easier to include multiple branches mergerfs supports
  296. globbing (http://linux.die.net/man/7/glob).
  297. \f[B]The globbing tokens MUST be escaped when using via the shell else
  298. the shell itself will apply the glob itself.\f[]
  299. .PP
  300. Each branch can have a suffix of \f[C]=RW\f[] (read / write),
  301. \f[C]=RO\f[] (read\-only), or \f[C]=NC\f[] (no create).
  302. These suffixes work with globs as well and will apply to each path
  303. found.
  304. \f[C]RW\f[] is the default behavior and those paths will be eligible for
  305. all policy categories.
  306. \f[C]RO\f[] will exclude those paths from \f[C]create\f[] and
  307. \f[C]action\f[] policies (just as a filesystem being mounted \f[C]ro\f[]
  308. would).
  309. \f[C]NC\f[] will exclude those paths from \f[C]create\f[] policies (you
  310. can\[aq]t create but you can change / delete).
  311. .IP
  312. .nf
  313. \f[C]
  314. #\ mergerfs\ \-o\ allow_other,use_ino\ /mnt/disk\\*:/mnt/cdrom\ /media/drives
  315. \f[]
  316. .fi
  317. .PP
  318. The above line will use all mount points in /mnt prefixed with
  319. \f[B]disk\f[] and the \f[B]cdrom\f[].
  320. .PP
  321. To have the pool mounted at boot or otherwise accessible from related
  322. tools use \f[B]/etc/fstab\f[].
  323. .IP
  324. .nf
  325. \f[C]
  326. #\ <file\ system>\ \ \ \ \ \ \ \ <mount\ point>\ \ <type>\ \ \ \ <options>\ \ \ \ \ \ \ \ \ \ \ \ \ <dump>\ \ <pass>
  327. /mnt/disk*:/mnt/cdrom\ \ /media/drives\ \ mergerfs\ \ allow_other,use_ino\ \ \ 0\ \ \ \ \ \ \ 0
  328. \f[]
  329. .fi
  330. .PP
  331. \f[B]NOTE:\f[] the globbing is done at mount or xattr update time (see
  332. below).
  333. If a new directory is added matching the glob after the fact it will not
  334. be automatically included.
  335. .PP
  336. \f[B]NOTE:\f[] for mounting via \f[B]fstab\f[] to work you must have
  337. \f[B]mount.fuse\f[] installed.
  338. For Ubuntu/Debian it is included in the \f[B]fuse\f[] package.
  339. .SS fuse_msg_size
  340. .PP
  341. FUSE applications communicate with the kernel over a special character
  342. device: \f[C]/dev/fuse\f[].
  343. A large portion of the overhead associated with FUSE is the cost of
  344. going back and forth from user space and kernel space over that device.
  345. Generally speaking the fewer trips needed the better the performance
  346. will be.
  347. Reducing the number of trips can be done a number of ways.
  348. Kernel level caching and increasing message sizes being two significant
  349. ones.
  350. When it comes to reads and writes if the message size is doubled the
  351. number of trips are approximately halved.
  352. .PP
  353. In Linux 4.20 a new feature was added allowing the negotiation of the
  354. max message size.
  355. Since the size is in multiples of
  356. pages (https://en.wikipedia.org/wiki/Page_(computer_memory)) the feature
  357. is called \f[C]max_pages\f[].
  358. There is a maximum \f[C]max_pages\f[] value of 256 (1MiB) and minimum of
  359. 1 (4KiB).
  360. The default used by Linux >=4.20, and hardcoded value used before 4.20,
  361. is 32 (128KiB).
  362. In mergerfs its referred to as \f[C]fuse_msg_size\f[] to make it clear
  363. what it impacts and provide some abstraction.
  364. .PP
  365. Since there should be no downsides to increasing \f[C]fuse_msg_size\f[]
  366. / \f[C]max_pages\f[], outside a minor bump in RAM usage due to larger
  367. message buffers, mergerfs defaults the value to 256.
  368. On kernels before 4.20 the value has no effect.
  369. The reason the value is configurable is to enable experimentation and
  370. benchmarking.
  371. See the BENCHMARKING section for examples.
  372. .SS symlinkify
  373. .PP
  374. Due to the levels of indirection introduced by mergerfs and the
  375. underlying technology FUSE there can be varying levels of performance
  376. degradation.
  377. This feature will turn non\-directories which are not writable into
  378. symlinks to the original file found by the \f[C]readlink\f[] policy
  379. after the mtime and ctime are older than the timeout.
  380. .PP
  381. \f[B]WARNING:\f[] The current implementation has a known issue in which
  382. if the file is open and being used when the file is converted to a
  383. symlink then the application which has that file open will receive an
  384. error when using it.
  385. This is unlikely to occur in practice but is something to keep in mind.
  386. .PP
  387. \f[B]WARNING:\f[] Some backup solutions, such as CrashPlan, do not
  388. backup the target of a symlink.
  389. If using this feature it will be necessary to point any backup software
  390. to the original drives or configure the software to follow symlinks if
  391. such an option is available.
  392. Alternatively create two mounts.
  393. One for backup and one for general consumption.
  394. .SS nullrw
  395. .PP
  396. Due to how FUSE works there is an overhead to all requests made to a
  397. FUSE filesystem that wouldn\[aq]t exist for an in kernel one.
  398. Meaning that even a simple passthrough will have some slowdown.
  399. However, generally the overhead is minimal in comparison to the cost of
  400. the underlying I/O.
  401. By disabling the underlying I/O we can test the theoretical performance
  402. boundaries.
  403. .PP
  404. By enabling \f[C]nullrw\f[] mergerfs will work as it always does
  405. \f[B]except\f[] that all reads and writes will be no\-ops.
  406. A write will succeed (the size of the write will be returned as if it
  407. were successful) but mergerfs does nothing with the data it was given.
  408. Similarly a read will return the size requested but won\[aq]t touch the
  409. buffer.
  410. .PP
  411. See the BENCHMARKING section for suggestions on how to test.
  412. .SS xattr
  413. .PP
  414. Runtime extended attribute support can be managed via the \f[C]xattr\f[]
  415. option.
  416. By default it will passthrough any xattr calls.
  417. Given xattr support is rarely used and can have significant performance
  418. implications mergerfs allows it to be disabled at runtime.
  419. The performance problems mostly comes when file caching is enabled.
  420. The kernel will send a \f[C]getxattr\f[] for
  421. \f[C]security.capability\f[] \f[I]before every single write\f[].
  422. It doesn\[aq]t cache the responses to any \f[C]getxattr\f[].
  423. This might be addressed in the future but for now mergerfs can really
  424. only offer the following workarounds.
  425. .PP
  426. \f[C]noattr\f[] will cause mergerfs to short circuit all xattr calls and
  427. return ENOATTR where appropriate.
  428. mergerfs still gets all the requests but they will not be forwarded on
  429. to the underlying filesystems.
  430. The runtime control will still function in this mode.
  431. .PP
  432. \f[C]nosys\f[] will cause mergerfs to return ENOSYS for any xattr call.
  433. The difference with \f[C]noattr\f[] is that the kernel will cache this
  434. fact and itself short circuit future calls.
  435. This is more efficient than \f[C]noattr\f[] but will cause mergerfs\[aq]
  436. runtime control via the hidden file to stop working.
  437. .SH FUNCTIONS / POLICIES / CATEGORIES
  438. .PP
  439. The POSIX filesystem API is made up of a number of functions.
  440. \f[B]creat\f[], \f[B]stat\f[], \f[B]chown\f[], etc.
  441. In mergerfs most of the core functions are grouped into 3 categories:
  442. \f[B]action\f[], \f[B]create\f[], and \f[B]search\f[].
  443. These functions and categories can be assigned a policy which dictates
  444. what file or directory is chosen when performing that behavior.
  445. Any policy can be assigned to a function or category though some may not
  446. be very useful in practice.
  447. For instance: \f[B]rand\f[] (random) may be useful for file creation
  448. (create) but could lead to very odd behavior if used for \f[C]chmod\f[]
  449. if there were more than one copy of the file.
  450. .PP
  451. Some functions, listed in the category \f[C]N/A\f[] below, can not be
  452. assigned the normal policies.
  453. All functions which work on file handles use the handle which was
  454. acquired by \f[C]open\f[] or \f[C]create\f[].
  455. \f[C]readdir\f[] has no real need for a policy given the purpose is
  456. merely to return a list of entries in a directory.
  457. \f[C]statfs\f[]\[aq]s behavior can be modified via other options.
  458. That said many times the current FUSE kernel driver will not always
  459. provide the file handle when a client calls \f[C]fgetattr\f[],
  460. \f[C]fchown\f[], \f[C]fchmod\f[], \f[C]futimens\f[], \f[C]ftruncate\f[],
  461. etc.
  462. This means it will call the regular, path based, versions.
  463. .PP
  464. When using policies which are based on a branch\[aq]s available space
  465. the base path provided is used.
  466. Not the full path to the file in question.
  467. Meaning that sub mounts won\[aq]t be considered in the space
  468. calculations.
  469. The reason is that it doesn\[aq]t really work for non\-path preserving
  470. policies and can lead to non\-obvious behaviors.
  471. .SS Function / Category classifications
  472. .PP
  473. .TS
  474. tab(@);
  475. lw(7.9n) lw(62.1n).
  476. T{
  477. Category
  478. T}@T{
  479. FUSE Functions
  480. T}
  481. _
  482. T{
  483. action
  484. T}@T{
  485. chmod, chown, link, removexattr, rename, rmdir, setxattr, truncate,
  486. unlink, utimens
  487. T}
  488. T{
  489. create
  490. T}@T{
  491. create, mkdir, mknod, symlink
  492. T}
  493. T{
  494. search
  495. T}@T{
  496. access, getattr, getxattr, ioctl (directories), listxattr, open,
  497. readlink
  498. T}
  499. T{
  500. N/A
  501. T}@T{
  502. fchmod, fchown, futimens, ftruncate, fallocate, fgetattr, fsync, ioctl
  503. (files), read, readdir, release, statfs, write, copy_file_range
  504. T}
  505. .TE
  506. .PP
  507. In cases where something may be searched (to confirm a directory exists
  508. across all source mounts) \f[B]getattr\f[] will be used.
  509. .SS Path Preservation
  510. .PP
  511. Policies, as described below, are of two basic types.
  512. \f[C]path\ preserving\f[] and \f[C]non\-path\ preserving\f[].
  513. .PP
  514. All policies which start with \f[C]ep\f[] (\f[B]epff\f[],
  515. \f[B]eplfs\f[], \f[B]eplus\f[], \f[B]epmfs\f[], \f[B]eprand\f[]) are
  516. \f[C]path\ preserving\f[].
  517. \f[C]ep\f[] stands for \f[C]existing\ path\f[].
  518. .PP
  519. A path preserving policy will only consider drives where the relative
  520. path being accessed already exists.
  521. .PP
  522. When using non\-path preserving policies paths will be cloned to target
  523. drives as necessary.
  524. .SS Filters
  525. .PP
  526. Policies basically search branches and create a list of files / paths
  527. for functions to work on.
  528. The policy is responsible for filtering and sorting.
  529. The policy type defines the sorting but filtering is mostly uniform as
  530. described below.
  531. .IP \[bu] 2
  532. No \f[B]search\f[] policies filter.
  533. .IP \[bu] 2
  534. All \f[B]action\f[] policies will filter out branches which are mounted
  535. \f[B]read\-only\f[] or tagged as \f[B]RO (read\-only)\f[].
  536. .IP \[bu] 2
  537. All \f[B]create\f[] policies will filter out branches which are mounted
  538. \f[B]read\-only\f[], tagged \f[B]RO (read\-only)\f[] or \f[B]NC (no
  539. create)\f[], or has available space less than \f[C]minfreespace\f[].
  540. .PP
  541. If all branches are filtered an error will be returned.
  542. Typically \f[B]EROFS\f[] or \f[B]ENOSPC\f[] depending on the reasons.
  543. .SS Policy descriptions
  544. .PP
  545. .TS
  546. tab(@);
  547. lw(16.6n) lw(53.4n).
  548. T{
  549. Policy
  550. T}@T{
  551. Description
  552. T}
  553. _
  554. T{
  555. all
  556. T}@T{
  557. Search category: same as \f[B]epall\f[].
  558. Action category: same as \f[B]epall\f[].
  559. Create category: for \f[B]mkdir\f[], \f[B]mknod\f[], and
  560. \f[B]symlink\f[] it will apply to all branches.
  561. \f[B]create\f[] works like \f[B]ff\f[].
  562. T}
  563. T{
  564. epall (existing path, all)
  565. T}@T{
  566. Search category: same as \f[B]epff\f[] (but more expensive because it
  567. doesn\[aq]t stop after finding a valid branch).
  568. Action category: apply to all found.
  569. Create category: for \f[B]mkdir\f[], \f[B]mknod\f[], and
  570. \f[B]symlink\f[] it will apply to all found.
  571. \f[B]create\f[] works like \f[B]epff\f[] (but more expensive because it
  572. doesn\[aq]t stop after finding a valid branch).
  573. T}
  574. T{
  575. epff (existing path, first found)
  576. T}@T{
  577. Given the order of the branches, as defined at mount time or configured
  578. at runtime, act on the first one found where the relative path exists.
  579. T}
  580. T{
  581. eplfs (existing path, least free space)
  582. T}@T{
  583. Of all the branches on which the relative path exists choose the drive
  584. with the least free space.
  585. T}
  586. T{
  587. eplus (existing path, least used space)
  588. T}@T{
  589. Of all the branches on which the relative path exists choose the drive
  590. with the least used space.
  591. T}
  592. T{
  593. epmfs (existing path, most free space)
  594. T}@T{
  595. Of all the branches on which the relative path exists choose the drive
  596. with the most free space.
  597. T}
  598. T{
  599. eprand (existing path, random)
  600. T}@T{
  601. Calls \f[B]epall\f[] and then randomizes.
  602. Returns 1.
  603. T}
  604. T{
  605. erofs
  606. T}@T{
  607. Exclusively return \f[B]\-1\f[] with \f[B]errno\f[] set to
  608. \f[B]EROFS\f[] (read\-only filesystem).
  609. T}
  610. T{
  611. ff (first found)
  612. T}@T{
  613. Search category: same as \f[B]epff\f[].
  614. Action category: same as \f[B]epff\f[].
  615. Create category: Given the order of the drives, as defined at mount time
  616. or configured at runtime, act on the first one found.
  617. T}
  618. T{
  619. lfs (least free space)
  620. T}@T{
  621. Search category: same as \f[B]eplfs\f[].
  622. Action category: same as \f[B]eplfs\f[].
  623. Create category: Pick the drive with the least available free space.
  624. T}
  625. T{
  626. lus (least used space)
  627. T}@T{
  628. Search category: same as \f[B]eplus\f[].
  629. Action category: same as \f[B]eplus\f[].
  630. Create category: Pick the drive with the least used space.
  631. T}
  632. T{
  633. mfs (most free space)
  634. T}@T{
  635. Search category: same as \f[B]epmfs\f[].
  636. Action category: same as \f[B]epmfs\f[].
  637. Create category: Pick the drive with the most available free space.
  638. T}
  639. T{
  640. newest
  641. T}@T{
  642. Pick the file / directory with the largest mtime.
  643. T}
  644. T{
  645. rand (random)
  646. T}@T{
  647. Calls \f[B]all\f[] and then randomizes.
  648. Returns 1.
  649. T}
  650. .TE
  651. .PP
  652. \f[B]NOTE:\f[] If you are using an underlying filesystem that reserves
  653. blocks such as ext2, ext3, or ext4 be aware that mergerfs respects the
  654. reservation by using \f[C]f_bavail\f[] (number of free blocks for
  655. unprivileged users) rather than \f[C]f_bfree\f[] (number of free blocks)
  656. in policy calculations.
  657. \f[B]df\f[] does NOT use \f[C]f_bavail\f[], it uses \f[C]f_bfree\f[], so
  658. direct comparisons between \f[B]df\f[] output and mergerfs\[aq] policies
  659. is not appropriate.
  660. .SS Defaults
  661. .PP
  662. .TS
  663. tab(@);
  664. l l.
  665. T{
  666. Category
  667. T}@T{
  668. Policy
  669. T}
  670. _
  671. T{
  672. action
  673. T}@T{
  674. epall
  675. T}
  676. T{
  677. create
  678. T}@T{
  679. epmfs
  680. T}
  681. T{
  682. search
  683. T}@T{
  684. ff
  685. T}
  686. .TE
  687. .SS ioctl
  688. .PP
  689. When \f[C]ioctl\f[] is used with an open file then it will use the file
  690. handle which was created at the original \f[C]open\f[] call.
  691. However, when using \f[C]ioctl\f[] with a directory mergerfs will use
  692. the \f[C]open\f[] policy to find the directory to act on.
  693. .SS unlink
  694. .PP
  695. In FUSE there is an opaque "file handle" which is created by
  696. \f[C]open\f[], \f[C]create\f[], or \f[C]opendir\f[], passed to the
  697. kernel, and then is passed back to the FUSE userland application by the
  698. kernel.
  699. Unfortunately, the FUSE kernel driver does not always send the file
  700. handle when it theoretically could/should.
  701. This complicates certain behaviors / workflows particularly in the high
  702. level API.
  703. As a result mergerfs is currently doing a few hacky things.
  704. .PP
  705. libfuse2 and libfuse3, when using the high level API, will rename names
  706. to \f[C]\&.fuse_hiddenXXXXXX\f[] if the file is open when unlinked or
  707. renamed over.
  708. It does this so the file is still available when a request referencing
  709. the now missing file is made.
  710. This file however keeps a \f[C]rmdir\f[] from succeeding and can be
  711. picked up by software reading directories.
  712. .PP
  713. The change mergerfs has done is that if a file is open when an unlink or
  714. rename happens it will open the file and keep it open till closed by all
  715. those who opened it prior.
  716. When a request comes in referencing that file and it doesn\[aq]t include
  717. a file handle it will instead use the file handle created at
  718. unlink/rename time.
  719. .PP
  720. This won\[aq]t result in technically proper behavior but close enough
  721. for many usecases.
  722. .PP
  723. The plan is to rewrite mergerfs to use the low level API so these
  724. invasive libfuse changes are no longer necessary.
  725. .SS rename & link
  726. .PP
  727. \f[B]NOTE:\f[] If you\[aq]re receiving errors from software when files
  728. are moved / renamed / linked then you should consider changing the
  729. create policy to one which is \f[B]not\f[] path preserving, enabling
  730. \f[C]ignorepponrename\f[], or contacting the author of the offending
  731. software and requesting that \f[C]EXDEV\f[] be properly handled.
  732. .PP
  733. \f[C]rename\f[] and \f[C]link\f[] are tricky functions in a union
  734. filesystem.
  735. \f[C]rename\f[] only works within a single filesystem or device.
  736. If a rename can\[aq]t be done atomically due to the source and
  737. destination paths existing on different mount points it will return
  738. \f[B]\-1\f[] with \f[B]errno = EXDEV\f[] (cross device).
  739. So if a \f[C]rename\f[]\[aq]s source and target are on different drives
  740. within the pool it creates an issue.
  741. .PP
  742. Originally mergerfs would return EXDEV whenever a rename was requested
  743. which was cross directory in any way.
  744. This made the code simple and was technically compliant with POSIX
  745. requirements.
  746. However, many applications fail to handle EXDEV at all and treat it as a
  747. normal error or otherwise handle it poorly.
  748. Such apps include: gvfsd\-fuse v1.20.3 and prior, Finder / CIFS/SMB
  749. client in Apple OSX 10.9+, NZBGet, Samba\[aq]s recycling bin feature.
  750. .PP
  751. As a result a compromise was made in order to get most software to work
  752. while still obeying mergerfs\[aq] policies.
  753. Below is the basic logic.
  754. .IP \[bu] 2
  755. If using a \f[B]create\f[] policy which tries to preserve directory
  756. paths (epff,eplfs,eplus,epmfs)
  757. .IP \[bu] 2
  758. Using the \f[B]rename\f[] policy get the list of files to rename
  759. .IP \[bu] 2
  760. For each file attempt rename:
  761. .RS 2
  762. .IP \[bu] 2
  763. If failure with ENOENT run \f[B]create\f[] policy
  764. .IP \[bu] 2
  765. If create policy returns the same drive as currently evaluating then
  766. clone the path
  767. .IP \[bu] 2
  768. Re\-attempt rename
  769. .RE
  770. .IP \[bu] 2
  771. If \f[B]any\f[] of the renames succeed the higher level rename is
  772. considered a success
  773. .IP \[bu] 2
  774. If \f[B]no\f[] renames succeed the first error encountered will be
  775. returned
  776. .IP \[bu] 2
  777. On success:
  778. .RS 2
  779. .IP \[bu] 2
  780. Remove the target from all drives with no source file
  781. .IP \[bu] 2
  782. Remove the source from all drives which failed to rename
  783. .RE
  784. .IP \[bu] 2
  785. If using a \f[B]create\f[] policy which does \f[B]not\f[] try to
  786. preserve directory paths
  787. .IP \[bu] 2
  788. Using the \f[B]rename\f[] policy get the list of files to rename
  789. .IP \[bu] 2
  790. Using the \f[B]getattr\f[] policy get the target path
  791. .IP \[bu] 2
  792. For each file attempt rename:
  793. .RS 2
  794. .IP \[bu] 2
  795. If the source drive != target drive:
  796. .IP \[bu] 2
  797. Clone target path from target drive to source drive
  798. .IP \[bu] 2
  799. Rename
  800. .RE
  801. .IP \[bu] 2
  802. If \f[B]any\f[] of the renames succeed the higher level rename is
  803. considered a success
  804. .IP \[bu] 2
  805. If \f[B]no\f[] renames succeed the first error encountered will be
  806. returned
  807. .IP \[bu] 2
  808. On success:
  809. .RS 2
  810. .IP \[bu] 2
  811. Remove the target from all drives with no source file
  812. .IP \[bu] 2
  813. Remove the source from all drives which failed to rename
  814. .RE
  815. .PP
  816. The the removals are subject to normal entitlement checks.
  817. .PP
  818. The above behavior will help minimize the likelihood of EXDEV being
  819. returned but it will still be possible.
  820. .PP
  821. \f[B]link\f[] uses the same strategy but without the removals.
  822. .SS readdir
  823. .PP
  824. readdir (http://linux.die.net/man/3/readdir) is different from all other
  825. filesystem functions.
  826. While it could have its own set of policies to tweak its behavior at
  827. this time it provides a simple union of files and directories found.
  828. Remember that any action or information queried about these files and
  829. directories come from the respective function.
  830. For instance: an \f[B]ls\f[] is a \f[B]readdir\f[] and for each
  831. file/directory returned \f[B]getattr\f[] is called.
  832. Meaning the policy of \f[B]getattr\f[] is responsible for choosing the
  833. file/directory which is the source of the metadata you see in an
  834. \f[B]ls\f[].
  835. .SS statfs / statvfs
  836. .PP
  837. statvfs (http://linux.die.net/man/2/statvfs) normalizes the source
  838. drives based on the fragment size and sums the number of adjusted blocks
  839. and inodes.
  840. This means you will see the combined space of all sources.
  841. Total, used, and free.
  842. The sources however are dedupped based on the drive so multiple sources
  843. on the same drive will not result in double counting its space.
  844. Filesystems mounted further down the tree of the branch will not be
  845. included when checking the mount\[aq]s stats.
  846. .PP
  847. The options \f[C]statfs\f[] and \f[C]statfs_ignore\f[] can be used to
  848. modify \f[C]statfs\f[] behavior.
  849. .SH BUILDING
  850. .PP
  851. \f[B]NOTE:\f[] Prebuilt packages can be found at:
  852. https://github.com/trapexit/mergerfs/releases
  853. .PP
  854. First get the code from github (https://github.com/trapexit/mergerfs).
  855. .IP
  856. .nf
  857. \f[C]
  858. $\ git\ clone\ https://github.com/trapexit/mergerfs.git
  859. $\ #\ or
  860. $\ wget\ https://github.com/trapexit/mergerfs/releases/download/<ver>/mergerfs\-<ver>.tar.gz
  861. \f[]
  862. .fi
  863. .SS Debian / Ubuntu
  864. .IP
  865. .nf
  866. \f[C]
  867. $\ cd\ mergerfs
  868. $\ sudo\ tools/install\-build\-pkgs
  869. $\ make\ deb
  870. $\ sudo\ dpkg\ \-i\ ../mergerfs_version_arch.deb
  871. \f[]
  872. .fi
  873. .SS RHEL / CentOS /Fedora
  874. .IP
  875. .nf
  876. \f[C]
  877. $\ su\ \-
  878. #\ cd\ mergerfs
  879. #\ tools/install\-build\-pkgs
  880. #\ make\ rpm
  881. #\ rpm\ \-i\ rpmbuild/RPMS/<arch>/mergerfs\-<verion>.<arch>.rpm
  882. \f[]
  883. .fi
  884. .SS Generically
  885. .PP
  886. Have git, g++, make, python installed.
  887. .IP
  888. .nf
  889. \f[C]
  890. $\ cd\ mergerfs
  891. $\ make
  892. $\ sudo\ make\ install
  893. \f[]
  894. .fi
  895. .SS Build options
  896. .IP
  897. .nf
  898. \f[C]
  899. $\ make\ help
  900. usage:\ make
  901. make\ USE_XATTR=0\ \ \ \ \ \ \-\ build\ program\ without\ xattrs\ functionality
  902. make\ STATIC=1\ \ \ \ \ \ \ \ \ \-\ build\ static\ binary
  903. make\ LTO=1\ \ \ \ \ \ \ \ \ \ \ \ \-\ build\ with\ link\ time\ optimization
  904. \f[]
  905. .fi
  906. .SH RUNTIME CONFIG
  907. .SS .mergerfs pseudo file
  908. .IP
  909. .nf
  910. \f[C]
  911. <mountpoint>/.mergerfs
  912. \f[]
  913. .fi
  914. .PP
  915. There is a pseudo file available at the mount point which allows for the
  916. runtime modification of certain \f[B]mergerfs\f[] options.
  917. The file will not show up in \f[B]readdir\f[] but can be
  918. \f[B]stat\f[]\[aq]ed and manipulated via
  919. {list,get,set}xattrs (http://linux.die.net/man/2/listxattr) calls.
  920. .PP
  921. Any changes made at runtime are \f[B]not\f[] persisted.
  922. If you wish for values to persist they must be included as options
  923. wherever you configure the mounting of mergerfs (/etc/fstab).
  924. .SS Keys
  925. .PP
  926. Use \f[C]xattr\ \-l\ /mountpoint/.mergerfs\f[] to see all supported
  927. keys.
  928. Some are informational and therefore read\-only.
  929. \f[C]setxattr\f[] will return EINVAL on read\-only keys.
  930. .SS Values
  931. .PP
  932. Same as the command line.
  933. .SS user.mergerfs.branches
  934. .PP
  935. \f[B]NOTE:\f[] formerly \f[C]user.mergerfs.srcmounts\f[] but said key is
  936. still supported.
  937. .PP
  938. Used to query or modify the list of branches.
  939. When modifying there are several shortcuts to easy manipulation of the
  940. list.
  941. .PP
  942. .TS
  943. tab(@);
  944. l l.
  945. T{
  946. Value
  947. T}@T{
  948. Description
  949. T}
  950. _
  951. T{
  952. [list]
  953. T}@T{
  954. set
  955. T}
  956. T{
  957. +<[list]
  958. T}@T{
  959. prepend
  960. T}
  961. T{
  962. +>[list]
  963. T}@T{
  964. append
  965. T}
  966. T{
  967. \-[list]
  968. T}@T{
  969. remove all values provided
  970. T}
  971. T{
  972. \-<
  973. T}@T{
  974. remove first in list
  975. T}
  976. T{
  977. \->
  978. T}@T{
  979. remove last in list
  980. T}
  981. .TE
  982. .PP
  983. \f[C]xattr\ \-w\ user.mergerfs.branches\ +</mnt/drive3\ /mnt/pool/.mergerfs\f[]
  984. .PP
  985. The \f[C]=NC\f[], \f[C]=RO\f[], \f[C]=RW\f[] syntax works just as on the
  986. command line.
  987. .SS Example
  988. .IP
  989. .nf
  990. \f[C]
  991. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-l\ .mergerfs
  992. user.mergerfs.branches:\ /mnt/a=RW:/mnt/b=RW
  993. user.mergerfs.minfreespace:\ 4294967295
  994. user.mergerfs.moveonenospc:\ false
  995. \&...
  996. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.category.search\ .mergerfs
  997. ff
  998. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.category.search\ newest\ .mergerfs
  999. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.category.search\ .mergerfs
  1000. newest
  1001. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ +/mnt/c\ .mergerfs
  1002. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  1003. /mnt/a:/mnt/b:/mnt/c
  1004. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ =/mnt/c\ .mergerfs
  1005. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  1006. /mnt/c
  1007. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-w\ user.mergerfs.branches\ \[aq]+</mnt/a:/mnt/b\[aq]\ .mergerfs
  1008. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.branches\ .mergerfs
  1009. /mnt/a:/mnt/b:/mnt/c
  1010. \f[]
  1011. .fi
  1012. .SS file / directory xattrs
  1013. .PP
  1014. While they won\[aq]t show up when using
  1015. listxattr (http://linux.die.net/man/2/listxattr) \f[B]mergerfs\f[]
  1016. offers a number of special xattrs to query information about the files
  1017. served.
  1018. To access the values you will need to issue a
  1019. getxattr (http://linux.die.net/man/2/getxattr) for one of the following:
  1020. .IP \[bu] 2
  1021. \f[B]user.mergerfs.basepath\f[]: the base mount point for the file given
  1022. the current getattr policy
  1023. .IP \[bu] 2
  1024. \f[B]user.mergerfs.relpath\f[]: the relative path of the file from the
  1025. perspective of the mount point
  1026. .IP \[bu] 2
  1027. \f[B]user.mergerfs.fullpath\f[]: the full path of the original file
  1028. given the getattr policy
  1029. .IP \[bu] 2
  1030. \f[B]user.mergerfs.allpaths\f[]: a NUL (\[aq]\[aq]) separated list of
  1031. full paths to all files found
  1032. .IP
  1033. .nf
  1034. \f[C]
  1035. [trapexit:/mnt/mergerfs]\ $\ ls
  1036. A\ B\ C
  1037. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.fullpath\ A
  1038. /mnt/a/full/path/to/A
  1039. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.basepath\ A
  1040. /mnt/a
  1041. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.relpath\ A
  1042. /full/path/to/A
  1043. [trapexit:/mnt/mergerfs]\ $\ xattr\ \-p\ user.mergerfs.allpaths\ A\ |\ tr\ \[aq]\\0\[aq]\ \[aq]\\n\[aq]
  1044. /mnt/a/full/path/to/A
  1045. /mnt/b/full/path/to/A
  1046. \f[]
  1047. .fi
  1048. .SH UPGRADE
  1049. .PP
  1050. mergerfs can be upgraded live by mounting on top of the previous
  1051. version.
  1052. Simply install the new version of mergerfs and follow the instructions
  1053. below.
  1054. .PP
  1055. Add \f[C]nonempty\f[] to your mergerfs option list and call mergerfs
  1056. again or if using \f[C]/etc/fstab\f[] call for it to mount again.
  1057. Existing open files and such will continue to work fine though they
  1058. won\[aq]t see runtime changes since any such change would be the new
  1059. mount.
  1060. If you plan on changing settings with the new mount you should / could
  1061. apply those before mounting the new version.
  1062. .IP
  1063. .nf
  1064. \f[C]
  1065. $\ sudo\ mount\ /mnt/mergerfs
  1066. $\ mount\ |\ grep\ mergerfs
  1067. media\ on\ /mnt/mergerfs\ type\ fuse.mergerfs\ (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
  1068. media\ on\ /mnt/mergerfs\ type\ fuse.mergerfs\ (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
  1069. \f[]
  1070. .fi
  1071. .SH TOOLING
  1072. .IP \[bu] 2
  1073. https://github.com/trapexit/mergerfs\-tools
  1074. .IP \[bu] 2
  1075. mergerfs.ctl: A tool to make it easier to query and configure mergerfs
  1076. at runtime
  1077. .IP \[bu] 2
  1078. mergerfs.fsck: Provides permissions and ownership auditing and the
  1079. ability to fix them
  1080. .IP \[bu] 2
  1081. mergerfs.dedup: Will help identify and optionally remove duplicate files
  1082. .IP \[bu] 2
  1083. mergerfs.dup: Ensure there are at least N copies of a file across the
  1084. pool
  1085. .IP \[bu] 2
  1086. mergerfs.balance: Rebalance files across drives by moving them from the
  1087. most filled to the least filled
  1088. .IP \[bu] 2
  1089. mergerfs.consolidate: move files within a single mergerfs directory to
  1090. the drive with most free space
  1091. .IP \[bu] 2
  1092. mergerfs.mktrash: Creates FreeDesktop.org Trash specification compatible
  1093. directories on a mergerfs mount
  1094. .IP \[bu] 2
  1095. https://github.com/trapexit/scorch
  1096. .IP \[bu] 2
  1097. scorch: A tool to help discover silent corruption of files and keep
  1098. track of files
  1099. .IP \[bu] 2
  1100. https://github.com/trapexit/bbf
  1101. .IP \[bu] 2
  1102. bbf (bad block finder): a tool to scan for and \[aq]fix\[aq] hard drive
  1103. bad blocks and find the files using those blocks
  1104. .SH CACHING
  1105. .SS page caching
  1106. .PP
  1107. https://en.wikipedia.org/wiki/Page_cache
  1108. .PP
  1109. tl;dr: * cache.files=off: Disables page caching.
  1110. Underlying files cached, mergerfs files are not.
  1111. * cache.files=partial: Enables page caching.
  1112. Underlying files cached, mergerfs files cached while open.
  1113. * cache.files=full: Enables page caching.
  1114. Underlying files cached, mergerfs files cached across opens.
  1115. * cache.files=auto\-full: Enables page caching.
  1116. Underlying files cached, mergerfs files cached across opens if mtime and
  1117. size are unchanged since previous open.
  1118. * cache.files=libfuse: follow traditional libfuse \f[C]direct_io\f[],
  1119. \f[C]kernel_cache\f[], and \f[C]auto_cache\f[] arguments.
  1120. .PP
  1121. FUSE, which mergerfs uses, offers a number of page caching modes.
  1122. mergerfs tries to simplify their use via the \f[C]cache.files\f[]
  1123. option.
  1124. It can and should replace usage of \f[C]direct_io\f[],
  1125. \f[C]kernel_cache\f[], and \f[C]auto_cache\f[].
  1126. .PP
  1127. Due to mergerfs using FUSE and therefore being a userland process
  1128. proxying existing filesystems the kernel will double cache the content
  1129. being read and written through mergerfs.
  1130. Once from the underlying filesystem and once from mergerfs (it sees them
  1131. as two separate entities).
  1132. Using \f[C]cache.files=off\f[] will keep the double caching from
  1133. happening by disabling caching of mergerfs but this has the side effect
  1134. that \f[I]all\f[] read and write calls will be passed to mergerfs which
  1135. may be slower than enabling caching, you lose shared \f[C]mmap\f[]
  1136. support which can affect apps such as rtorrent, and no read\-ahead will
  1137. take place.
  1138. The kernel will still cache the underlying filesystem data but that only
  1139. helps so much given mergerfs will still process all requests.
  1140. .PP
  1141. If you do enable file page caching,
  1142. \f[C]cache.files=partial|full|auto\-full\f[], you should also enable
  1143. \f[C]dropcacheonclose\f[] which will cause mergerfs to instruct the
  1144. kernel to flush the underlying file\[aq]s page cache when the file is
  1145. closed.
  1146. This behavior is the same as the rsync fadvise / drop cache patch and
  1147. Feh\[aq]s nocache project.
  1148. .PP
  1149. If most files are read once through and closed (like media) it is best
  1150. to enable \f[C]dropcacheonclose\f[] regardless of caching mode in order
  1151. to minimize buffer bloat.
  1152. .PP
  1153. It is difficult to balance memory usage, cache bloat & duplication, and
  1154. performance.
  1155. Ideally mergerfs would be able to disable caching for the files it
  1156. reads/writes but allow page caching for itself.
  1157. That would limit the FUSE overhead.
  1158. However, there isn\[aq]t a good way to achieve this.
  1159. It would need to open all files with O_DIRECT which places limitations
  1160. on the what underlying filesystems would be supported and complicates
  1161. the code.
  1162. .PP
  1163. kernel documentation:
  1164. https://www.kernel.org/doc/Documentation/filesystems/fuse\-io.txt
  1165. .SS entry & attribute caching
  1166. .PP
  1167. Given the relatively high cost of FUSE due to the kernel <\-> userspace
  1168. round trips there are kernel side caches for file entries and
  1169. attributes.
  1170. The entry cache limits the \f[C]lookup\f[] calls to mergerfs which ask
  1171. if a file exists.
  1172. The attribute cache limits the need to make \f[C]getattr\f[] calls to
  1173. mergerfs which provide file attributes (mode, size, type, etc.).
  1174. As with the page cache these should not be used if the underlying
  1175. filesystems are being manipulated at the same time as it could lead to
  1176. odd behavior or data corruption.
  1177. The options for setting these are \f[C]cache.entry\f[] and
  1178. \f[C]cache.negative_entry\f[] for the entry cache and
  1179. \f[C]cache.attr\f[] for the attributes cache.
  1180. \f[C]cache.negative_entry\f[] refers to the timeout for negative
  1181. responses to lookups (non\-existent files).
  1182. .SS writeback caching
  1183. .PP
  1184. When \f[C]cache.files\f[] is enabled the default is for it to perform
  1185. writethrough caching.
  1186. This behavior won\[aq]t help improve performance as each write still
  1187. goes one for one through the filesystem.
  1188. By enabling the FUSE writeback cache small writes may be aggregated by
  1189. the kernel and then sent to mergerfs as one larger request.
  1190. This can greatly improve the throughput for apps which write to files
  1191. inefficiently.
  1192. The amount the kernel can aggregate is limited by the size of a FUSE
  1193. message.
  1194. Read the \f[C]fuse_msg_size\f[] section for more details.
  1195. .PP
  1196. There is a small side effect as a result of enabling wrtieback caching.
  1197. Underlying files won\[aq]t ever be opened with O_APPEND or O_WRONLY.
  1198. The former because the kernel then manages append mode and the latter
  1199. because the kernel may request file data from mergerfs to populate the
  1200. write cache.
  1201. The O_APPEND change means that if a file is changed outside of mergerfs
  1202. it could lead to corruption as the kernel won\[aq]t know the end of the
  1203. file has changed.
  1204. That said any time you use caching you should keep from using the same
  1205. file outside of mergerfs at the same time.
  1206. .PP
  1207. Note that if an application is properly sizing writes then writeback
  1208. caching will have little or no effect.
  1209. It will only help with writes of sizes below the FUSE message size (128K
  1210. on older kernels, 1M on newer).
  1211. .SS policy caching
  1212. .PP
  1213. Policies are run every time a function (with a policy as mentioned
  1214. above) is called.
  1215. These policies can be expensive depending on mergerfs\[aq] setup and
  1216. client usage patterns.
  1217. Generally we wouldn\[aq]t want to cache policy results because it may
  1218. result in stale responses if the underlying drives are used directly.
  1219. .PP
  1220. The \f[C]open\f[] policy cache will cache the result of an \f[C]open\f[]
  1221. policy for a particular input for \f[C]cache.open\f[] seconds or until
  1222. the file is unlinked.
  1223. Each file close (release) will randomly chose to clean up the cache of
  1224. expired entries.
  1225. .PP
  1226. This cache is really only useful in cases where you have a large number
  1227. of branches and \f[C]open\f[] is called on the same files repeatedly
  1228. (like \f[B]Transmission\f[] which opens and closes a file on every
  1229. read/write presumably to keep file handle usage low).
  1230. .SS statfs caching
  1231. .PP
  1232. Of the syscalls used by mergerfs in policies the \f[C]statfs\f[] /
  1233. \f[C]statvfs\f[] call is perhaps the most expensive.
  1234. It\[aq]s used to find out the available space of a drive and whether it
  1235. is mounted read\-only.
  1236. Depending on the setup and usage pattern these queries can be relatively
  1237. costly.
  1238. When \f[C]cache.statfs\f[] is enabled all calls to \f[C]statfs\f[] by a
  1239. policy will be cached for the number of seconds its set to.
  1240. .PP
  1241. Example: If the create policy is \f[C]mfs\f[] and the timeout is 60 then
  1242. for that 60 seconds the same drive will be returned as the target for
  1243. creates because the available space won\[aq]t be updated for that time.
  1244. .SS symlink caching
  1245. .PP
  1246. As of version 4.20 Linux supports symlink caching.
  1247. Significant performance increases can be had in workloads which use a
  1248. lot of symlinks.
  1249. Setting \f[C]cache.symlinks=true\f[] will result in requesting symlink
  1250. caching from the kernel only if supported.
  1251. As a result its safe to enable it on systems prior to 4.20.
  1252. That said it is disabled by default for now.
  1253. You can see if caching is enabled by querying the xattr
  1254. \f[C]user.mergerfs.cache.symlinks\f[] but given it must be requested at
  1255. startup you can not change it at runtime.
  1256. .SS readdir caching
  1257. .PP
  1258. As of version 4.20 Linux supports readdir caching.
  1259. This can have a significant impact on directory traversal.
  1260. Especially when combined with entry (\f[C]cache.entry\f[]) and attribute
  1261. (\f[C]cache.attr\f[]) caching.
  1262. Setting \f[C]cache.readdir=true\f[] will result in requesting readdir
  1263. caching from the kernel on each \f[C]opendir\f[].
  1264. If the kernel doesn\[aq]t support readdir caching setting the option to
  1265. \f[C]true\f[] has no effect.
  1266. This option is configurable at runtime via xattr
  1267. \f[C]user.mergerfs.cache.readdir\f[].
  1268. .SS tiered caching
  1269. .PP
  1270. Some storage technologies support what some call "tiered" caching.
  1271. The placing of usually smaller, faster storage as a transparent cache to
  1272. larger, slower storage.
  1273. NVMe, SSD, Optane in front of traditional HDDs for instance.
  1274. .PP
  1275. MergerFS does not natively support any sort of tiered caching.
  1276. Most users have no use for such a feature and its inclusion would
  1277. complicate the code.
  1278. However, there are a few situations where a cache drive could help with
  1279. a typical mergerfs setup.
  1280. .IP "1." 3
  1281. Fast network, slow drives, many readers: You\[aq]ve a 10+Gbps network
  1282. with many readers and your regular drives can\[aq]t keep up.
  1283. .IP "2." 3
  1284. Fast network, slow drives, small\[aq]ish bursty writes: You have a
  1285. 10+Gbps network and wish to transfer amounts of data less than your
  1286. cache drive but wish to do so quickly.
  1287. .PP
  1288. With #1 its arguable if you should be using mergerfs at all.
  1289. RAID would probably be the better solution.
  1290. If you\[aq]re going to use mergerfs there are other tactics that may
  1291. help: spreading the data across drives (see the mergerfs.dup tool) and
  1292. setting \f[C]func.open=rand\f[], using \f[C]symlinkify\f[], or using
  1293. dm\-cache or a similar technology to add tiered cache to the underlying
  1294. device.
  1295. .PP
  1296. With #2 one could use dm\-cache as well but there is another solution
  1297. which requires only mergerfs and a cronjob.
  1298. .IP "1." 3
  1299. Create 2 mergerfs pools.
  1300. One which includes just the slow drives and one which has both the fast
  1301. drives (SSD,NVME,etc.) and slow drives.
  1302. .IP "2." 3
  1303. The \[aq]cache\[aq] pool should have the cache drives listed first.
  1304. .IP "3." 3
  1305. The best \f[C]create\f[] policies to use for the \[aq]cache\[aq] pool
  1306. would probably be \f[C]ff\f[], \f[C]epff\f[], \f[C]lfs\f[], or
  1307. \f[C]eplfs\f[].
  1308. The latter two under the assumption that the cache drive(s) are far
  1309. smaller than the backing drives.
  1310. If using path preserving policies remember that you\[aq]ll need to
  1311. manually create the core directories of those paths you wish to be
  1312. cached.
  1313. Be sure the permissions are in sync.
  1314. Use \f[C]mergerfs.fsck\f[] to check / correct them.
  1315. You could also tag the slow drives as \f[C]=NC\f[] though that\[aq]d
  1316. mean if the cache drives fill you\[aq]d get "out of space" errors.
  1317. .IP "4." 3
  1318. Enable \f[C]moveonenospc\f[] and set \f[C]minfreespace\f[]
  1319. appropriately.
  1320. To make sure there is enough room on the "slow" pool you might want to
  1321. set \f[C]minfreespace\f[] to at least as large as the size of the
  1322. largest cache drive if not larger.
  1323. This way in the worst case the whole of the cache drive(s) can be moved
  1324. to the other drives.
  1325. .IP "5." 3
  1326. Set your programs to use the cache pool.
  1327. .IP "6." 3
  1328. Save one of the below scripts or create you\[aq]re own.
  1329. .IP "7." 3
  1330. Use \f[C]cron\f[] (as root) to schedule the command at whatever
  1331. frequency is appropriate for your workflow.
  1332. .SS time based expiring
  1333. .PP
  1334. Move files from cache to backing pool based only on the last time the
  1335. file was accessed.
  1336. Replace \f[C]\-atime\f[] with \f[C]\-amin\f[] if you want minutes rather
  1337. than days.
  1338. May want to use the \f[C]fadvise\f[] / \f[C]\-\-drop\-cache\f[] version
  1339. of rsync or run rsync with the tool "nocache".
  1340. .IP
  1341. .nf
  1342. \f[C]
  1343. #!/bin/bash
  1344. if\ [\ $#\ !=\ 3\ ];\ then
  1345. \ \ echo\ "usage:\ $0\ <cache\-drive>\ <backing\-pool>\ <days\-old>"
  1346. \ \ exit\ 1
  1347. fi
  1348. CACHE="${1}"
  1349. BACKING="${2}"
  1350. N=${3}
  1351. find\ "${CACHE}"\ \-type\ f\ \-atime\ +${N}\ \-printf\ \[aq]%P\\n\[aq]\ |\ \\
  1352. \ \ rsync\ \-\-files\-from=\-\ \-axqHAXWES\ \-\-preallocate\ \-\-remove\-source\-files\ "${CACHE}/"\ "${BACKING}/"
  1353. \f[]
  1354. .fi
  1355. .SS percentage full expiring
  1356. .PP
  1357. Move the oldest file from the cache to the backing pool.
  1358. Continue till below percentage threshold.
  1359. .IP
  1360. .nf
  1361. \f[C]
  1362. #!/bin/bash
  1363. if\ [\ $#\ !=\ 3\ ];\ then
  1364. \ \ echo\ "usage:\ $0\ <cache\-drive>\ <backing\-pool>\ <percentage>"
  1365. \ \ exit\ 1
  1366. fi
  1367. CACHE="${1}"
  1368. BACKING="${2}"
  1369. PERCENTAGE=${3}
  1370. set\ \-o\ errexit
  1371. while\ [\ $(df\ \-\-output=pcent\ "${CACHE}"\ |\ grep\ \-v\ Use\ |\ cut\ \-d\[aq]%\[aq]\ \-f1)\ \-gt\ ${PERCENTAGE}\ ]
  1372. do
  1373. \ \ \ \ FILE=$(find\ "${CACHE}"\ \-type\ f\ \-printf\ \[aq]%A\@\ %P\\n\[aq]\ |\ \\
  1374. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sort\ |\ \\
  1375. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ head\ \-n\ 1\ |\ \\
  1376. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cut\ \-d\[aq]\ \[aq]\ \-f2\-)
  1377. \ \ \ \ test\ \-n\ "${FILE}"
  1378. \ \ \ \ rsync\ \-axqHAXWES\ \-\-preallocate\ \-\-remove\-source\-files\ "${CACHE}/./${FILE}"\ "${BACKING}/"
  1379. done
  1380. \f[]
  1381. .fi
  1382. .SH PERFORMANCE
  1383. .PP
  1384. mergerfs is at its core just a proxy and therefore its theoretical max
  1385. performance is that of the underlying devices.
  1386. However, given it is a FUSE filesystem working from userspace there is
  1387. an increase in overhead relative to kernel based solutions.
  1388. That said the performance can match the theoretical max but it depends
  1389. greatly on the system\[aq]s configuration.
  1390. Especially when adding network filesystems into the mix there are many
  1391. variables which can impact performance.
  1392. Drive speeds and latency, network speeds and latency, general
  1393. concurrency, read/write sizes, etc.
  1394. Unfortunately, given the number of variables it has been difficult to
  1395. find a single set of settings which provide optimal performance.
  1396. If you\[aq]re having performance issues please look over the suggestions
  1397. below.
  1398. .PP
  1399. NOTE: be sure to read about these features before changing them
  1400. .IP \[bu] 2
  1401. enable (or disable) \f[C]splice_move\f[], \f[C]splice_read\f[], and
  1402. \f[C]splice_write\f[]
  1403. .IP \[bu] 2
  1404. increase cache timeouts \f[C]cache.attr\f[], \f[C]cache.entry\f[],
  1405. \f[C]cache.negative_entry\f[]
  1406. .IP \[bu] 2
  1407. enable (or disable) page caching (\f[C]cache.files\f[])
  1408. .IP \[bu] 2
  1409. enable \f[C]cache.writeback\f[]
  1410. .IP \[bu] 2
  1411. enable \f[C]cache.open\f[]
  1412. .IP \[bu] 2
  1413. enable \f[C]cache.statfs\f[]
  1414. .IP \[bu] 2
  1415. enable \f[C]cache.symlinks\f[]
  1416. .IP \[bu] 2
  1417. enable \f[C]cache.readdir\f[]
  1418. .IP \[bu] 2
  1419. change the number of worker threads
  1420. .IP \[bu] 2
  1421. disable \f[C]security_capability\f[] and/or \f[C]xattr\f[]
  1422. .IP \[bu] 2
  1423. disable \f[C]posix_acl\f[]
  1424. .IP \[bu] 2
  1425. disable \f[C]async_read\f[]
  1426. .IP \[bu] 2
  1427. test theoretical performance using \f[C]nullrw\f[] or mounting a ram
  1428. disk
  1429. .IP \[bu] 2
  1430. use \f[C]symlinkify\f[] if your data is largely static
  1431. .IP \[bu] 2
  1432. use tiered cache drives
  1433. .IP \[bu] 2
  1434. use lvm and lvm cache to place a SSD in front of your HDDs
  1435. .PP
  1436. If you come across a setting that significantly impacts performance
  1437. please contact trapexit so he may investigate further.
  1438. .SH BENCHMARKING
  1439. .PP
  1440. Filesystems are complicated.
  1441. They do many things and many of those are interconnected.
  1442. Additionally, the OS, drivers, hardware, etc.
  1443. all can impact performance.
  1444. Therefore, when benchmarking, it is \f[B]necessary\f[] that the test
  1445. focus as narrowly as possible.
  1446. .PP
  1447. For most throughput is the key benchmark.
  1448. To test throughput \f[C]dd\f[] is useful but \f[B]must\f[] be used with
  1449. the correct settings in order to ensure the filesystem or device is
  1450. actually being tested.
  1451. The OS can and will cache data.
  1452. Without forcing synchronous reads and writes and/or disabling caching
  1453. the values returned will not be representative of the device\[aq]s true
  1454. performance.
  1455. .PP
  1456. When benchmarking through mergerfs ensure you only use 1 branch to
  1457. remove any possibility of the policies complicating the situation.
  1458. Benchmark the underlying filesystem first and then mount mergerfs over
  1459. it and test again.
  1460. If you\[aq]re experience speeds below your expectation you will need to
  1461. narrow down precisely which component is leading to the slowdown.
  1462. Preferably test the following in the order listed (but not combined).
  1463. .IP "1." 3
  1464. Enable \f[C]nullrw\f[] mode with \f[C]nullrw=true\f[].
  1465. This will effectively make reads and writes no\-ops.
  1466. Removing the underlying device / filesystem from the equation.
  1467. This will give us the top theoretical speeds.
  1468. .IP "2." 3
  1469. Mount mergerfs over \f[C]tmpfs\f[].
  1470. \f[C]tmpfs\f[] is a RAM disk.
  1471. Extremely high speed and very low latency.
  1472. This is a more realistic best case scenario.
  1473. Example: \f[C]mount\ \-t\ tmpfs\ \-o\ size=2G\ tmpfs\ /tmp/tmpfs\f[]
  1474. .IP "3." 3
  1475. Mount mergerfs over a local drive.
  1476. NVMe, SSD, HDD, etc.
  1477. If you have more than one I\[aq]d suggest testing each of them as drives
  1478. and/or controllers (their drivers) could impact performance.
  1479. .IP "4." 3
  1480. Finally, if you intend to use mergerfs with a network filesystem, either
  1481. as the source of data or to combine with another through mergerfs, test
  1482. each of those alone as above.
  1483. .PP
  1484. Once you find the component which has the performance issue you can do
  1485. further testing with different options to see if they impact
  1486. performance.
  1487. For reads and writes the most relevant would be: \f[C]cache.files\f[],
  1488. \f[C]async_read\f[], \f[C]splice_move\f[], \f[C]splice_read\f[],
  1489. \f[C]splice_write\f[].
  1490. Less likely but relevant when using NFS or with certain filesystems
  1491. would be \f[C]security_capability\f[], \f[C]xattr\f[], and
  1492. \f[C]posix_acl\f[].
  1493. If you find a specific system, drive, filesystem, controller, etc.
  1494. that performs poorly contact trapexit so he may investigate further.
  1495. .PP
  1496. Sometimes the problem is really the application accessing or writing
  1497. data through mergerfs.
  1498. Some software use small buffer sizes which can lead to more requests and
  1499. therefore greater overhead.
  1500. You can test this out yourself by replace \f[C]bs=1M\f[] in the examples
  1501. below with \f[C]ibs\f[] or \f[C]obs\f[] and using a size of \f[C]512\f[]
  1502. instead of \f[C]1M\f[].
  1503. In one example test using \f[C]nullrw\f[] the write speed dropped from
  1504. 4.9GB/s to 69.7MB/s when moving from \f[C]1M\f[] to \f[C]512\f[].
  1505. Similar results were had when testing reads.
  1506. Small writes overhead may be improved by leveraging a write cache but in
  1507. casual tests little gain was found.
  1508. More tests will need to be done before this feature would become
  1509. available.
  1510. If you have an app that appears slow with mergerfs it could be due to
  1511. this.
  1512. Contact trapexit so he may investigate further.
  1513. .SS write benchmark
  1514. .IP
  1515. .nf
  1516. \f[C]
  1517. $\ dd\ if=/dev/zero\ of=/mnt/mergerfs/1GB.file\ bs=1M\ count=1024\ oflag=nocache\ conv=fdatasync\ status=progress
  1518. \f[]
  1519. .fi
  1520. .SS read benchmark
  1521. .IP
  1522. .nf
  1523. \f[C]
  1524. $\ dd\ if=/mnt/mergerfs/1GB.file\ of=/dev/null\ bs=1M\ count=1024\ iflag=nocache\ conv=fdatasync\ status=progress
  1525. \f[]
  1526. .fi
  1527. .SH TIPS / NOTES
  1528. .IP \[bu] 2
  1529. \f[B]use_ino\f[] will only work when used with mergerfs 2.18.0 and
  1530. above.
  1531. .IP \[bu] 2
  1532. Run mergerfs as \f[C]root\f[] (with \f[B]allow_other\f[]) unless
  1533. you\[aq]re merging paths which are owned by the same user otherwise
  1534. strange permission issues may arise.
  1535. .IP \[bu] 2
  1536. https://github.com/trapexit/backup\-and\-recovery\-howtos : A set of
  1537. guides / howtos on creating a data storage system, backing it up,
  1538. maintaining it, and recovering from failure.
  1539. .IP \[bu] 2
  1540. If you don\[aq]t see some directories and files you expect in a merged
  1541. point or policies seem to skip drives be sure the user has permission to
  1542. all the underlying directories.
  1543. Use \f[C]mergerfs.fsck\f[] to audit the drive for out of sync
  1544. permissions.
  1545. .IP \[bu] 2
  1546. Do \f[B]not\f[] use \f[C]cache.files=off\f[] (or \f[C]direct_io\f[]) if
  1547. you expect applications (such as rtorrent) to
  1548. mmap (http://linux.die.net/man/2/mmap) files.
  1549. Shared mmap is not currently supported in FUSE w/ \f[C]direct_io\f[]
  1550. enabled.
  1551. Enabling \f[C]dropcacheonclose\f[] is recommended when
  1552. \f[C]cache.files=partial|full|auto\-full\f[] or
  1553. \f[C]direct_io=false\f[].
  1554. .IP \[bu] 2
  1555. Since POSIX functions give only a singular error or success its
  1556. difficult to determine the proper behavior when applying the function to
  1557. multiple targets.
  1558. \f[B]mergerfs\f[] will return an error only if all attempts of an action
  1559. fail.
  1560. Any success will lead to a success returned.
  1561. This means however that some odd situations may arise.
  1562. .IP \[bu] 2
  1563. Kodi (http://kodi.tv), Plex (http://plex.tv),
  1564. Subsonic (http://subsonic.org), etc.
  1565. can use directory mtime (http://linux.die.net/man/2/stat) to more
  1566. efficiently determine whether to scan for new content rather than simply
  1567. performing a full scan.
  1568. If using the default \f[B]getattr\f[] policy of \f[B]ff\f[] its possible
  1569. those programs will miss an update on account of it returning the first
  1570. directory found\[aq]s \f[B]stat\f[] info and its a later directory on
  1571. another mount which had the \f[B]mtime\f[] recently updated.
  1572. To fix this you will want to set \f[B]func.getattr=newest\f[].
  1573. Remember though that this is just \f[B]stat\f[].
  1574. If the file is later \f[B]open\f[]\[aq]ed or \f[B]unlink\f[]\[aq]ed and
  1575. the policy is different for those then a completely different file or
  1576. directory could be acted on.
  1577. .IP \[bu] 2
  1578. Some policies mixed with some functions may result in strange behaviors.
  1579. Not that some of these behaviors and race conditions couldn\[aq]t happen
  1580. outside \f[B]mergerfs\f[] but that they are far more likely to occur on
  1581. account of the attempt to merge together multiple sources of data which
  1582. could be out of sync due to the different policies.
  1583. .IP \[bu] 2
  1584. For consistency its generally best to set \f[B]category\f[] wide
  1585. policies rather than individual \f[B]func\f[]\[aq]s.
  1586. This will help limit the confusion of tools such as
  1587. rsync (http://linux.die.net/man/1/rsync).
  1588. However, the flexibility is there if needed.
  1589. .SH KNOWN ISSUES / BUGS
  1590. .SS directory mtime is not being updated
  1591. .PP
  1592. Remember that the default policy for \f[C]getattr\f[] is \f[C]ff\f[].
  1593. The information for the first directory found will be returned.
  1594. If it wasn\[aq]t the directory which had been updated then it will
  1595. appear outdated.
  1596. .PP
  1597. The reason this is the default is because any other policy would be more
  1598. expensive and for many applications it is unnecessary.
  1599. To always return the directory with the most recent mtime or a faked
  1600. value based on all found would require a scan of all drives.
  1601. .PP
  1602. If you always want the directory information from the one with the most
  1603. recent mtime then use the \f[C]newest\f[] policy for \f[C]getattr\f[].
  1604. .SS \[aq]mv /mnt/pool/foo /mnt/disk1/foo\[aq] removes \[aq]foo\[aq]
  1605. .PP
  1606. This is not a bug.
  1607. .PP
  1608. Run in verbose mode to better understand what\[aq]s happening:
  1609. .IP
  1610. .nf
  1611. \f[C]
  1612. $\ mv\ \-v\ /mnt/pool/foo\ /mnt/disk1/foo
  1613. copied\ \[aq]/mnt/pool/foo\[aq]\ \->\ \[aq]/mnt/disk1/foo\[aq]
  1614. removed\ \[aq]/mnt/pool/foo\[aq]
  1615. $\ ls\ /mnt/pool/foo
  1616. ls:\ cannot\ access\ \[aq]/mnt/pool/foo\[aq]:\ No\ such\ file\ or\ directory
  1617. \f[]
  1618. .fi
  1619. .PP
  1620. \f[C]mv\f[], when working across devices, is copying the source to
  1621. target and then removing the source.
  1622. Since the source \f[B]is\f[] the target in this case, depending on the
  1623. unlink policy, it will remove the just copied file and other files
  1624. across the branches.
  1625. .PP
  1626. If you want to move files to one drive just copy them there and use
  1627. mergerfs.dedup to clean up the old paths or manually remove them from
  1628. the branches directly.
  1629. .SS cached memory appears greater than it should be
  1630. .PP
  1631. Use \f[C]cache.files=off\f[] or \f[C]direct_io=true\f[].
  1632. See the section on page caching.
  1633. .SS NFS clients returning ESTALE / Stale file handle
  1634. .PP
  1635. Be sure to use \f[C]noforget\f[] and \f[C]use_ino\f[] arguments.
  1636. .SS NFS clients don\[aq]t work
  1637. .PP
  1638. Some NFS clients appear to fail when a mergerfs mount is exported.
  1639. Kodi in particular seems to have issues.
  1640. .PP
  1641. Try enabling the \f[C]use_ino\f[] option.
  1642. Some have reported that it fixes the issue.
  1643. .SS rtorrent fails with ENODEV (No such device)
  1644. .PP
  1645. Be sure to set \f[C]cache.files=partial|full|auto\-full\f[] or turn off
  1646. \f[C]direct_io\f[].
  1647. rtorrent and some other applications use
  1648. mmap (http://linux.die.net/man/2/mmap) to read and write to files and
  1649. offer no fallback to traditional methods.
  1650. FUSE does not currently support mmap while using \f[C]direct_io\f[].
  1651. There may be a performance penalty on writes with \f[C]direct_io\f[] off
  1652. as well as the problem of double caching but it\[aq]s the only way to
  1653. get such applications to work.
  1654. If the performance loss is too high for other apps you can mount
  1655. mergerfs twice.
  1656. Once with \f[C]direct_io\f[] enabled and one without it.
  1657. Be sure to set \f[C]dropcacheonclose=true\f[] if not using
  1658. \f[C]direct_io\f[].
  1659. .SS rtorrent fails with files >= 4GiB
  1660. .PP
  1661. This is a kernel bug with mmap and FUSE on 32bit platforms.
  1662. A fix should become available for all LTS releases.
  1663. .PP
  1664. https://marc.info/?l=linux\-fsdevel&m=155550785230874&w=2
  1665. .SS Crashing on OpenVZ
  1666. .PP
  1667. There appears to be a bug in the OpenVZ kernel with regard to how it
  1668. handles ioctl calls.
  1669. It is making invalid requests which leads to a crash.
  1670. As of 2019\-12\-10 there is a bug report filed with OpenVZ but it is not
  1671. yet fixed.
  1672. .SS Plex doesn\[aq]t work with mergerfs
  1673. .PP
  1674. It does.
  1675. If you\[aq]re trying to put Plex\[aq]s config / metadata on mergerfs you
  1676. have to leave \f[C]direct_io\f[] off because Plex is using sqlite3 which
  1677. apparently needs mmap.
  1678. mmap doesn\[aq]t work with \f[C]direct_io\f[].
  1679. To fix this place the data elsewhere or disable \f[C]direct_io\f[] (with
  1680. \f[C]dropcacheonclose=true\f[]).
  1681. Sqlite3 does not need mmap but the developer needs to fall back to
  1682. standard IO if mmap fails.
  1683. .PP
  1684. If the issue is that scanning doesn\[aq]t seem to pick up media then be
  1685. sure to set \f[C]func.getattr=newest\f[] as mentioned above.
  1686. .SS mmap performance is really bad
  1687. .PP
  1688. There is/was a bug (https://lkml.org/lkml/2016/3/16/260) in caching
  1689. which affects overall performance of mmap through FUSE in Linux 4.x
  1690. kernels.
  1691. It is fixed in 4.4.10 and 4.5.4 (https://lkml.org/lkml/2016/5/11/59).
  1692. .SS When a program tries to move or rename a file it fails
  1693. .PP
  1694. Please read the section above regarding rename & link (#rename--link).
  1695. .PP
  1696. The problem is that many applications do not properly handle
  1697. \f[C]EXDEV\f[] errors which \f[C]rename\f[] and \f[C]link\f[] may return
  1698. even though they are perfectly valid situations which do not indicate
  1699. actual drive or OS errors.
  1700. The error will only be returned by mergerfs if using a path preserving
  1701. policy as described in the policy section above.
  1702. If you do not care about path preservation simply change the mergerfs
  1703. policy to the non\-path preserving version.
  1704. For example: \f[C]\-o\ category.create=mfs\f[]
  1705. .PP
  1706. Ideally the offending software would be fixed and it is recommended that
  1707. if you run into this problem you contact the software\[aq]s author and
  1708. request proper handling of \f[C]EXDEV\f[] errors.
  1709. .SS Samba: Moving files / directories fails
  1710. .PP
  1711. Workaround: Copy the file/directory and then remove the original rather
  1712. than move.
  1713. .PP
  1714. This isn\[aq]t an issue with Samba but some SMB clients.
  1715. GVFS\-fuse v1.20.3 and prior (found in Ubuntu 14.04 among others) failed
  1716. to handle certain error codes correctly.
  1717. Particularly \f[B]STATUS_NOT_SAME_DEVICE\f[] which comes from the
  1718. \f[B]EXDEV\f[] which is returned by \f[B]rename\f[] when the call is
  1719. crossing mount points.
  1720. When a program gets an \f[B]EXDEV\f[] it needs to explicitly take an
  1721. alternate action to accomplish its goal.
  1722. In the case of \f[B]mv\f[] or similar it tries \f[B]rename\f[] and on
  1723. \f[B]EXDEV\f[] falls back to a manual copying of data between the two
  1724. locations and unlinking the source.
  1725. In these older versions of GVFS\-fuse if it received \f[B]EXDEV\f[] it
  1726. would translate that into \f[B]EIO\f[].
  1727. This would cause \f[B]mv\f[] or most any application attempting to move
  1728. files around on that SMB share to fail with a IO error.
  1729. .PP
  1730. GVFS\-fuse v1.22.0 (https://bugzilla.gnome.org/show_bug.cgi?id=734568)
  1731. and above fixed this issue but a large number of systems use the older
  1732. release.
  1733. On Ubuntu the version can be checked by issuing
  1734. \f[C]apt\-cache\ showpkg\ gvfs\-fuse\f[].
  1735. Most distros released in 2015 seem to have the updated release and will
  1736. work fine but older systems may not.
  1737. Upgrading gvfs\-fuse or the distro in general will address the problem.
  1738. .PP
  1739. In Apple\[aq]s MacOSX 10.9 they replaced Samba (client and server) with
  1740. their own product.
  1741. It appears their new client does not handle \f[B]EXDEV\f[] either and
  1742. responds similar to older release of gvfs on Linux.
  1743. .SS Trashing files occasionally fails
  1744. .PP
  1745. This is the same issue as with Samba.
  1746. \f[C]rename\f[] returns \f[C]EXDEV\f[] (in our case that will really
  1747. only happen with path preserving policies like \f[C]epmfs\f[]) and the
  1748. software doesn\[aq]t handle the situation well.
  1749. This is unfortunately a common failure of software which moves files
  1750. around.
  1751. The standard indicates that an implementation \f[C]MAY\f[] choose to
  1752. support non\-user home directory trashing of files (which is a
  1753. \f[C]MUST\f[]).
  1754. The implementation \f[C]MAY\f[] also support "top directory trashes"
  1755. which many probably do.
  1756. .PP
  1757. To create a \f[C]$topdir/.Trash\f[] directory as defined in the standard
  1758. use the mergerfs\-tools (https://github.com/trapexit/mergerfs-tools)
  1759. tool \f[C]mergerfs.mktrash\f[].
  1760. .SS tar: Directory renamed before its status could be extracted
  1761. .PP
  1762. Make sure to use the \f[C]use_ino\f[] option.
  1763. .SS Supplemental user groups
  1764. .PP
  1765. Due to the overhead of
  1766. getgroups/setgroups (http://linux.die.net/man/2/setgroups) mergerfs
  1767. utilizes a cache.
  1768. This cache is opportunistic and per thread.
  1769. Each thread will query the supplemental groups for a user when that
  1770. particular thread needs to change credentials and will keep that data
  1771. for the lifetime of the thread.
  1772. This means that if a user is added to a group it may not be picked up
  1773. without the restart of mergerfs.
  1774. However, since the high level FUSE API\[aq]s (at least the standard
  1775. version) thread pool dynamically grows and shrinks it\[aq]s possible
  1776. that over time a thread will be killed and later a new thread with no
  1777. cache will start and query the new data.
  1778. .PP
  1779. The gid cache uses fixed storage to simplify the design and be
  1780. compatible with older systems which may not have C++11 compilers.
  1781. There is enough storage for 256 users\[aq] supplemental groups.
  1782. Each user is allowed up to 32 supplemental groups.
  1783. Linux >= 2.6.3 allows up to 65535 groups per user but most other *nixs
  1784. allow far less.
  1785. NFS allowing only 16.
  1786. The system does handle overflow gracefully.
  1787. If the user has more than 32 supplemental groups only the first 32 will
  1788. be used.
  1789. If more than 256 users are using the system when an uncached user is
  1790. found it will evict an existing user\[aq]s cache at random.
  1791. So long as there aren\[aq]t more than 256 active users this should be
  1792. fine.
  1793. If either value is too low for your needs you will have to modify
  1794. \f[C]gidcache.hpp\f[] to increase the values.
  1795. Note that doing so will increase the memory needed by each thread.
  1796. .PP
  1797. While not a bug some users have found when using containers that
  1798. supplemental groups defined inside the container don\[aq]t work properly
  1799. with regard to permissions.
  1800. This is expected as mergerfs lives outside the container and therefore
  1801. is querying the host\[aq]s group database.
  1802. There might be a hack to work around this (make mergerfs read the
  1803. /etc/group file in the container) but it is not yet implemented and
  1804. would be limited to Linux and the /etc/group DB.
  1805. Preferably users would mount in the host group file into the containers
  1806. or use a standard shared user & groups technology like NIS or LDAP.
  1807. .SS mergerfs or libfuse crashing
  1808. .PP
  1809. First...
  1810. always upgrade to the latest version unless told otherwise.
  1811. .PP
  1812. If using mergerfs below 2.22.0:
  1813. .PP
  1814. If suddenly the mergerfs mount point disappears and
  1815. \f[C]Transport\ endpoint\ is\ not\ connected\f[] is returned when
  1816. attempting to perform actions within the mount directory \f[B]and\f[]
  1817. the version of libfuse (use \f[C]mergerfs\ \-v\f[] to find the version)
  1818. is older than \f[C]2.9.4\f[] its likely due to a bug in libfuse.
  1819. Affected versions of libfuse can be found in Debian Wheezy, Ubuntu
  1820. Precise and others.
  1821. .PP
  1822. In order to fix this please install newer versions of libfuse.
  1823. If using a Debian based distro (Debian,Ubuntu,Mint) you can likely just
  1824. install newer versions of
  1825. libfuse (https://packages.debian.org/unstable/libfuse2) and
  1826. fuse (https://packages.debian.org/unstable/fuse) from the repo of a
  1827. newer release.
  1828. .PP
  1829. If using mergerfs at or above 2.22.0:
  1830. .PP
  1831. First upgrade if possible, check the known bugs section, and contact
  1832. trapexit.
  1833. .SS mergerfs appears to be crashing or exiting
  1834. .PP
  1835. There seems to be an issue with Linux version \f[C]4.9.0\f[] and above
  1836. in which an invalid message appears to be transmitted to libfuse (used
  1837. by mergerfs) causing it to exit.
  1838. No messages will be printed in any logs as its not a proper crash.
  1839. Debugging of the issue is still ongoing and can be followed via the
  1840. fuse\-devel
  1841. thread (https://sourceforge.net/p/fuse/mailman/message/35662577).
  1842. .SS mergerfs under heavy load and memory pressure leads to kernel panic
  1843. .PP
  1844. https://lkml.org/lkml/2016/9/14/527
  1845. .IP
  1846. .nf
  1847. \f[C]
  1848. [25192.515454]\ kernel\ BUG\ at\ /build/linux\-a2WvEb/linux\-4.4.0/mm/workingset.c:346!
  1849. [25192.517521]\ invalid\ opcode:\ 0000\ [#1]\ SMP
  1850. [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]
  1851. [25192.540910]\ CPU:\ 2\ PID:\ 63\ Comm:\ kswapd0\ Not\ tainted\ 4.4.0\-36\-generic\ #55\-Ubuntu
  1852. [25192.543411]\ Hardware\ name:\ System\ manufacturer\ System\ Product\ Name/P8H67\-M\ PRO,\ BIOS\ 3904\ 04/27/2013
  1853. [25192.545840]\ task:\ ffff88040cae6040\ ti:\ ffff880407488000\ task.ti:\ ffff880407488000
  1854. [25192.548277]\ RIP:\ 0010:[<ffffffff811ba501>]\ \ [<ffffffff811ba501>]\ shadow_lru_isolate+0x181/0x190
  1855. [25192.550706]\ RSP:\ 0018:ffff88040748bbe0\ \ EFLAGS:\ 00010002
  1856. [25192.553127]\ RAX:\ 0000000000001c81\ RBX:\ ffff8802f91ee928\ RCX:\ ffff8802f91eeb38
  1857. [25192.555544]\ RDX:\ ffff8802f91ee938\ RSI:\ ffff8802f91ee928\ RDI:\ ffff8804099ba2c0
  1858. [25192.557914]\ RBP:\ ffff88040748bc08\ R08:\ 000000000001a7b6\ R09:\ 000000000000003f
  1859. [25192.560237]\ R10:\ 000000000001a750\ R11:\ 0000000000000000\ R12:\ ffff8804099ba2c0
  1860. [25192.562512]\ R13:\ ffff8803157e9680\ R14:\ ffff8803157e9668\ R15:\ ffff8804099ba2c8
  1861. [25192.564724]\ FS:\ \ 0000000000000000(0000)\ GS:ffff88041f280000(0000)\ knlGS:0000000000000000
  1862. [25192.566990]\ CS:\ \ 0010\ DS:\ 0000\ ES:\ 0000\ CR0:\ 0000000080050033
  1863. [25192.569201]\ CR2:\ 00007ffabb690000\ CR3:\ 0000000001e0a000\ CR4:\ 00000000000406e0
  1864. [25192.571419]\ Stack:
  1865. [25192.573550]\ \ ffff8804099ba2c0\ ffff88039e4f86f0\ ffff8802f91ee928\ ffff8804099ba2c8
  1866. [25192.575695]\ \ ffff88040748bd08\ ffff88040748bc58\ ffffffff811b99bf\ 0000000000000052
  1867. [25192.577814]\ \ 0000000000000000\ ffffffff811ba380\ 000000000000008a\ 0000000000000080
  1868. [25192.579947]\ Call\ Trace:
  1869. [25192.582022]\ \ [<ffffffff811b99bf>]\ __list_lru_walk_one.isra.3+0x8f/0x130
  1870. [25192.584137]\ \ [<ffffffff811ba380>]\ ?\ memcg_drain_all_list_lrus+0x190/0x190
  1871. [25192.586165]\ \ [<ffffffff811b9a83>]\ list_lru_walk_one+0x23/0x30
  1872. [25192.588145]\ \ [<ffffffff811ba544>]\ scan_shadow_nodes+0x34/0x50
  1873. [25192.590074]\ \ [<ffffffff811a0e9d>]\ shrink_slab.part.40+0x1ed/0x3d0
  1874. [25192.591985]\ \ [<ffffffff811a53da>]\ shrink_zone+0x2ca/0x2e0
  1875. [25192.593863]\ \ [<ffffffff811a64ce>]\ kswapd+0x51e/0x990
  1876. [25192.595737]\ \ [<ffffffff811a5fb0>]\ ?\ mem_cgroup_shrink_node_zone+0x1c0/0x1c0
  1877. [25192.597613]\ \ [<ffffffff810a0808>]\ kthread+0xd8/0xf0
  1878. [25192.599495]\ \ [<ffffffff810a0730>]\ ?\ kthread_create_on_node+0x1e0/0x1e0
  1879. [25192.601335]\ \ [<ffffffff8182e34f>]\ ret_from_fork+0x3f/0x70
  1880. [25192.603193]\ \ [<ffffffff810a0730>]\ ?\ kthread_create_on_node+0x1e0/0x1e0
  1881. \f[]
  1882. .fi
  1883. .PP
  1884. There is a bug in the kernel.
  1885. A work around appears to be turning off \f[C]splice\f[].
  1886. Don\[aq]t add the \f[C]splice_*\f[] arguments or add
  1887. \f[C]no_splice_write,no_splice_move,no_splice_read\f[].
  1888. This, however, is not guaranteed to work.
  1889. .SS rm: fts_read failed: No such file or directory
  1890. .PP
  1891. NOTE: This is only relevant to mergerfs versions at or below v2.25.x and
  1892. should not occur in more recent versions.
  1893. See the notes on \f[C]unlink\f[].
  1894. .PP
  1895. Not \f[I]really\f[] a bug.
  1896. The FUSE library will move files when asked to delete them as a way to
  1897. deal with certain edge cases and then later delete that file when its
  1898. clear the file is no longer needed.
  1899. This however can lead to two issues.
  1900. One is that these hidden files are noticed by \f[C]rm\ \-rf\f[] or
  1901. \f[C]find\f[] when scanning directories and they may try to remove them
  1902. and they might have disappeared already.
  1903. There is nothing \f[I]wrong\f[] about this happening but it can be
  1904. annoying.
  1905. The second issue is that a directory might not be able to removed on
  1906. account of the hidden file being still there.
  1907. .PP
  1908. Using the \f[B]hard_remove\f[] option will make it so these temporary
  1909. files are not used and files are deleted immediately.
  1910. That has a side effect however.
  1911. Files which are unlinked and then they are still used (in certain forms)
  1912. will result in an error (ENOENT).
  1913. .SH FAQ
  1914. .SS How well does mergerfs scale? Is it "production ready?"
  1915. .PP
  1916. Users have reported running mergerfs on everything from a Raspberry Pi
  1917. to dual socket Xeon systems with >20 cores.
  1918. I\[aq]m aware of at least a few companies which use mergerfs in
  1919. production.
  1920. Open Media Vault (https://www.openmediavault.org) includes mergerfs as
  1921. its sole solution for pooling drives.
  1922. .SS Can mergerfs be used with drives which already have data / are in
  1923. use?
  1924. .PP
  1925. Yes.
  1926. MergerFS is a proxy and does \f[B]NOT\f[] interfere with the normal form
  1927. or function of the drives / mounts / paths it manages.
  1928. .PP
  1929. MergerFS is \f[B]not\f[] a traditional filesystem.
  1930. MergerFS is \f[B]not\f[] RAID.
  1931. It does \f[B]not\f[] manipulate the data that passes through it.
  1932. It does \f[B]not\f[] shard data across drives.
  1933. It merely shards some \f[B]behavior\f[] and aggregates others.
  1934. .SS Can mergerfs be removed without affecting the data?
  1935. .PP
  1936. See the previous question\[aq]s answer.
  1937. .SS What policies should I use?
  1938. .PP
  1939. Unless you\[aq]re doing something more niche the average user is
  1940. probably best off using \f[C]mfs\f[] for \f[C]category.create\f[].
  1941. It will spread files out across your branches based on available space.
  1942. You may want to use \f[C]lus\f[] if you prefer a slightly different
  1943. distribution of data if you have a mix of smaller and larger drives.
  1944. Generally though \f[C]mfs\f[], \f[C]lus\f[], or even \f[C]rand\f[] are
  1945. good for the general use case.
  1946. If you are starting with an imbalanced pool you can use the tool
  1947. \f[B]mergerfs.balance\f[] to redistribute files across the pool.
  1948. .PP
  1949. If you really wish to try to colocate files based on directory you can
  1950. set \f[C]func.create\f[] to \f[C]epmfs\f[] or similar and
  1951. \f[C]func.mkdir\f[] to \f[C]rand\f[] or \f[C]eprand\f[] depending on if
  1952. you just want to colocate generally or on specific branches.
  1953. Either way the \f[I]need\f[] to colocate is rare.
  1954. For instance: if you wish to remove the drive regularly and want the
  1955. data to predictably be on that drive or if you don\[aq]t use backup at
  1956. all and don\[aq]t wish to replace that data piecemeal.
  1957. In which case using path preservation can help but will require some
  1958. manual attention.
  1959. Colocating after the fact can be accomplished using the
  1960. \f[B]mergerfs.consolidate\f[] tool.
  1961. .PP
  1962. Ultimately there is no correct answer.
  1963. It is a preference or based on some particular need.
  1964. mergerfs is very easy to test and experiment with.
  1965. I suggest creating a test setup and experimenting to get a sense of what
  1966. you want.
  1967. .PP
  1968. The reason \f[C]mfs\f[] is not the default \f[C]category.create\f[]
  1969. policy is historical.
  1970. When/if a 3.X gets released it will be changed to minimize confusion
  1971. people often have with path preserving policies.
  1972. .SS What settings should I use?
  1973. .PP
  1974. Depends on what features you want.
  1975. Generally speaking there are no "wrong" settings.
  1976. All settings are performance or feature related.
  1977. The best bet is to read over the available options and choose what fits
  1978. your situation.
  1979. If something isn\[aq]t clear from the documentation please reach out and
  1980. the documentation will be improved.
  1981. .PP
  1982. That said, for the average person, the following should be fine:
  1983. .PP
  1984. \f[C]\-o\ use_ino,cache.files=off,dropcacheonclose=true,allow_other,category.create=mfs\f[]
  1985. .SS Why are all my files ending up on 1 drive?!
  1986. .PP
  1987. Did you start with empty drives?
  1988. Did you explicitly configure a \f[C]category.create\f[] policy?
  1989. Are you using a path preserving policy?
  1990. .PP
  1991. The default create policy is \f[C]epmfs\f[].
  1992. That is a path preserving algorithm.
  1993. With such a policy for \f[C]mkdir\f[] and \f[C]create\f[] with a set of
  1994. empty drives it will select only 1 drive when the first directory is
  1995. created.
  1996. Anything, files or directories, created in that first directory will be
  1997. placed on the same branch because it is preserving paths.
  1998. .PP
  1999. This catches a lot of new users off guard but changing the default would
  2000. break the setup for many existing users.
  2001. If you do not care about path preservation and wish your files to be
  2002. spread across all your drives change to \f[C]mfs\f[] or similar policy
  2003. as described above.
  2004. If you do want path preservation you\[aq]ll need to perform the manual
  2005. act of creating paths on the drives you want the data to land on before
  2006. transferring your data.
  2007. Setting \f[C]func.mkdir=epall\f[] can simplify managing path
  2008. preservation for \f[C]create\f[].
  2009. Or use \f[C]func.mkdir=rand\f[] if you\[aq]re intersted in just grouping
  2010. together directory content by drive.
  2011. .SS Do hard links work?
  2012. .PP
  2013. Yes.
  2014. You need to use \f[C]use_ino\f[] to support proper reporting of inodes.
  2015. .PP
  2016. What mergerfs does not do is fake hard links across branches.
  2017. Read the section "rename & link" for how it works.
  2018. .SS Does mergerfs support CoW / copy\-on\-write?
  2019. .PP
  2020. Not in the sense of a filesystem like BTRFS or ZFS nor in the overlayfs
  2021. or aufs sense.
  2022. It does offer a
  2023. cow\-shell (http://manpages.ubuntu.com/manpages/bionic/man1/cow-shell.1.html)
  2024. like hard link breaking (copy to temp file then rename over original)
  2025. which can be useful when wanting to save space by hardlinking duplicate
  2026. files but wish to treat each name as if it were a unique and separate
  2027. file.
  2028. .SS Why can\[aq]t I see my files / directories?
  2029. .PP
  2030. It\[aq]s almost always a permissions issue.
  2031. Unlike mhddfs and unionfs\-fuse, which runs as root and attempts to
  2032. access content as such, mergerfs always changes its credentials to that
  2033. of the caller.
  2034. This means that if the user does not have access to a file or directory
  2035. than neither will mergerfs.
  2036. However, because mergerfs is creating a union of paths it may be able to
  2037. read some files and directories on one drive but not another resulting
  2038. in an incomplete set.
  2039. .PP
  2040. Whenever you run into a split permission issue (seeing some but not all
  2041. files) try using
  2042. mergerfs.fsck (https://github.com/trapexit/mergerfs-tools) tool to check
  2043. for and fix the mismatch.
  2044. If you aren\[aq]t seeing anything at all be sure that the basic
  2045. permissions are correct.
  2046. The user and group values are correct and that directories have their
  2047. executable bit set.
  2048. A common mistake by users new to Linux is to \f[C]chmod\ \-R\ 644\f[]
  2049. when they should have \f[C]chmod\ \-R\ u=rwX,go=rX\f[].
  2050. .PP
  2051. If using a network filesystem such as NFS, SMB, CIFS (Samba) be sure to
  2052. pay close attention to anything regarding permissioning and users.
  2053. Root squashing and user translation for instance has bitten a few
  2054. mergerfs users.
  2055. Some of these also affect the use of mergerfs from container platforms
  2056. such as Docker.
  2057. .SS Is my OS\[aq]s libfuse needed for mergerfs to work?
  2058. .PP
  2059. No.
  2060. Normally \f[C]mount.fuse\f[] is needed to get mergerfs (or any FUSE
  2061. filesystem to mount using the \f[C]mount\f[] command but in vendoring
  2062. the libfuse library the \f[C]mount.fuse\f[] app has been renamed to
  2063. \f[C]mount.mergerfs\f[] meaning the filesystem type in \f[C]fstab\f[]
  2064. can simply be \f[C]mergerfs\f[].
  2065. .SS Why was libfuse embedded into mergerfs?
  2066. .IP "1." 3
  2067. A significant number of users use mergerfs on distros with old versions
  2068. of libfuse which have serious bugs.
  2069. Requiring updated versions of libfuse on those distros isn\[aq]t
  2070. practical (no package offered, user inexperience, etc.).
  2071. The only practical way to provide a stable runtime on those systems was
  2072. to "vendor" / embed the library into the project.
  2073. .IP "2." 3
  2074. mergerfs was written to use the high level API.
  2075. There are a number of limitations in the HLAPI that make certain
  2076. features difficult or impossible to implement.
  2077. While some of these features could be patched into newer versions of
  2078. libfuse without breaking the public API some of them would require hacky
  2079. code to provide backwards compatibility.
  2080. While it may still be worth working with upstream to address these
  2081. issues in future versions, since the library needs to be vendored for
  2082. stability and compatibility reasons it is preferable / easier to modify
  2083. the API.
  2084. Longer term the plan is to rewrite mergerfs to use the low level API.
  2085. .SS Why did support for system libfuse get removed?
  2086. .PP
  2087. See above first.
  2088. .PP
  2089. If/when mergerfs is rewritten to use the low\-level API then it\[aq]ll
  2090. be plausible to support system libfuse but till then its simply too much
  2091. work to manage the differences across the versions.
  2092. .SS Why use mergerfs over mhddfs?
  2093. .PP
  2094. mhddfs is no longer maintained and has some known stability and security
  2095. issues (see below).
  2096. MergerFS provides a superset of mhddfs\[aq] features and should offer
  2097. the same or maybe better performance.
  2098. .PP
  2099. Below is an example of mhddfs and mergerfs setup to work similarly.
  2100. .PP
  2101. \f[C]mhddfs\ \-o\ mlimit=4G,allow_other\ /mnt/drive1,/mnt/drive2\ /mnt/pool\f[]
  2102. .PP
  2103. \f[C]mergerfs\ \-o\ minfreespace=4G,allow_other,category.create=ff\ /mnt/drive1:/mnt/drive2\ /mnt/pool\f[]
  2104. .SS Why use mergerfs over aufs?
  2105. .PP
  2106. aufs is mostly abandoned and no longer available in many distros.
  2107. .PP
  2108. While aufs can offer better peak performance mergerfs provides more
  2109. configurability and is generally easier to use.
  2110. mergerfs however does not offer the overlay / copy\-on\-write (CoW)
  2111. features which aufs and overlayfs have.
  2112. .SS Why use mergerfs over unionfs?
  2113. .PP
  2114. UnionFS is more like aufs than mergerfs in that it offers overlay / CoW
  2115. features.
  2116. If you\[aq]re just looking to create a union of drives and want
  2117. flexibility in file/directory placement then mergerfs offers that
  2118. whereas unionfs is more for overlaying RW filesystems over RO ones.
  2119. .SS Why use mergerfs over LVM/ZFS/BTRFS/RAID0 drive concatenation /
  2120. striping?
  2121. .PP
  2122. With simple JBOD / drive concatenation / stripping / RAID0 a single
  2123. drive failure will result in full pool failure.
  2124. mergerfs performs a similar function without the possibility of
  2125. catastrophic failure and the difficulties in recovery.
  2126. Drives may fail, however, all other data will continue to be accessible.
  2127. .PP
  2128. When combined with something like SnapRaid (http://www.snapraid.it)
  2129. and/or an offsite backup solution you can have the flexibility of JBOD
  2130. without the single point of failure.
  2131. .SS Why use mergerfs over ZFS?
  2132. .PP
  2133. MergerFS is not intended to be a replacement for ZFS.
  2134. MergerFS is intended to provide flexible pooling of arbitrary drives
  2135. (local or remote), of arbitrary sizes, and arbitrary filesystems.
  2136. For \f[C]write\ once,\ read\ many\f[] usecases such as bulk media
  2137. storage.
  2138. Where data integrity and backup is managed in other ways.
  2139. In that situation ZFS can introduce a number of costs and limitations as
  2140. described
  2141. here (http://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html),
  2142. here (https://markmcb.com/2020/01/07/five-years-of-btrfs/), and
  2143. here (https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSWhyNoRealReshaping).
  2144. .SS What should mergerfs NOT be used for?
  2145. .IP \[bu] 2
  2146. databases: Even if the database stored data in separate files (mergerfs
  2147. wouldn\[aq]t offer much otherwise) the higher latency of the indirection
  2148. will kill performance.
  2149. If it is a lightly used SQLITE database then it may be fine but
  2150. you\[aq]ll need to test.
  2151. .IP \[bu] 2
  2152. VM images: For the same reasons as databases.
  2153. VM images are accessed very aggressively and mergerfs will introduce too
  2154. much latency (if it works at all).
  2155. .IP \[bu] 2
  2156. As replacement for RAID: mergerfs is just for pooling branches.
  2157. If you need that kind of device performance aggregation or high
  2158. availability you should stick with RAID.
  2159. .SS Can drives be written to directly? Outside of mergerfs while pooled?
  2160. .PP
  2161. Yes, however its not recommended to use the same file from within the
  2162. pool and from without at the same time (particularly writing).
  2163. Especially if using caching of any kind (cache.files, cache.entry,
  2164. cache.attr, cache.negative_entry, cache.symlinks, cache.readdir, etc.)
  2165. as there could be a conflict between cached data and not.
  2166. .SS Why do I get an "out of space" / "no space left on device" / ENOSPC
  2167. error even though there appears to be lots of space available?
  2168. .PP
  2169. First make sure you\[aq]ve read the sections above about policies, path
  2170. preservation, branch filtering, and the options \f[B]minfreespace\f[],
  2171. \f[B]moveonenospc\f[], \f[B]statfs\f[], and \f[B]statfs_ignore\f[].
  2172. .PP
  2173. mergerfs is simply presenting a union of the content within multiple
  2174. branches.
  2175. The reported free space is an aggregate of space available within the
  2176. pool (behavior modified by \f[B]statfs\f[] and \f[B]statfs_ignore\f[]).
  2177. It does not represent a contiguous space.
  2178. In the same way that read\-only filesystems, those with quotas, or
  2179. reserved space report the full theoretical space available.
  2180. .PP
  2181. Due to path preservation, branch tagging, read\-only status, and
  2182. \f[B]minfreespace\f[] settings it is perfectly valid that
  2183. \f[C]ENOSPC\f[] / "out of space" / "no space left on device" be
  2184. returned.
  2185. It is doing what was asked of it: filtering possible branches due to
  2186. those settings.
  2187. Only one error can be returned and if one of the reasons for filtering a
  2188. branch was \f[B]minfreespace\f[] then it will be returned as such.
  2189. \f[B]moveonenospc\f[] is only relevant to writing a file which is too
  2190. large for the drive its currently on.
  2191. .PP
  2192. It is also possible that the filesystem selected has run out of inodes.
  2193. Use \f[C]df\ \-i\f[] to list the total and available inodes per
  2194. filesystem.
  2195. .PP
  2196. If you don\[aq]t care about path preservation then simply change the
  2197. \f[C]create\f[] policy to one which isn\[aq]t.
  2198. \f[C]mfs\f[] is probably what most are looking for.
  2199. The reason its not default is because it was originally set to
  2200. \f[C]epmfs\f[] and changing it now would change people\[aq]s setup.
  2201. Such a setting change will likely occur in mergerfs 3.
  2202. .SS Can mergerfs mounts be exported over NFS?
  2203. .PP
  2204. Yes.
  2205. Due to current usage of libfuse by mergerfs and how NFS interacts with
  2206. it it is necessary to add \f[C]noforget\f[] to mergerfs options to keep
  2207. from getting "stale file handle" errors.
  2208. .PP
  2209. Some clients (Kodi) have issues in which the contents of the NFS mount
  2210. will not be presented but users have found that enabling the
  2211. \f[C]use_ino\f[] option often fixes that problem.
  2212. .SS Can mergerfs mounts be exported over Samba / SMB?
  2213. .PP
  2214. Yes.
  2215. While some users have reported problems it appears to always be related
  2216. to how Samba is setup in relation to permissions.
  2217. .SS How are inodes calculated?
  2218. .PP
  2219. https://github.com/trapexit/mergerfs/blob/master/src/fs_inode.hpp
  2220. .PP
  2221. Originally tried to simply OR st_ino and (st_dev << 32) for 64bit
  2222. systems.
  2223. After a number of years someone finally ran into a collision that lead
  2224. to some problems.
  2225. Traditionally \f[C]dev_t\f[] was 16bit and \f[C]ino_t\f[] was 32bit so
  2226. merging into one 64bit value worked but with both types being able to be
  2227. up to 64bit that is no longer as simple.
  2228. A proper hash seems like the best compromise.
  2229. While totally unique inodes are preferred the overhead which would be
  2230. needed does not seem to be outweighed by the benefits.
  2231. .PP
  2232. While atypical, yes, inodes can be reused and not refer to the same
  2233. file.
  2234. The internal id used to reference a file in FUSE is different from the
  2235. inode value presented.
  2236. The former is the \f[C]nodeid\f[] and is actually a tuple of
  2237. (nodeid,generation).
  2238. That tuple is not user facing.
  2239. The inode is merely metadata passed through the kernel and found using
  2240. the \f[C]stat\f[] family of calls or \f[C]readdir\f[].
  2241. .PP
  2242. From FUSE docs regarding \f[C]use_ino\f[]:
  2243. .IP
  2244. .nf
  2245. \f[C]
  2246. Honor\ the\ st_ino\ field\ in\ the\ functions\ getattr()\ and
  2247. fill_dir().\ This\ value\ is\ used\ to\ fill\ in\ the\ st_ino\ field
  2248. in\ the\ stat(2),\ lstat(2),\ fstat(2)\ functions\ and\ the\ d_ino
  2249. field\ in\ the\ readdir(2)\ function.\ The\ filesystem\ does\ not
  2250. have\ to\ guarantee\ uniqueness,\ however\ some\ applications
  2251. rely\ on\ this\ value\ being\ unique\ for\ the\ whole\ filesystem.
  2252. Note\ that\ this\ does\ *not*\ affect\ the\ inode\ that\ libfuse
  2253. and\ the\ kernel\ use\ internally\ (also\ called\ the\ "nodeid").
  2254. \f[]
  2255. .fi
  2256. .PP
  2257. Generally collision, if it occurs, shouldn\[aq]t be a problem.
  2258. You can turn off the calculation by not using \f[C]use_ino\f[].
  2259. In the future it might be worth creating different strategies for users
  2260. to select from.
  2261. .SS I notice massive slowdowns of writes when enabling cache.files.
  2262. .PP
  2263. When file caching is enabled in any form (\f[C]cache.files!=off\f[] or
  2264. \f[C]direct_io=false\f[]) it will issue \f[C]getxattr\f[] requests for
  2265. \f[C]security.capability\f[] prior to \f[I]every single write\f[].
  2266. This will usually result in a performance degregation, especially when
  2267. using a network filesystem (such as NFS or CIFS/SMB/Samba.)
  2268. Unfortunately at this moment the kernel is not caching the response.
  2269. .PP
  2270. To work around this situation mergerfs offers a few solutions.
  2271. .IP "1." 3
  2272. Set \f[C]security_capability=false\f[].
  2273. It will short curcuit any call and return \f[C]ENOATTR\f[].
  2274. This still means though that mergerfs will receive the request before
  2275. every write but at least it doesn\[aq]t get passed through to the
  2276. underlying filesystem.
  2277. .IP "2." 3
  2278. Set \f[C]xattr=noattr\f[].
  2279. Same as above but applies to \f[I]all\f[] calls to getxattr.
  2280. Not just \f[C]security.capability\f[].
  2281. This will not be cached by the kernel either but mergerfs\[aq] runtime
  2282. config system will still function.
  2283. .IP "3." 3
  2284. Set \f[C]xattr=nosys\f[].
  2285. Results in mergerfs returning \f[C]ENOSYS\f[] which \f[I]will\f[] be
  2286. cached by the kernel.
  2287. No future xattr calls will be forwarded to mergerfs.
  2288. The downside is that also means the xattr based config and query
  2289. functionality won\[aq]t work either.
  2290. .IP "4." 3
  2291. Disable file caching.
  2292. If you aren\[aq]t using applications which use \f[C]mmap\f[] it\[aq]s
  2293. probably simplier to just disable it all together.
  2294. The kernel won\[aq]t send the requests when caching is disabled.
  2295. .SS What are these .fuse_hidden files?
  2296. .PP
  2297. NOTE: mergerfs >= 2.26.0 will not have these temporary files.
  2298. See the notes on \f[C]unlink\f[].
  2299. .PP
  2300. When not using \f[B]hard_remove\f[] libfuse will create
  2301. \&.fuse_hiddenXXXXXXXX files when an opened file is unlinked.
  2302. This is to simplify "use after unlink" usecases.
  2303. There is a possibility these files end up being picked up by software
  2304. scanning directories and not ignoring hidden files.
  2305. This is rarely a problem but a solution is in the works.
  2306. .PP
  2307. The files are cleaned up once the file is finally closed.
  2308. Only if mergerfs crashes or is killed would they be left around.
  2309. They are safe to remove as they are already unlinked files.
  2310. .SS It\[aq]s mentioned that there are some security issues with mhddfs.
  2311. What are they? How does mergerfs address them?
  2312. .PP
  2313. mhddfs (https://github.com/trapexit/mhddfs) manages running as
  2314. \f[B]root\f[] by calling
  2315. getuid() (https://github.com/trapexit/mhddfs/blob/cae96e6251dd91e2bdc24800b4a18a74044f6672/src/main.c#L319)
  2316. and if it returns \f[B]0\f[] then it will
  2317. chown (http://linux.die.net/man/1/chown) the file.
  2318. Not only is that a race condition but it doesn\[aq]t handle other
  2319. situations.
  2320. Rather than attempting to simulate POSIX ACL behavior the proper way to
  2321. manage this is to use seteuid (http://linux.die.net/man/2/seteuid) and
  2322. setegid (http://linux.die.net/man/2/setegid), in effect becoming the
  2323. user making the original call, and perform the action as them.
  2324. This is what mergerfs does and why mergerfs should always run as root.
  2325. .PP
  2326. In Linux setreuid syscalls apply only to the thread.
  2327. GLIBC hides this away by using realtime signals to inform all threads to
  2328. change credentials.
  2329. Taking after \f[B]Samba\f[], mergerfs uses
  2330. \f[B]syscall(SYS_setreuid,...)\f[] to set the callers credentials for
  2331. that thread only.
  2332. Jumping back to \f[B]root\f[] as necessary should escalated privileges
  2333. be needed (for instance: to clone paths between drives).
  2334. .PP
  2335. For non\-Linux systems mergerfs uses a read\-write lock and changes
  2336. credentials only when necessary.
  2337. If multiple threads are to be user X then only the first one will need
  2338. to change the processes credentials.
  2339. So long as the other threads need to be user X they will take a readlock
  2340. allowing multiple threads to share the credentials.
  2341. Once a request comes in to run as user Y that thread will attempt a
  2342. write lock and change to Y\[aq]s credentials when it can.
  2343. If the ability to give writers priority is supported then that flag will
  2344. be used so threads trying to change credentials don\[aq]t starve.
  2345. This isn\[aq]t the best solution but should work reasonably well
  2346. assuming there are few users.
  2347. .SH SUPPORT
  2348. .PP
  2349. Filesystems are very complex and difficult to debug.
  2350. mergerfs, while being just a proxy of sorts, is also very difficult to
  2351. debug given the large number of possible settings it can have itself and
  2352. the massive number of environments it can run in.
  2353. When reporting on a suspected issue \f[B]please, please\f[] include as
  2354. much of the below information as possible otherwise it will be difficult
  2355. or impossible to diagnose.
  2356. Also please make sure to read all of the above documentation as it
  2357. includes nearly every known system or user issue previously encountered.
  2358. .SS Information to include in bug reports
  2359. .IP \[bu] 2
  2360. Version of mergerfs: \f[C]mergerfs\ \-V\f[]
  2361. .IP \[bu] 2
  2362. mergerfs settings: from \f[C]/etc/fstab\f[] or command line execution
  2363. .IP \[bu] 2
  2364. Version of Linux: \f[C]uname\ \-a\f[]
  2365. .IP \[bu] 2
  2366. Versions of any additional software being used
  2367. .IP \[bu] 2
  2368. List of drives, their filesystems, and sizes (before and after issue):
  2369. \f[C]df\ \-h\f[]
  2370. .IP \[bu] 2
  2371. A \f[C]strace\f[] of the app having problems:
  2372. .IP \[bu] 2
  2373. \f[C]strace\ \-f\ \-o\ /tmp/app.strace.txt\ <cmd>\f[]
  2374. .IP \[bu] 2
  2375. A \f[C]strace\f[] of mergerfs while the program is trying to do whatever
  2376. it\[aq]s failing to do:
  2377. .IP \[bu] 2
  2378. \f[C]strace\ \-f\ \-p\ <mergerfsPID>\ \-o\ /tmp/mergerfs.strace.txt\f[]
  2379. .IP \[bu] 2
  2380. \f[B]Precise\f[] directions on replicating the issue.
  2381. Do not leave \f[B]anything\f[] out.
  2382. .IP \[bu] 2
  2383. Try to recreate the problem in the simplist way using standard programs.
  2384. .SS Contact / Issue submission
  2385. .IP \[bu] 2
  2386. github.com: https://github.com/trapexit/mergerfs/issues
  2387. .IP \[bu] 2
  2388. email: trapexit\@spawn.link
  2389. .IP \[bu] 2
  2390. twitter: https://twitter.com/_trapexit
  2391. .IP \[bu] 2
  2392. reddit: https://www.reddit.com/user/trapexit
  2393. .IP \[bu] 2
  2394. discord: https://discord.gg/MpAr69V
  2395. .SS Support development
  2396. .PP
  2397. This software is free to use and released under a very liberal license.
  2398. That said if you like this software and would like to support its
  2399. development donations are welcome.
  2400. .IP \[bu] 2
  2401. PayPal: https://paypal.me/trapexit
  2402. .IP \[bu] 2
  2403. GitHub Sponsors: https://github.com/sponsors/trapexit
  2404. .IP \[bu] 2
  2405. Patreon: https://www.patreon.com/trapexit
  2406. .IP \[bu] 2
  2407. SubscribeStar: https://www.subscribestar.com/trapexit
  2408. .IP \[bu] 2
  2409. Ko\-Fi: https://ko\-fi.com/trapexit
  2410. .IP \[bu] 2
  2411. Bitcoin (BTC): 12CdMhEPQVmjz3SSynkAEuD5q9JmhTDCZA
  2412. .IP \[bu] 2
  2413. Bitcoin Cash (BCH): 1AjPqZZhu7GVEs6JFPjHmtsvmDL4euzMzp
  2414. .IP \[bu] 2
  2415. Ethereum (ETH): 0x09A166B11fCC127324C7fc5f1B572255b3046E94
  2416. .IP \[bu] 2
  2417. Litecoin (LTC): LXAsq6yc6zYU3EbcqyWtHBrH1Ypx4GjUjm
  2418. .IP \[bu] 2
  2419. ZCoin (XZC): a8L5Vz35KdCQe7Y7urK2pcCGau7JsqZ5Gw
  2420. .SH LINKS
  2421. .IP \[bu] 2
  2422. https://spawn.link
  2423. .IP \[bu] 2
  2424. https://github.com/trapexit/mergerfs
  2425. .IP \[bu] 2
  2426. https://github.com/trapexit/mergerfs\-tools
  2427. .IP \[bu] 2
  2428. https://github.com/trapexit/scorch
  2429. .IP \[bu] 2
  2430. https://github.com/trapexit/bbf
  2431. .IP \[bu] 2
  2432. https://github.com/trapexit/backup\-and\-recovery\-howtos
  2433. .SH AUTHORS
  2434. Antonio SJ Musumeci <trapexit@spawn.link>.