My media server's library grew one drive at a time: three 6 TB drives, then an 8 TB one, each its own filesystem. Every category ended up split four ways. Each Jellyfin library listed four folders, ten shows had seasons on different drives, and the two fullest drives had under 200 GB left while another had 1.7 TB free.
mergerfs fixed that without moving or reformatting anything. It's a union filesystem: it shows
the folders of several drives as one tree, while each file stays whole on one drive. Since October
23, 2026, Jellyfin has seen one folder, /mnt/media.
It is not RAID and not a backup. It adds no redundancy: a dead drive takes its own files with it. What it saves you is that the rest stay readable, and that you never have to think about which drive something is on.
Want the whole setup? See my media server's repo on GitHub (opens in a new tab)
What it does, and what it doesn't
mergerfs runs in user space (through FUSE, the kernel's interface for filesystems written as
ordinary programs). Each drive, called a branch, keeps its own ext4 filesystem. If two branches
both have Movies/, the pool shows one Movies/ with the contents of both.
drive 1: Movies/A.mkv
drive 2: Movies/B.mkv
drive 3: Movies/C.mkv
│
▼
pool: Movies/A.mkv
Movies/B.mkv
Movies/C.mkv
Compared with RAID or ZFS, that's the trade: no parity or striping, so no speed-up and no surviving a failure, but any mix of sizes works, nothing needs reformatting, each drive can be unplugged and read on its own, and removing mergerfs leaves the drives exactly as they were.
Pool folders, not whole drives
Each drive has a media folder, and only those are pooled. Anything else on a drive stays out of
the pool and out of Jellyfin: here, a private Samba share on the 8 TB drive and a holding folder for
files about to be deleted. An old drive that isn't trusted (a WD Green that's expected to fail) holds
scratch space and isn't in the pool at all.
The fstab line
/etc/fstab (the "filesystem table") is the file Linux reads at boot to know what to mount, and
where: one line per mount, giving what to mount, the folder it appears in, its type and options.
sudo mount -a applies it without a reboot, which is how to test a change.
mergerfs is in Ubuntu's apt (sudo apt install mergerfs), and the pool is one line in /etc/fstab,
after the drives' own lines. Shortened to two drives:
/mnt/<drive-1-uuid>/media:/mnt/<drive-2-uuid>/media /mnt/media fuse.mergerfs allow_other,cache.files=off,dropcacheonclose=true,category.create=mfs,moveonenospc=true,minfreespace=50G,fsname=mergerfs,nofail,x-systemd.requires-mounts-for=/mnt/<drive-1-uuid>,x-systemd.requires-mounts-for=/mnt/<drive-2-uuid> 0 0
| Option | Why |
|---|---|
category.create=mfs |
New files go to the drive with the most free space. The one that matters most: see below |
minfreespace=50G |
Never place a new file on a drive with less than 50 GB free (the default is 4 GB) |
moveonenospc=true |
If a drive fills while a file is being written, move it to another and carry on |
cache.files=off |
No page caching in mergerfs itself, which the docs recommend unless an app needs mmap |
dropcacheonclose=true |
Only matters when caching is on, so it does nothing here; harmless, and kept for the day caching is turned on |
allow_other |
Lets users other than root, including the apps in Docker, use the pool. Needed on Ubuntu 24.04's mergerfs 2.33; from 2.35 it's set automatically |
nofail |
Boot even if the pool can't mount |
x-systemd.requires-mounts-for |
One per drive: wait for every drive before building the pool |
Two more pieces keep startup in order. The media stack's systemd unit gets a small add-on file
(a drop-in) with RequiresMountsFor=/mnt/media, so Jellyfin and the download apps never start
against an empty folder if the pool fails to mount; the repo's setup.sh writes it from the pool
path you set. And Docker
here is installed from snap, which can block host paths outside the home directory and /mnt,
so the pool lives under /mnt.
The create policy is the decision that matters
A create policy decides which drive a new file goes on. Existing files never move: the policy only places new ones.
mfs(most free space): the drive with the most room.epmfs(existing path, most free space): only drives that already have the file's folder, then the one with the most room. Theeppolicies are path-preserving: they keep a show's files together on the drives that already hold it.pfrd: a random drive, weighted by free space. The default since mergerfs 2.41 (November 2025); older versions, including Ubuntu 24.04's 2.33, default toepmfs.
Path-preserving sounds like what a media library wants, and it has a cost. A rename is only instant
within one filesystem. If a file is on drive A and you move it into a folder that exists only on
drive B, mergerfs has to return EXDEV (cross-device), and mv, or an app moving a finished
download, falls back to copying the whole file and deleting the original. With an ep
policy that case comes up often, because folders exist on some drives and not others.
With mfs, which isn't path-preserving, mergerfs creates the missing folder on the drive the file
is already on and renames it there, instantly. A show's seasons may end up on different drives, but
the pool hides that, and that was the whole point.
The cost of switching
Jellyfin saw every file at a new path, so it treated all of the roughly 8,000 videos as new and rescanned the whole library. That rescan exposed a CPU-heavy setting, chapter image extraction, covered in tuning Jellyfin on an old server. Plan for a long first scan.
Watch history (what each person has played, and where they stopped) all survived, because I took a backup of Jellyfin before the switch and restored it afterwards. Take one first: it's the cheap insurance against a library that comes back empty.
What it doesn't do
- No redundancy. A dead drive loses its files. SnapRAID can add parity later, but its parity drive must be at least as large as the largest data drive.
- No rebalancing. Existing files stay where they are; only new ones are spread out.
- No speed-up. A file is read from one drive at that drive's speed.
- Hidden placement. To see which drive holds a file, look in each drive's own folder.
The setup guide's pooling section has the steps, and the home-media-server repo has the stack it plugs into.
