我们可以在安装的 Windows 共享上使用 unix 硬链接吗?

Pir*_*een 7 linux backup samba rsync cifs

ln命令可以在安装的 Windows 共享上创建硬链接,但cp -al失败。这是预期的行为吗?我试图通过使用cowdancer,rsynccp -al.

backupuser@lan0:/mnt/backup/share$ mkdir a
backupuser@lan0:/mnt/backup/share$ touch a/b
backupuser@lan0:/mnt/backup/share$ cp -al a x
cp: cannot create hard link `x/b' to `a/b': No such file or directory
backupuser@lan0:/mnt/backup/share$ mkdir x
mkdir: cannot create directory `x': File exists
backupuser@lan0:/mnt/backup/share$ ln a/b x/b
backupuser@lan0:/mnt/backup/share$ ls -l x
total 0
-rwxr-xr-x 0 backupuser backupuser 0 Dec 23 17:33 b
Run Code Online (Sandbox Code Playgroud)

更新:ln实际上是在创建副本而不是真正的链接

Dan*_* K. 5

您是否将 SAMBA 作为服务器运行?然后在“smb.conf”中查找“unix extensions”并启用它们。

https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#UNIXEXTENSIONS

启用“unix 扩展”后,SAMBA 支持文件和目录的硬链接、unix 所有权信息和模式(也就是权限)。

但是,此设置是全局设置。因此,启用 unix 扩展会影响所有共享(这可能是也可能不是您想要的)。