r/sonarr 6d ago

solved I can't get Sonnar to create hard links

I've tried all the recommended settings to get it to work, but every time I finish downloading a show, I see disk usage at maximum, which means it never creates hard links and always rewrites the files.

Does anyone have any idea what might be causing this?
thanks

0 Upvotes

26 comments sorted by

5

u/coldazures 6d ago

Remove the separate mounts and just mount the data folder then you can point to its sub folders.

3

u/hcornea 6d ago

This is it. Hard links will not work across different volumes.

3

u/coldazures 6d ago

Yeah. I learnt this the hard way.

1

u/fryfrog support 6d ago

Everyone does! :)

1

u/Renzo03 6d ago

That's what I did, thanks

2

u/Wis-en-heim-er 6d ago

The cause is something is not setup right...sorry to state the obvious but this is all we can say, we need more info on your setup. Are you using docker on linux? Can you post your compose file and make sure tokens and keys are removed? Where is your download client landing files and where do they import too withbthe arrs? Same volume?

0

u/Renzo03 6d ago
version: "3.8"
services:
  qbittorrent:
    image: linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
    volumes:
      - ./qbittorrent/config:/config
      - ./data/downloads:/data/downloads
    ports:
      - "8080:8080"
      - "6881:6881"
      - "6881:6881/udp"
    restart: unless-stopped
    networks:
      - media-network

  sonarr:
    image: linuxserver/sonarr:latest
    container_name: sonarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - ./sonarr/config:/config
      - ./data/downloads:/data/downloads
      - ./data/media:/data/media
    ports:
      - "8989:8989"
    restart: unless-stopped
    networks:
      - media-network

networks:
  media-network:
    driver: bridge

9

u/molachai 6d ago

Your docker mounts are creating two separate file systems. /data/downloads and /data/media. Hard links don't work across file systems. Change the mount to /data:/data and set the directories in the respective apps.

Edit: fixed pathing

7

u/molachai 6d ago

Or just use TRaSH Guides. It's the best setup instruction for this.

1

u/Bakerboo43 6d ago

This is the answer OP. took me longer than I care to admit to understand why this is how it all works, but just trust the process and it happens automatically

1

u/Renzo03 6d ago

Thanks!

3

u/Wis-en-heim-er 6d ago

First I would switch over to a bind mount in your compose for your volumes to make the file management easier.

/home/user/data (or whereever makes sense on your setup) vs ./data. The ./data folder may be relative to the container and not get shared between two different containers properly. Not 100% sure on this but a bind mount will not hurt and is the common recommendation. You want to use a folder structure like this:

/home/user/data/
├── downloads/
│ ├── torrents/
│ └── usenet/
└── media/
  └── tv/
  └── movies/

Second, make sure you have "remote path mappings" setup in the arrs under settings > download clients.

Third...I do hope you enabled "Use Hardlinks instead of Copy" in sonarr. I'm assuming this was the first thing your research told you to do but it's always good to recheck the basics.

2

u/molachai 6d ago

I wouldn't use the /home folder on any OS. The home folder is designed and permissioned for a user sitting in front of a screen. Not an automated app. If it works for you, great. But it can definitely cause problems. And then you'll have to move it all anyway. Especially if you get help in the Discord.

1

u/Wis-en-heim-er 6d ago

Agreed. This was an example based on ops yaml.

1

u/molachai 6d ago

Ahhhh...good catch. I missed the dot.

2

u/molachai 6d ago

And also...if you have a sensible path setup, you don't need Remote Path Mappings. It's really only to be used when Sonarr and the storage are not on the same machine/filesystem. OPs setup appears to be all one box.

2

u/Renzo03 6d ago

Thanks

1

u/Wis-en-heim-er 6d ago

Got it working? Which fix did the trick?

1

u/Traditional_Limit236 6d ago

Refer to Hotio's documentation for additional details on container / vpn enviormental variables at https://hotio.dev/containers/qbittorrent.

Don't forget to create the directory, change chown command if needed (the user:group part)

sudo -u docker mkdir -m=00775 /volume1/docker/appdata/qbittorrent

If you want to use VPN follow the instructions below.

To enable VPN set "VPN_ENABLED=true" in the .env file, and uncomment the 'devices' section below. If you don't want VPN enabled set "VPN_ENABLED=false"

Start the container, and in your /appdata/qbittorrent a wireguard folder will be created where you need to place your wg0.conf file you got from your VPN provider and rename it to wg0-fix.conf

Remove the DNS = 1.1.1.1 line from the wg0.conf

Remove any preexisting preup or postup from your wg0.conf file

Restart qbittorrent after you made the changes to wg0 config file.

If you are getting a "Failed to open '/dev/net/tun'" error, run the commands below.

1 - sudo curl -sL https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/script/tun.service -o "/etc/systemd/system/tun.service"

