Create hardlink across mountpoints possible?

Brownz

Dabbler
Joined
Sep 5, 2017
Messages
23
I am using sonarr and radarr and have noticed I sometimes very rarely have to to tidyup when it fails to correctly manage the files using the 'Remote Path Mappings'. To my knowledge what Sonarr does is once the download client finishes a download it creates a hardlink between:
- download mount point: /mnt/downloads (source)
- media mount point: /mnt/media (destination).

I couldn't find a method inside sonarr/raddarr gui to manage the hardlinks.
I attempted to manually create hardlink like this:
ln /mnt/download/file-01 /mnt/media/file\ 01
but I just get this as a response with no hardlink created:
ln: /mnt/media/file\ 01 # Cross-device link

Although creating the hardlink in the same mountpoint works fine.
I found this link, which supports the fact its a mountpoint issue: Hardlink in FreeNAS?
The last post mensions
The files locations need to both reside on the same dataset though, and if mounted into a jail need to be using the same mountpoint.

So how does sonarr/radarr manage to get arround this limitation?
I really dont want to re-download the files again..how can I accomplish this simple task?
 
Last edited:

dtom10

Explorer
Joined
Oct 16, 2014
Messages
81
Hi @Brownz

It's not a hardlink what sonarr creates as it's not possible to create hardlinks across filesystems. A hardlink is a duplicate reference to the same inode. Inodes exist in the metadata of filesystems. It's like you're trying to create a shortlink (in windows) on your desktop from somebody else's computer without yours having a connection with the other's.

If /mnt/download and /mnt/media are different filesystems(datasets) you won't be able to create a hardlink between them. You need a softlink to do that.
 

Brownz

Dabbler
Joined
Sep 5, 2017
Messages
23
I think normally sonarr does create hardlinks as there is a hardlink option in the settings I have enabled, plus this in the wiki:
An advanced option to hardlink can be enabled (Settings > Media Management > Importing) which will attempt to hardlink the media to your Series folder. A hardlink will allow not use any additional disk space. If the hardlink creation fails, Sonarr will fall back to the default behavior and copy the file.
although in my case it looks like having seperate datasets with hardlinks enabled has forced sonarr/radarr to default copy when I thought it was linking.

Im fearing this, I think Im going to have to move /mnt/downloads -> /mnt/media/downloads, then manually hardlink all the torrents to the media folders. I wish there was a way to manage links inside sonarr/radarr.

- I'm using qbittorrent, anyone know a method to set download location of a torrent based on catagory name (eg. catagory: sonarr - mnt/media/downloads)?
- Anyone know a method like a recursive mass hardlink creation with sonarr style rename (like a script), so I dont need to link each episode of each season manually?
 
Last edited:
Top