Storage & hardlinks
Give every app one folder and imports are instant, use no extra space, and keep your torrents seeding. This page explains why, and how to set it up on a local disk or a NAS.
How it works
From download to library
Pilot asks Haul to download an episode with the category tv. Haul saves
it under /data/torrents/tv with the release's own name. When it
finishes, Pilot imports it into your library with a clean name:
/data ├── torrents/tv/ │ └── Some.Show.S01E01.1080p.WEB-DL.x264-GRP.mkv # 1. Haul downloads here, and keeps seeding it └── media/tv/ └── Some Show (2024)/Season 01/ └── Some Show - S01E01 - Pilot WEBDL-1080p.mkv # 2. Pilot hardlinks it here, renamed
- Nothing is moved. The import is a hardlink: a second name for the same data on disk. It takes no time and no extra space, whatever the file's size.
- Seeding keeps working. Haul still has the file under its original name, so it can seed for as long as you want.
- Removing the torrent is safe. When Haul removes the torrent, only its name goes away. The library copy stays, because the data is freed only when the last name is deleted.
- Your media server only sees the library. Point Plex, Jellyfin or Emby at
media/tvandmedia/movies, never attorrents. - Prism does the same with
torrents/moviesandmedia/movies.
The one rule
Downloads and library in one mount
A hardlink can only be made inside one filesystem, and Docker treats every
volumes: line as its own filesystem. So the folder Haul downloads to and
your library must be inside the same mount, and every app must get that
mount at the same path, /data.
volumes:
- /srv/media:/data # one mount: torrents and library inside it volumes: - /srv/media/tv:/tv # two mounts: every import is a full copy, - /srv/media/downloads:/downloads # even though both are on the same disk
- Same path in every app. Haul tells Pilot where a download is, and Pilot opens that path. If both see the folder at
/data, the paths match and you need no remote path mappings. - If a hardlink can't be made, Pilot and Prism copy the file instead. Imports still work, but they're slow and use twice the space while the torrent seeds.
- Permissions. The apps run as uid/gid 1000. Create the folder before the first start and give it to them, for example
sudo mkdir -p /srv/media && sudo chown -R 1000:1000 /srv/media. A folder Docker creates for you belongs to root, and downloads and imports fail.
Choosing the folder
Local disk or NAS
Any folder works if it's big enough for your library and your downloads together.
- A local disk: pick a folder such as
/srv/mediaand mount it as/datain every app. - A NAS: mount the share on the Docker host once, then mount that folder as
/data. Use NFS if you can: it supports hardlinks. SMB/CIFS mounts often don't, so imports there fall back to copying. - Docker running on the NAS itself (Synology, QNAP, unRAID): use one shared folder for everything, such as
/volume1/dataor/mnt/user/data. Two shared folders are two filesystems as far as hardlinks go. - Config is separate. Each app's
/configholds its database. Keep it on a local disk, not on the NAS, where SQLite can be slow or corrupt its database.
# /etc/fstab on the Docker host: mount the NAS share once
192.168.1.20:/volume1/data /mnt/nas/data nfs defaults,_netdev 0 0 # Every app's compose file then uses that mount as /data
volumes:
- /mnt/nas/data:/data Already have a library?
Use your own folder names
torrents and media/tv are only defaults. If your library
already lives somewhere, mount the folder that contains it as /data and
point the apps at the folders you have. Haul's downloads folder just has to be in
the same mount.
# Your NAS already has a library: Mount the folder that holds it: # /mnt/nas/media/TV - /mnt/nas/media:/data # /mnt/nas/media/Movies # # Then: # Haul HAUL_TORRENT_DOWNLOAD_DIR: /data/torrents # Pilot Settings → Libraries → /data/TV # Prism Settings → Libraries → /data/Movies
After changing a library's folder, run a rescan from that library so Pilot or Prism picks up the files already there.
Check it works
Is it a hardlink or a copy?
After your first import, compare the downloaded file with the library file. A hardlink is the same file, so both names show the same inode number and a link count of 2.
# On the Docker host, after an import. Use your own paths. stat -c '%i %h %n' \ "/srv/media/torrents/tv/Some.Show.S01E01.1080p.WEB-DL.x264-GRP.mkv" \ "/srv/media/media/tv/Some Show (2024)/Season 01/Some Show - S01E01 - Pilot WEBDL-1080p.mkv" # Hardlinked: same inode number (first column), link count 2 (second column) # 1837261 2 /srv/media/torrents/tv/Some.Show.S01E01.1080p.WEB-DL.x264-GRP.mkv # 1837261 2 /srv/media/media/tv/Some Show (2024)/Season 01/Some Show - S01E01 - Pilot WEBDL-1080p.mkv
Different inode numbers and a link count of 1 mean the import was a copy. The table below lists the usual causes.
Troubleshooting
When imports copy or fail
| What you see | Likely cause | Fix |
|---|---|---|
| Imports are slow and disk use doubles | Downloads and library are separate volumes: lines | Mount one parent folder as /data in every app |
| Still copying with one mount | The folders are on different disks, NAS shares or datasets | Move the downloads folder onto the same disk or share as the library |
| Copying on a NAS mount | The share is mounted over SMB/CIFS | Mount it over NFS instead |
| Pilot can't find a finished download | Haul and Pilot mount different host folders, or at different paths | Give both the same host folder at /data |
| "Permission denied" when downloading or importing | The folder belongs to root | sudo chown -R 1000:1000 on the host folder |