I'm trying to create a hard link but get an error message "Operation not permitted"
tikey@helios64:/data/$ ln /data/dir1/img1.jpg /data/dir2/
ln: failed to create hard link '/data/dir2/img1.jpg' => '/data/dir1/img1.jpg': Operation not permitted
By adding a -s to the command, I can, however, create a softlink. I can also copy the file. So my user has permission to create files in the directory.
Why do I get a permission error when trying to create the hard link and what can I do to prevent it?
Edit - Additional information based on some answers:
The filesystem is ext4 and there is also a bind mount of dir1 on /srv (but unmounting /srv/dir1 does not make any difference):
/dev/md127 on /data type ext4 (rw,relatime,stripe=256)
/data/dir1 on /srv/dir1 type fuse (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
The device is set up as raid 5:
md127 : active raid5 sdc[1] sdb[2] sdd[0]
7813772288 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
bitmap: 0/30 pages [0KB], 65536KB chunk
lsattr for the file shows:
tikey@helios64:/data$ lsattr dir1/img1.jpg
--------------e------- dir1/img1.jpg