Replace file copies with hardlinks

rafpigna

Dabbler
Joined
Dec 6, 2023
Messages
12
Hello

I created my automatic mediaserver (based on *arr apps) successfully on TrueNAS Scale.
unfortunately I made an error configuring datasets and I didnt saw that the files between Radarr/sonarr and Media dataset were just copied, not hardlinked, so doubling my used space.
I downloaded 7 TB of file before seeing this.

Now I fixed the datasets and folders, and hardlinking for new downloads works fine, but I need a solution for the old files!

TrAsh Guides have a solution for that using "Jdupes", but I know that it's suggested to not install additional/external packages on truenas.

My question is: there is a way that I can use to replace about 200 files copies with hardlinks, in a "safe way" on Scale ?

Please note: each "file pair" have different name in two different folders. necause each file is copied to the destination folder using a different naming, so as example:
/mnt/folder1/movie1.mpg was copied in /mnt/folder2/newmoviename.mpg
and now both exists. The goal is that only one will be the actual file on the disk, the other one will be just the link.

Thanks!
 
Top