我一直在尝试通过几个看似简单的步骤使用 Samba 让 zfs 在网络上共享自身。我首先安装了 zfs 和 Samba,然后创建了一个池,一切运行正常。接下来我进行了修改smb.conf
以添加以下属性(然后重新启动了服务):
usershare path = /var/lib/samba/usershares
usershare max shares = 100
usershare allow guests = yes
usershare owner only = no
接下来我运行sudo pdbedit -a username
添加新的 Samba 用户。最后我运行sudo zfs set sharesmb=on storage
(storage
我的池名称在哪里)。整个过程中没有出现任何错误,但在尝试连接时没有出现任何共享。
使用节目连接smbclient -L localhost
:
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (fruitydelight server (Samba, Ubuntu))
此外,sudo net usershare list
没有显示任何结果,也没有用户共享文件/var/lib/samba/usershares
。
明确运行sudo zfs share storage
表明以下内容,我认为这表明 zfs 确实认为它实际上正在正确共享它:
cannot share 'storage': filesystem already shared
是我做错了什么还是这只是 Samba 与 zfs 集成的一个问题?
有关其他信息,我使用的是 Ubuntu Server 18.04,我的 zfs 版本是0.7.5-1ubuntu16.6
,我的 Samba 版本是Version 4.7.6-Ubuntu
。输出sudo testparm
如下所示:
[global]
deadtime = 30
disable spoolss = Yes
dns proxy = No
load printers = No
log file = /var/log/samba/log.%m
map to guest = Bad User
max log size = 1000
min receivefile size = 16384
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
printcap name = /dev/null
server min protocol = SMB2
server role = standalone server
server string = %h server (Samba, Ubuntu)
show add printer wizard = No
syslog = 0
unix password sync = Yes
usershare allow guests = Yes
usershare owner only = No
idmap config * : backend = tdb
aio read size = 1
aio write size = 1
printing = bsd
smb encrypt = desired
use sendfile = Yes
write cache size = 262144