How Hard Links Save Disk Space for Torrents and Media
Hard links allow you to reference a single file from multiple directory locations without creating duplicate copies of the underlying data on your storage drive. This guide explains how hard links function on a filesystem level, why they solve the common storage dilemma between active torrent seeding and organized media libraries (such as Plex or Jellyfin), and the key rules required to use them properly.
What Is a Hard Link?
On modern filesystems (such as ext4, NTFS, XFS, and Btrfs), a file consists of two parts: the actual data blocks stored on the disk, and an inode (index node) that contains file metadata and points to those data blocks. A directory entry is simply a label (the filename and path) mapped to a specific inode number.
When you create a standard file, the system creates one directory entry pointing to one inode. A hard link is an additional directory entry that points directly to an existing inode. Because both directory paths point to the exact same physical storage blocks, creating a hard link consumes virtually zero additional disk space.
The Torrent vs. Media Library Dilemma
Running a home media server alongside a torrent client creates a structural conflict:
- Torrent Clients: Require files to stay in specific download directories with original release names to continue seeding.
- Media Managers (Plex, Jellyfin, Radarr, Sonarr):
Require files to be organized in structured folders (e.g.,
/Movies/Title (Year)/Title (Year).mkv) with clean names to identify metadata correctly.
Without hard links, users typically resort to one of two inefficient methods: - Copying files: Duplicates the data, doubling the storage required (e.g., a 20 GB movie consumes 40 GB across two folders). - Moving files: Breaks the torrent client’s ability to seed the file.
How Hard Links Solve the Problem
By using hard links, you can place a file in your download directory for seeding and simultaneously place the same file in your media library directory with a renamed, organized structure.
- Zero Duplication: A 50 GB 4K video file linked
across both
/torrents/seeding/and/media/movies/only uses 50 GB of physical drive capacity. - Independent Management: You can rename, move, or change permissions on the media library link without corrupting the path or hash expected by the torrent client.
- Safe Deletion: A file’s data blocks are only freed when the link count reaches zero. If you remove the torrent from your client and delete its file, the media library link retains the data intact, and vice versa.
Requirements and Limitations
To successfully use hard links, keep the following constraints in mind:
- Same Filesystem Only: Hard links cannot span across different partitions, drives, or network shares. Both the source and destination directories must reside on the same volume (e.g., within the same partition or pool).
- Not Symbolic Links: Unlike symbolic (soft) links, which merely point to another path string and can break if the source file is moved or deleted, hard links are direct references to the physical data.
- Modifications Affect All Links: If an application modifies the contents within a hard-linked file, the changes will immediately reflect across all linked instances since they share the same physical storage blocks.