I've recently tested this using Windows 10 Pro as the server. My Linux system is running CentOS 7, which as of today ships Samba 4.4.4. Hardlink works well just like on a local file system.
Tests:
/mnt/f/tmp# mkdir a
/mnt/f/tmp# touch a/b
/mnt/f/tmp# cp -al a x
/mnt/f/tmp# stat a/b
File: ‘a/b’
Size: 0 Blocks: 0 IO Block: 16384 regular empty file
Device: 28h/40d Inode: 1688849861497214 Links: 2
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ yanli) Gid: ( 1000/ yanli)
Context: system_u:object_r:cifs_t:s0
Access: 2017-05-17 14:31:43.564755100 -0700
Modify: 2017-05-17 14:31:43.564755100 -0700
Change: 2017-05-17 14:31:46.571727600 -0700
Birth: -
/mnt/f/tmp# stat x/b
File: ‘x/b’
Size: 0 Blocks: 0 IO Block: 16384 regular empty file
Device: 28h/40d Inode: 1688849861497214 Links: 2
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ yanli) Gid: ( 1000/ yanli)
Context: system_u:object_r:cifs_t:s0
Access: 2017-05-17 14:31:43.564755100 -0700
Modify: 2017-05-17 14:31:43.564755100 -0700
Change: 2017-05-17 14:31:46.571727600 -0700
Birth: -
/mnt/f/tmp# echo something >a/b
/mnt/f/tmp# cat x/b
something
/mnt/f/tmp# mount | grep /mnt/f
//192.168.1.7/f on /mnt/f type cifs (rw,nosuid,nodev,noexec,relatime,vers=1.0,cache=strict,username=redacted,domain=REDACTED,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.7,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1,user)
As you can see, file a/b
and x/b
have the same Inode number, indicating that they are hardlinks to the same Inode. Changing the content of one file affects the other file too.
ln
works correctly too.
No special option was used to mount the CIFS; every option was default. I didn't do anything special on the Windows side either. It's just a default installation of Windows 10 Pro and a plain shared folder.
What I do not know yet is when this feature was added to CIFS/Samba client/Windows.
OP only said "Windows share", so it's not clear what version of Windows/Samba s/he was running. I hope my answer can help those who have trouble with creating hardlinks on CIFS mounted share backed by a Windows server; you may solve the problem by upgrading to Windows 10 Pro and at least Samba 4.4.4 (CentOS is not known for shipping the shiniest and latest code).