I have a CIFS network mount (ext4 on Synology NAS share), and I can't work out why I can't make hard links on that volume – the command is successful and results in a new file, but the new file has its own new inode:
cd /mnt/ds220j
touch hardlinktest.txt
ln hardlinktest.txt hardlinktest2.txt
ls -li .
=>
1895784 -rwxrwx--- 1 dietpi dietpi 0 Aug 8 09:54 hardlinktest2.txt*
1895763 -rwxrwx--- 2 dietpi dietpi 0 Aug 8 09:54 hardlinktest.txt*
find . -type f -links 2
=>
./hardlinktest.txt
find . -type f -samefile ./hardlinktest.txt
=>
./hardlinktest.txt
ls -li .
=>
1895784 -rwxrwx--- 1 dietpi dietpi 0 Aug 8 09:54 hardlinktest2.txt*
1895763 -rwxrwx--- 1 dietpi dietpi 0 Aug 8 09:54 hardlinktest.txt*
Curiously, the links count initially increments to 2 on the original file, and I can find it using find -links 2
, but then afterwards the links count reverts to 1 again and find -links 2
comes back empty.
Mount options via /proc/mounts:
//REDACTED-IP/GLaDOS /mnt/ds220j cifs rw,relatime,vers=3.1.1,cache=strict,username=REDACTED,uid=1000,noforceuid,gid=1000,noforcegid,addr=REDACTED,file_mode=0770,dir_mode=0770,iocharset=utf8,soft,nounix,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=5 0 0
For what it's worth, hard links on the root fs do work just fine.
Any help greatly appreciated 🙏