brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ls -li shows whether Sonarr hardlinked an import or copied it

Arr-suite
~/tips/arr-hardlink-check

ls -li /path/to/downloads/Show.S01E01.mkv /path/to/media/tv/Show/Season\ 01/Show\ -\ S01E01.mkv

Shows whether Sonarr or Radarr hardlinked an imported file or copied it, using the inode and link count.

Sonarr and Radarr say they hardlink your imports, but they also fall back to a plain copy without making a fuss. I like checking it once, because a copy quietly eats twice the disk space, and one command tells you which one you got.

Take a file that was imported from a torrent that is still seeding, and list both copies with the inode number in front:

ls -li /path/to/downloads/Show.S01E01.mkv /path/to/media/tv/Show/Season\ 01/Show\ -\ S01E01.mkv

Look at two things. If the first number (the inode) is the same on both lines, it is one file with two names, so a hardlink. The number after the permissions is the link count: 2 means two names point at the data, 1 means this file is on its own. Two different inodes and a count of 1 on both lines means Sonarr copied the file, and you now pay for it twice.

The Servarr wiki says Sonarr hardlinks when your setup supports it and copies when it does not. The download folder and the library have to be on the same file system, and the containers need to see them under one consistent path. In Docker that usually means mounting one parent folder, not a separate download mount and a separate media mount. The setting itself is Use Hardlinks instead of Copy under Settings, Media Management, and Radarr has the same one.

The TRaSH Guides explain the idea well: a hardlink is just another name for the same blocks on disk, so deleting one name does not touch the other. That is why your torrent client can keep seeding while Sonarr moves on.

This only tells you about files that were imported from a download that is still around. If the client already removed its copy, the link count is 1 and that is perfectly normal. Also check one file, not a whole folder: ls -li on a season folder gives you pages of numbers and the one you want gets lost.

Further reading: Servarr wiki: Sonarr settings, Servarr wiki: Docker guide, consistent paths, TRaSH Guides: Hardlinks and instant moves

Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app

More Arr-suite tips Scene S01E01-E02-E03 Minimum Seeders Add {edition-{Edition Tags}} to the Radarr movie format for director's cuts Sonarr: None, Local Release, UTC Release Date Prowlarr does not sync download clients, so add one only for searches inside Prowlarr All Arr-suite tips (56) All topics

Link