Hardlinking issue, same docker volume

Sonarr version (exact version): 2.0.0.5322
Mono version (if Sonarr is not running on Windows): 5.20.1.19
OS: Ubuntu 18.04 LTS (Docker)
Debug logs: https://pastebin.com/HUMAXGBB (sonar.debug.txt)
Description of issue: At import, files are copied instead of hardlinked

In my settings I have:

  • Hardlinking enabled
  • Completed Download Handling
    • Enabled
    • Remove disabled

Also in manual import the hardlink option is also missing:

This is my docker systemd script:

[Unit]
Description=Sonarr docker container
Requires=docker.service
After=docker.service

[Service]
Restart=always
RestartSec=30

ExecStart=/usr/bin/docker run --rm \
                              --name=sonarr \
                              -v /home/florens/sonarr/config/:/config \
                              -v /home/florens/plex/hdd1/:/library \
                              -e PGID=1005 -e PUID=1000  \
                              -e TZ='Europe/Brussels' \
                              --network host \
                              linuxserver/sonarr

ExecStop=/usr/bin/docker stop sonarr

[Install]
WantedBy=multi-user.target

The /library folder has 2 subfolders: downloads and tv so these two are in the same volume.
The gid is my account florens, the gid is media which I use for everything that needs access to the library and downloads folders. I have the same issue when gid is 1000.

florens@flops-server:~$ id florens
uid=1000(florens) gid=1000(florens) groups=1000(florens),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lxd),119(deluge),1005(media)

I tried manually linking a file in a shell in the docker container and that works.

sudo docker exec -i -t sonarr /bin/bash
root@flops-server:/# ls
app  boot    defaults  docker-mods  etc   init  lib64    library  mnt  proc  run   srv  tmp  usr
bin  config  dev       downloads    home  lib   libexec  media    opt  root  sbin  sys  tv   var
root@flops-server:/# rm -rf tv
rm: cannot remove 'tv': Device or resource busy
root@flops-server:/library# ln downloads/Rick.and.Morty.S02.1080p.BluRay.x264-YELLOWBiRD\[rartv\]/Rick.and.Morty.S02E02.1080p.BluRay.x264-YELLOWBiRD.mkv tv/Rick\ and\ Morty/rickandmortytest.mkv

I did notice here that the downloads and tv folders on the root still exist and are unremovable.

An example of a download after import:

florens@flops-server:~/plex/hdd1/downloads/The.Walking.Dead.S09E16.WEB.h264-TBS[rarbg]$ stat the.walking.dead.s09e16.web.h264-tbs.mkv
  File: the.walking.dead.s09e16.web.h264-tbs.mkv
  Size: 526981753       Blocks: 1029272    IO Block: 4096   regular file
Device: 801h/2049d      Inode: 81526881    Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  115/  deluge)   Gid: (  119/  deluge)
Access: 2019-05-13 11:38:56.119112029 +0200
Modify: 2019-05-13 11:38:21.925800183 +0200
Change: 2019-05-13 11:38:21.925800183 +0200
 Birth: -

If it’s any help, I have the same issue with Radarr.

Any help is appreciated. If you need more information, please ask.

We’ll need to see the debug logs of an import, your current logs don’t show anything.

It’s copy or hardlink.

Oh sorry about that, I only turned it on after reading the log faq. I’ll get on that.

Are you saying for manual import that selecting copy should hardlink if that’s enabled?

Thanks to those logs I found that my deluge daemon still had the wrong group which created permission issues.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.