A Hardlink Can't Cross Mounts, So Downloads and Media Libraries Must Share One Mount
A hardlink is a second name for the same file: one more directory entry pointing at the same inode, not a copy. Both names share the data blocks; the blocks are freed only when the last name is removed. That is why a media stack can keep a file seeding in downloads/ and show it in movies/ while storing it once.
The Kernel Refuses Links Between Mounts
link() only works when both names are on the same mount. Across two mounts, it fails with EXDEV, and Linux applies this even when the same filesystem is mounted twice. A mv between two mounts has the same limit: it can't rename, so it copies and then deletes.
In containers, every volume is its own mount. If one app gets /downloads and another /movies as two separate volumes, even of the same NFS export, an import can't link or rename: the app falls back to a full copy, which doubles the space used and takes minutes instead of milliseconds.
Give Every App the Same Single Mount
- One share (one dataset) holding both trees, for example
/data/torrents,/data/usenetand/data/media. - Mounted once per container, at the same path in every app (
/data), so the paths the download client reports are valid in the importer too. - Subfolders are chosen inside the app's settings, not as extra volume mounts.
Torrents Get a Hardlink, Usenet Gets a Move
The importer (Sonarr, Radarr) only hardlinks a download that has to stay where it is: a torrent that is still seeding. A Usenet download, or a torrent that has finished seeding, is moved into the library instead. On one mount that move is a rename: instant, no extra space, and no copy left behind, so the imported file has link count 1 and its download folder is empty. That is the expected result, not a failed hardlink. The single mount still matters for Usenet: across two mounts the move becomes a copy followed by a delete.
To prove a Usenet-only stack could hardlink (for the day a torrent client runs), link a dummy file across the two trees as the apps' user and check both names show the same inode with link count 2.
Check That Links Exist
A hardlinked file has a link count above 1 (ls -l second column, stat -c %h), and both names show the same inode number (ls -i). To count across a library:
find /data/media -type f -size +100M -links +1 | wc -l # hardlinked
find /data/media -type f -size +100M -links 1 | wc -l # standalone copies
du counts a hardlinked file once per run, under the first path it meets, so du -sh downloads movies makes the libraries look nearly empty.
References
- link(2), Linux manual page - primary source:
EXDEVis returned across mounts, even for one filesystem mounted twice. - Servarr Wiki: Sonarr settings - primary source for "Use Hard links instead of Copy": hardlinks are for files from torrents still being seeded (last checked 2026-11).
- Sonarr forums: Copy seeding torrent files instead of hardlink - a maintainer's answer: completed downloads are moved (Usenet, finished torrents) or copied/hardlinked (seeding torrents).
- TRaSH Guides: Hardlinks and Instant Moves - the single
/datalayout most media stacks follow, and its limits (no directory links, no links across mounts). Last checked 2026-11. - Files Written to an Unmounted Container Path Live Only in That Container's Layer - the other path trap in a media stack.
- Kubernetes MOC - hub for Kubernetes notes.
- Homelab v2 Rebuild - where the share's hardlinks were checked (2026-11-23).
Review cards
Flashcard Why can't a media importer hardlink from `/downloads` to `/movies` when they are two volumes of the same NFS export?
Each volume is a separate mount, and link() fails with EXDEV across mounts even when the filesystem underneath is the same. The app falls back to copying.
Flashcard How should download and library folders be mounted in a media stack so imports are instant?
One share holding both trees, mounted once per container at the same path in every app (for example /data), with subfolders chosen in the apps' settings.
Quiz `du -sh downloads movies` shows 1.3 TB and 3 GB, yet `movies` holds dozens of films. What is the likeliest explanation?
- The films are sparse files
- The films are hardlinks into
downloads, whichducounts once, under the first path - NFS reports sizes from the server's cache
du counts each inode once per run. Check with find movies -type f -links +1.
Quiz After a Usenet download is imported into a library on the same `/data` mount, the file shows link count 1 and the download folder is empty. What happened?
- The hardlink failed and the importer copied the file
- The importer moved it: an instant rename, because nothing has to keep seeding
- The download client deleted its copy before the import
Importers hardlink only torrents that are still seeding; Usenet downloads are moved. A copy would have been slow and left a second file until cleanup.