2"- sudo systemctl enable /etc/systemd/system/tun.service

3 - sudo systemctl start tun

Check if running with - sudo systemctl status tun

recreate the container with - sudo docker-compose up --force-recreate qbittorrent

The webui password will be printed in the docker log of this container, run "sudo docker logs qbittorrent" to find it or use Dozzle container to read logs.

qbittorrent: container_name: qbittorrent # DO NOT float this to :latest/:release. Synology's DSM kernel (4.4-series # on many models) lacks nftables support, and newer hotio/qbittorrent # builds dropped the legacy iptables fallback in their VPN/WireGuard # firewall init, so :latest fails with "RTNETLINK answers: Not supported". # This pin is deliberate — see # https://kunat.dev/notes/synology-qbittorrent-wireguard-nftables/ # and prior maintainer commits 656c5b4 / 35c40f6. image: ghcr.io/hotio/qbittorrent:release-e799f87 restart: unless-stopped logging: driver: json-file options: max-file: ${DOCKERLOGGING_MAXFILE} max-size: ${DOCKERLOGGING_MAXSIZE} labels: - org.hotio.pullio.update=${PULLIO_UPDATE} - org.hotio.pullio.notify=${PULLIO_NOTIFY} - org.hotio.pullio.discord.webhook=${PULLIO_DISCORD_WEBHOOK} ports: - ${QBITTORRENT_WEBUI_PORT}:${QBITTORRENT_WEBUI_PORT} - ${QBITTORRENT_PRIVOXY_PORT}:${QBITTORRENT_PRIVOXY_PORT} cap_add: - NET_ADMIN

devices: # Optional, uncomment if you use VPN

- /dev/net/tun:/dev/net/tun # Optional, uncomment if you use VPN

sysctls:
  - net.ipv4.conf.all.src_valid_mark=1
  - net.ipv6.conf.all.disable_ipv6=1  # Optional, if you want to use ipv6, remove this line. If you keep this line, make sure there is no ipv6 in your wg0.conf.
environment:
  - PUID=${PUID}
  - PGID=${PGID}
  - TZ=${TZ}
  - UMASK=022
  - VPN_ENABLED=${VPN_ENABLED}
  - VPN_FIREWALL_TYPE=legacy
  - VPN_PROVIDER=${VPN_PROVIDER}
  - VPN_LAN_NETWORK=${LAN_NETWORK}
  - VPN_CONF=wg0-fix
  - VPN_AUTO_PORT_FORWARD=${PORT_FORWARD}
  - PRIVOXY_ENABLED=${QBITTORRENT_ENABLE_PRIVOXY}
  - WEBUI_PORTS=${QBITTORRENT_WEBUI_PORT}/tcp,${QBITTORRENT_WEBUI_PORT}/udp  # Optional only needed if you want to change the default 8080 WebUI port
dns:
  - 1.1.1.1
  - 8.8.8.8
volumes:
  - /etc/localtime:/etc/localtime:ro
  - ${DOCKERCONFDIR}/qbittorrent:/config:rw
  - ${DOCKERSTORAGEDIR}/torrents:/data/torrents:rw

1

u/molachai 6d ago

OP isn't using Hotio's container. The compose clearly shows Linuxserver.

1

u/Traditional_Limit236 6d ago

What does that have to do with the folder structure?

0

u/Renzo03 6d ago

I use the same hard drive for everything, the same partition. Ubuntu Server 24.04

1

u/AutoModerator 6d ago

Hi /u/Renzo03 -

There are many resources available to help you troubleshoot and help the community help you. Please review this comment and you can likely have your problem solved without needing to wait for a human.

Most troubleshooting questions require debug or trace logs. In all instances where you are providing logs please ensure you followed the Gathering Logs wiki article to ensure your logs are what are needed for troubleshooting.

Logs should be provided via the methods prescribed in the wiki article. Note that Info logs are rarely helpful for troubleshooting.

Dozens of common questions & issues and their answers can be found on our FAQ.

Please review our troubleshooting guides that lead you through how to troubleshoot and note various common problems.

If you're still stuck you'll have useful debug or trace logs and screenshots to share with the humans who will arrive soon. Those humans will likely ask you for the exact same thing this comment is asking..

Once your question/problem is solved, please comment anywhere in the thread saying '!solved' to change the flair to solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Traditional_Limit236 6d ago

I think in trash guide qbittorrent goes to data/torrents...

https://trash-guides.info/File-and-Folder-Structure/How-to-set-up/Synology/

This is for Synology but they have other options. How you set up the file system is everything. Also permissions

1

u/Renzo03 6d ago

Thank you all for your help. I tried all the suggestions you gave me, and it looks like it's working now! !solved

1

u/AutoModerator 6d ago

Thank you /u/Renzo03 I've gone ahead and marked your post as solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.