Hardlinks on SMB Mount Not Working

Hi,

I am running a TrueNAS Community Edition on my Proxmox machine and I am having trouble getting the hardlink function to work on a separate VM. Full disclaimer, I’m a total beginner and am just an above average PC user.

On the same Proxmox I have a Ubuntu VM which I use as a media server. Inside ubuntu I can hardlink files using the ln command and when I check I can see that it works fine with 2 links to the hardlinked file and the two files having the same inode.
When I do the same operation inside the mounted share however (both files in the same directory), the original file appears to have two links but the new file only has 1 and they have different inodes.

I find some contradicting info on whether hardlinking should work with SMB shares or not and I did try to mount in different ways but I could not get the hardlinking to work.

Am I doing something worng, is there a way to get the hardlink to work like this or do I have to use an NFS mount if I want to use hardlinks?

some additional info:

the way I am currently mounting the truenas to this VM:
sudo mount -t cifs //****/Dataset1 /mnt/truenas -o credentials=/etc/samba/credentials,vers=3.0,hard,nobrl,noserverino,uid=1000,gid=1000

example of how it looks when I try a hard link inside the mounted volume:

ege@mediacenter:/mnt/truenas/test$ touch t1.txt
ege@mediacenter:/mnt/truenas/test$ ln t1.txt t2.txt
ege@mediacenter:/mnt/truenas/test$ ls -la
total 1
drwxr-xr-x 2 ege ege 0 Jul 26 10:54 .
drwxr-xr-x 2 ege ege 0 Jul 26 10:54 …
-rwxr-xr-x 2 ege ege 0 Jul 26 10:54 t1.txt
-rwxr-xr-x 1 ege ege 0 Jul 26 10:54 t2.txt
ege@mediacenter:/mnt/truenas/test$ stat t1.txt t2.txt
File: t1.txt
Size: 0 Blocks: 1 IO Block: 1048576 regular empty file
Device: 0,42 Inode: 114759 Links: 2
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ ege) Gid: ( 1000/ ege)
Access: 2025-07-26 10:54:35.710023600 +0000
Modify: 2025-07-26 10:54:35.710023600 +0000
Change: 2025-07-26 10:54:35.710023600 +0000
Birth: 2025-07-26 10:54:35.709140500 +0000
File: t2.txt
Size: 0 Blocks: 1 IO Block: 1048576 regular empty file
Device: 0,42 Inode: 114762 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ ege) Gid: ( 1000/ ege)
Access: 2025-07-26 10:54:35.710023600 +0000
Modify: 2025-07-26 10:54:35.710023600 +0000
Change: 2025-07-26 10:54:35.710023600 +0000
Birth: 2025-07-26 10:54:35.709140500 +0000

and again it works fine in any other directory than the mount

I’ve hit the same limitation—SMB mounts don’t fully support hardlinks the way local filesystems do, especially on Windows clients. It’s usually a client-side or protocol-level restriction. If you need reliable hardlink behavior, working directly over NFS or SSHFS from a Unix-based client tends to work better. TrueNAS itself handles hardlinks fine internally; it’s the network layer that breaks compatibility.