have recently gotten mergerfs setuped but my hardlinks seems to fail now. does someone else use mergerfs and has gotten hardlinks to work?
5 replies
Chris wrote:
Hey noahlol01! This sounds like a common mergerfs gotcha rather than anything wrong with SparkBox itself. A hardlink can only be made between two files sitting on the exact same physical drive underneath the pool — if your downloads folder and your library folder happen to land on different drives inside the mergerfs setup, a hardlink between them just isn't possible (some setups quietly fall back to a full copy instead, which eats extra space). Worth checking whether those two folders are actually landing on the same drive under the hood. If they are and it's still failing, let us know the exact error you're seeing and we'll dig in further.
noahlol01 wrote:
ah forgot to put in my mergerfs config from fstab /mnt/data /mnt/storage fuse.mergerfs defaults,allowother,useino,cache.files=partial,dropcacheonclose=true,ignorepponrename=true,category.create=mfs,minfreespace=10G,fsname=mergerfs 0 0
Chris wrote:
Good catch pulling that up! That mfs setting (category.create=mfs) is actually the piece explaining this — mergerfs picks whichever physical drive has the most free space each time a brand-new top-level folder gets created, not based on where related files already live. So your downloads folder and your library folder can easily end up on two different physical drives without you doing anything wrong, and that's exactly when a hardlink can't be made. The usual fix is switching that one setting to category.create=epmfs instead — it tells mergerfs to prefer a drive where the folder already exists, keeping related files together. Worth a try!
inthecloud wrote:
I've had some fun with this myself and still not got it 100%, a couple of sites I found useful (hope it's OK to post links) are, https://www.reddit.com/r/radarr/comments/o3aihq/psahardlinksfixedonmergerfswithmountoption/ and https://trapexit.github.io/mergerfs/latest/faq/technicalbehaviorandlimitations/ Hope this helps.....
Chris wrote:
Thanks for jumping in and sharing those, inthecloud! mergerfs + hardlinks can behave differently depending on each person's pool layout and category.create setting, so what fixed noahlol01's case might not be the whole story for yours. If you're still not at 100%, feel free to open your own thread with your fstab line and the exact folders that won't hardlink — happy to dig into your specific setup rather than guessing at it here.