iocage hard link issues with radarr and sonarr

Status
Not open for further replies.

PnoT

Dabbler
Joined
Apr 12, 2017
Messages
41
I've recently moved my instances of radarr and sonarr over to iocage jails and have noticed the "Use Hardlinks instead of Copy" option is not working anymore. The way that iocage jails map storage via fstab causes a bit of an issue and those application do not recognize that the storage is on the same file system therefore a copy takes place. The old warden system worded fine because of how the storage was being presented. Post processing and importing has also been extremely slow compared to the app being able to move to the same filesystem in an instance.

Here is what the entry looks like in fstab
Code:
 /mnt/storage/media/TV /mnt/iocage/jails/sonarr/root/mnt/storage/media/TV nullfs rw 0 0  


The path exists as it should be from within the jail but the hard link does not work.

Does anyone know of a workaround for this problem or is my assumption as to why it's not working wrong?
 
Last edited:

PnoT

Dabbler
Joined
Apr 12, 2017
Messages
41
In order to hard link you need to be on the same file system and dataset and I get that but there has to be another way of making this happen. I have to go back through and manually link all of my shows and movies now.
 

intelligence

Explorer
Joined
Jun 2, 2015
Messages
62
They have to be on the same dataset even? Ugh.
How do you manually link btw?

Here's a snippet from my debug log from when the hardlink fails btw:
Code:
18-6-30 17:01:36.2|Debug|EpisodeFileMovingService|Hardlinking episode file: /mnt/Torrents/Completed/Game.of.Thrones.S01.1080p.BluRay.DTS.x264-LiNG/Game.of.Thrones.S01E05.1080p.BluRay.DTS.x264-LiNG.mkv to /mnt/TV/Game of Thrones/Season 1/Game of Thrones - S01E05 - The Wolf and the Lion Bluray-1080p.mkv
18-6-30 17:01:36.2|Debug|DiskTransferService|HardLinkOrCopy [/mnt/Torrents/Completed/Game.of.Thrones.S01.1080p.BluRay.DTS.x264-LiNG/Game.of.Thrones.S01E05.1080p.BluRay.DTS.x264-LiNG.mkv] > [/mnt/TV/Game of Thrones/Season 1/Game of Thrones - S01E05 - The Wolf and the Lion Bluray-1080p.mkv]
18-6-30 17:01:36.2|Debug|DiskProvider|Hardlink '/mnt/Torrents/Completed/Game.of.Thrones.S01.1080p.BluRay.DTS.x264-LiNG/Game.of.Thrones.S01E05.1080p.BluRay.DTS.x264-LiNG.mkv' to '/mnt/TV/Game of Thrones/Season 1/Game of Thrones - S01E05 - The Wolf and the Lion Bluray-1080p.mkv' failed.

[v2.0.0.5228] Mono.Unix.UnixIOException: Cross-device link [EXDEV].
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00005] in <5fe35377bc0849e396be924b07122cf6>:0
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (System.Int32 retval) [0x00004] in <5fe35377bc0849e396be924b07122cf6>:0
  at Mono.Unix.UnixFileSystemInfo.CreateLink (System.String path) [0x0000c] in <5fe35377bc0849e396be924b07122cf6>:0
  at NzbDrone.Mono.Disk.DiskProvider.TryCreateHardLink (System.String source, System.String destination) [0x00013] in <cd50cb4f3a50490d80a10df172583553>:0


I take it this is the same issue you're having?
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Don't know how to fix the hard link issue but I wrote a scipt to install mono 5.12 in an iocage jail and a related script (appinstall.sh) to install sonarr, radarr, lidarr and sabnzbd in that jail. If you give it a try let me know how it worked.
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
I think you can avoid the issue by not mounting the torrents dataset in your sonarr jail and using remote path mapping from your torrent client jail. It can be set under settings - download client at the bottom.
 

intelligence

Explorer
Joined
Jun 2, 2015
Messages
62
I think you can avoid the issue by not mounting the torrents dataset in your sonarr jail and using remote path mapping from your torrent client jail. It can be set under settings - download client at the bottom.

How would one go about to do what you describe here? Could you elaborate and/or perhaps provide examples? Thank you!
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Edited: Not relavant, I looked at my setup and its very weird and not relevant to others so didnt want to keep wrong info.
 
