a featureful union filesystem https://trapexit.github.io/mergerfs/
Find a file
Antonio SJ Musumeci 61597c8dfd fix: pick the moveonenospc source and destination correctly
- moveonenospc copied from the branch stored when the file was opened,
  which a move never updates, so a second ENOSPC on the same handle
  tried to copy a path that no longer existed. Find the source branch
  from the fd's device and inode at the start of each move, trying the
  stored branch first. No match leaves the write's ENOSPC in place.
- The source branch was dropped from the create policy's result, so a
  policy returning one branch (ff, mfs, lfs, lus, pfrd) left nothing
  when it picked the source, and a destination that was the source by
  another path (bind mount) was renamed over the file and unlinked.
  Remove every alias of the source before the policy runs, so it picks
  another branch; with no candidate left the move is refused.
- Refuse relocation if a duplicate on another branch could become
  visible once the source is removed, and publish without replacing a
  destination that appeared meanwhile. When the no-replace rename is
  unsupported, publish with link(); a staging name that cannot be
  removed afterwards is logged instead of silently left behind.
- Ask the create policy by the parent directory, as create does. The
  existing-path policies and newest only pick a branch that has the
  path they are given, and the destination has the directory but not
  the file yet.
- TEST_movefile_enospc moves a handle twice and checks duplicates
  through the pool. tests.cpp covers the source by its own path and an
  alias, and every existing-path policy for nested and root files.
2026-11-29 23:10:59 -05:00
.github Remove mkdocs build github workflow 2026-04-19 23:48:13 -05:00
buildtools build: keep the compiler handoff and probe files out of /tmp 2026-11-29 23:10:54 -05:00
debian Fix release builds and drop Debian 11 targets 2026-11-05 15:02:42 -06:00
man Fix manpage links for 2.41.0-rc3 (#1555) 2025-10-29 12:07:49 -05:00
mkdocs fix: pick the moveonenospc source and destination correctly 2026-11-29 23:10:59 -05:00
src fix: pick the moveonenospc source and destination correctly 2026-11-29 23:10:59 -05:00
tests fix: pick the moveonenospc source and destination correctly 2026-11-29 23:10:59 -05:00
tools tools/preload: include correct extended attribute headers on FreeBSD (#1590) 2025-11-25 12:09:41 -06:00
vendored refactor: use free_path_and_update_stat in setattr 2026-11-29 23:10:57 -05:00
.gitignore Build improvements (#1501) 2025-08-04 23:39:52 -05:00
DEPENDENCIES Fix ARMv5 atomic loads from Boost dummy storage 2026-11-14 18:27:14 -06:00
LICENSE Update copyright headers 2026-03-02 01:09:16 -05:00
Makefile build: make NDEBUG=1 and make release build the release profile 2026-11-29 23:10:53 -05:00
mergerfs.spec build: make NDEBUG=1 and make release build the release profile 2026-11-29 23:10:53 -05:00
README.md Fix some links in docs (#1582) 2025-11-18 08:35:27 -06:00

mergerfs - a featureful union filesystem

mergerfs is a FUSE based union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to mhddfs, unionfs, aufs, DrivePool, etc.

Features

  • Logically combine numerous filesystems/paths into a single mount point (JBOFS: Just a Bunch of FileSystems)
  • Combine paths of the same or different filesystems
  • Ability to add or remove filesystems/paths without impacting the rest of the data
  • Unaffected by individual filesystem failure
  • Configurable file selection and creation placement
  • File IO passthrough for near native IO performance (where supported)
  • Works with filesystems of any size
  • Works with filesystems of almost any type
  • Ignore read-only filesystems when creating files
  • Hard links
  • Hard link copy-on-write / CoW
  • Runtime configurable
  • Support for extended attributes (xattrs)
  • Support for file attributes (chattr)
  • Support for POSIX ACLs

Non-features

  • Read/write overlay on top of read-only filesystem like OverlayFS
  • File whiteout
  • RAID like parity calculation (see SnapRAID)
  • Redundancy
  • Splitting of files across branches

How it works

mergerfs logically merges multiple filesystem paths together. Not block devices, not filesystem mounts, just paths. It acts as a proxy to the underlying filesystem paths. Combining the behaviors of some functions and being a selector for others.

When the contents of a directory are requested mergerfs combines the list of files from each directory, deduplicating entries, and returns that list.

When a file or directory is created a policy is first run to determine which branch will be selected for the creation.

For functions which change attributes or remove the file the behavior may be applied to all instances found.

The way in which mergerfs behaves is controlled by the config/options/settings. More specifically by policies.

Visualization

A         +      B        =       C
/disk1           /disk2           /merged
|                |                |
+-- /dir1        +-- /dir1        +-- /dir1
|   |            |   |            |   |
|   +-- file1    |   |            |   +-- file1
|                |   +-- file2    |   +-- file2
|                |   +-- file3    |   +-- file3
|                |                |
+-- /dir2        |                +-- /dir2
|   |            |                |   |
|   +-- file4    |                |   +-- file4
|                |                |
|                +-- /dir3        +-- /dir3
|                |   |            |   |
|                |   +-- file5    |   +-- file5
|                |                |
+-- file6        |                +-- file6
+-- file7        +-- file7        +-- file7

QuickStart

https://trapexit.github.io/mergerfs/latest/quickstart/

Documentation

https://trapexit.github.io/mergerfs

Support

https://trapexit.github.io/mergerfs/latest/support/

Sponsorship and Donations

https://github.com/trapexit/support

Development and support of a project like mergerfs requires a significant amount of time and effort. The software is released under the very liberal ISC license and is therefore free to use for personal or commercial uses.

If you are a non-commercial user and find mergerfs and its support valuable and would like to support the project financially it would be very much appreciated.

If you are using mergerfs commercially please consider sponsoring the project to ensure it continues to be maintained and receive updates. If custom features are needed feel free to contact me directly.