Last edited:

intelligence

Explorer
Joined
Jun 2, 2015
Messages
62
Thank you will look into this asap!

But I'm a little confused by your ending:
Since sonarr is aware its handling the files from 2 different "servers" I don't think it will try to hardlink. See if this fixes your problem. Sonarr should try to access the files through the network so it won't try to hardlink.

I want it to hardlink, it's not currently doing that.

On a side note, I thought this command:
Code:
iocage fstab -a transmission /mnt/Storage/Torrents /mnt/Torrents nullfs rw 0 0


Created a symlink between my transmission jail where it pulls downloads to /mnt/Torrents/Completed – but they will actually end up on the "host" pool (or what you call it) which is /mnt/Storage/Torrents – but that folder is empty, whereas /mnt/iocage/jails/transmission/root/mnt/Torrents/Completed is full of stuff that Sonarr/Radarr downloaded.
 
Last edited:

intelligence

Explorer
Joined
Jun 2, 2015
Messages
62
Hm, yeah that is causing issues now it seems

Code:
Import failed, path does not exist or is not accessible by Sonarr: /mnt/TV/Completed/Series.Name


Every service is being run my my user/group "media" btw.

Code:
media  4903  0.0  0.1 171832 40176  -  SsJ  Sat03   47:37.70 /usr/local/bin/transmission-daemon -g /config/transmission-home -w /mnt/Torrents/Completed -x /var/run/transmission/daemon


wJQinGB.jpg


/mnt/Torrents and /mnt/TV/ are internal paths – the actuals paths from host is /mnt/Storage/Torrents/ and /mnt/Storage/TV/
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
You dont want 2 copies of the files right ? Since hard linking does not work across datasets, we need to use some other way of achieving the same thing. So NO, Im not hard linking because that will not work.
First of, yes you should use internal paths so your setup is correct. The files are not properly mounted thats all.

Explanation:
I think I understand why your having problems with your fstab. An fstab entry IS NOT a symlink or a hardlink. It is more like on linux when you plug in a USB, you can choose where to mount the USB on your filse system. The difference is that a symlink means thats the folders will be "in sync".
Mounting works slightly differently. So you have files inside your sonarr jail correct ? At /mnt/TV, then you added the fstab entry from /mnt/Storage/TV/.
Now the files already inside the /mnt/TV folder inside your jail will NOT sync back to /storage/TV.
You mounted /mnt/storage/TV, which is a empty folder inside a FOLDER called /mnt/TV, since storage/TV is EMPTY, it mounted an EMPTY directory inside a folder that JUST happened to have files. Its not a simple idea but yea theres a slight difference.
Example: Directory 1 called TV has files a,b,c. Directory 2 has file f.
If I fstab directory 1 into 2, then directory 2 will have files a,b,c and f, but TV will not have files a,b,c.

When you add a new file to the folder inside the jail, it doesn't know if you want to save it in local storage or the fstab mount so it uses local. BUT if you put a file into /mnt/Storage/TV it will show up inside the jail.

TLDR if you just want to make it work lol :

Using a empty directory will fix this issue and make them "sync"
If you use a empty directory then the jail knows the local directory is empty and any files added will go to /mnt/Storage/TV

To fix this is quite simple just create a NEW folder inside the jail and mount TV to that using fstab (remove the old entry first and restart the jail).
Here the difference is the folder you are using INSIDE the jail is empty, once this is done then ANY files added to that folder will be saved to /mnt/Storage/TV. So now it ACTS exactly like a Symlink. Then copy the files from INSIDE the jail /mnt/TV to the new folder.
Dont try copying it from FreeNAS root, as far as freenas is concerned those 2 folders are different. The sonarr jail only knows about the "link".
So ssh into the jail when copying/moving the files. Then update sonarr to use the new folder as well and delete any references to the old folder.
Same for transmission, mount to an empty folder first. In the future do your fstab settings first.
 
Last edited:

intelligence

Explorer
Joined
Jun 2, 2015
Messages
62
Hey gt2416, thanks for sticking with me and providing helpful suggestions! In the end I restructured my setup so that everything went in the same dataset so that I could use hardlinking properly. Thanks :)
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Status
Not open for further replies.
Top