Linux

Ubuntu Xenial (16.04) “zfs share”命令不適用於 SMB 共享

  • November 23, 2017

我在 Ubuntu Xenial (16.04) 上的 ZFS 問題

多年來,我一直在包維護者的 zfsonlinux.org 站點上執行 ZFS。事情一直很好。但是最近我在 Ubuntu 16.04 發佈時升級到了它。我很高興它內置了 ZFS。到目前為止,除了一件事之外,一切都執行良好。

zfs share -a並且zfs share filesystem不工作,因此,每當我重新啟動系統時,zfs-share.service都不會啟用在 ZFS 中配置的 SMB 共享。對於 Debian 8.x 或更早版本的 Ubuntu 以及來自 zfsonlinux.org 的軟體包,我沒有遇到這個問題。

我已將此作為 ZoL 和 Ubuntu 的錯誤送出。我不知道那會走多遠。我不知道這是一個錯誤還是 Ubuntu 或我的問題。所以我也希望這裡的人會有一個想法或者可以確認這是他們也遇到的問題。

ZoL:https ://github.com/zfsonlinux/zfs/issues/4999

Ubuntu:https ://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1615405

有關我的實際問題,請參閱底部。

調試資訊

**沒有股份!**我也在幾台客戶端電腦上進行了驗證 - 這就是發現問題的方式。

root@igor:~# net usershare list
root@igor:~# 

重新啟動後的Systemd zfs-share.status似乎很好

root@igor:~# systemctl status zfs-share
● zfs-share.service - LSB: Network share OpenZFS datasets.
  Loaded: loaded (/etc/init.d/zfs-share; static; vendor preset: enabled)
  Active: active (exited) since Fri 2016-08-19 11:06:32 EDT; 4min 56s ago
    Docs: man:systemd-sysv-generator(8)
 Process: 6432 ExecStart=/etc/init.d/zfs-share start (code=exited, status=0/SUCCESS)
   Tasks: 0
  Memory: 0B
     CPU: 0

Aug 19 11:06:23 igor systemd[1]: Starting LSB: Network share OpenZFS datasets....
Aug 19 11:06:25 igor zfs-share[6432]:  * Sharing OpenZFS filesystems
Aug 19 11:06:32 igor zfs-share[6432]:    ...done.
Aug 19 11:06:32 igor systemd[1]: Started LSB: Network share OpenZFS datasets..

重新啟動後的Systemd smbd.service似乎很好

● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
  Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
  Active: active (running) since Fri 2016-08-19 11:27:44 EDT; 3min 4s ago
    Docs: man:systemd-sysv-generator(8)
 Process: 6629 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)
   Tasks: 4
  Memory: 6.2M
     CPU: 263ms
  CGroup: /system.slice/smbd.service
          ├─6719 /usr/sbin/smbd -D
          ├─6720 /usr/sbin/smbd -D
          └─6743 /usr/sbin/smbd -D

Aug 19 11:27:42 igor systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Aug 19 11:27:44 igor smbd[6629]:  * Starting SMB/CIFS daemon smbd
Aug 19 11:27:44 igor smbd[6629]:    ...done.
Aug 19 11:27:44 igor systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).
Aug 19 11:27:46 igor smbd[6844]: pam_unix(samba:session): session opened for user rbabchis by (uid=0)

數據集配置正確

root@igor:~# zfs get sharesmb pool2/Media
NAME         PROPERTY  VALUE     SOURCE
pool2/Media  sharesmb  on        local
root@igor:~# zfs get sharesmb pool2/home
NAME        PROPERTY  VALUE     SOURCE
pool2/home  sharesmb  on        local

即使我手動分享也沒有任何反應

root@igor:~# zfs share -a
root@igor:~# net usershare list
root@igor:~# ls /var/lib/samba/usershares/
root@igor:~#

共享特定文件系統時已共享消息

root@igor:~# zfs share pool2/home
cannot share 'pool2/home': filesystem already shared

ZFS 程式碼使用 /etc/dfs/sharetab 但 Linux/Samba 不使用(啟動後) https://github.com/zfsonlinux/zfs/issues/190

root@igor:~# cat /etc/dfs/sharetab 
/pool2/home     -       smb     on
/pool2/Media    -       smb     on

strace -y zfs share -a看起來 ZFS 可能沒有嘗試共享數據集,因為它在 /etc/dfs/sharetab 中找到它們,但我可能誤解了這一點。

root@igor:~# strace -y zfs share -a
execve("/sbin/zfs", ["zfs", "share", "-a"], [/* 21 vars */]) = 0
brk(NULL)                               = 0x2372000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfdf000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3</etc/ld.so.cache>
fstat(3</etc/ld.so.cache>, {st_mode=S_IFREG|0644, st_size=128650, ...}) = 0
mmap(NULL, 128650, PROT_READ, MAP_PRIVATE, 3</etc/ld.so.cache>, 0) = 0x7f100dfbc000
close(3</etc/ld.so.cache>)              = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libnvpair.so.1", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libnvpair.so.1.0.1>
read(3</usr/lib/libnvpair.so.1.0.1>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@L\0\0\0\0\0\0"..., 832) = 832
fstat(3</usr/lib/libnvpair.so.1.0.1>, {st_mode=S_IFREG|0644, st_size=80896, ...}) = 0
mmap(NULL, 2175984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</usr/lib/libnvpair.so.1.0.1>, 0) = 0x7f100dba4000
mprotect(0x7f100dbb7000, 2093056, PROT_NONE) = 0
mmap(0x7f100ddb6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</usr/lib/libnvpair.so.1.0.1>, 0x12000) = 0x7f100ddb6000
close(3</usr/lib/libnvpair.so.1.0.1>)   = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libuutil.so.1", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libuutil.so.1.0.1>
read(3</usr/lib/libuutil.so.1.0.1>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340V\0\0\0\0\0\0"..., 832) = 832
fstat(3</usr/lib/libuutil.so.1.0.1>, {st_mode=S_IFREG|0644, st_size=73648, ...}) = 0
mmap(NULL, 2173272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</usr/lib/libuutil.so.1.0.1>, 0) = 0x7f100d98c000
mprotect(0x7f100d99d000, 2093056, PROT_NONE) = 0
mmap(0x7f100db9c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</usr/lib/libuutil.so.1.0.1>, 0x10000) = 0x7f100db9c000
mmap(0x7f100db9e000, 2392, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f100db9e000
close(3</usr/lib/libuutil.so.1.0.1>)    = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libzpool.so.2", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libzpool.so.2.0.0>
read(3</usr/lib/libzpool.so.2.0.0>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320}\2\0\0\0\0\0"..., 832) = 832
fstat(3</usr/lib/libzpool.so.2.0.0>, {st_mode=S_IFREG|0644, st_size=1281576, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfde000
mmap(NULL, 4839192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</usr/lib/libzpool.so.2.0.0>, 0) = 0x7f100d4ec000
mprotect(0x7f100d61d000, 2097152, PROT_NONE) = 0
mmap(0x7f100d81d000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</usr/lib/libzpool.so.2.0.0>, 0x131000) = 0x7f100d81d000
mmap(0x7f100d825000, 1459992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f100d825000
close(3</usr/lib/libzpool.so.2.0.0>)    = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libzfs.so.2", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libzfs.so.2.0.0>
read(3</usr/lib/libzfs.so.2.0.0>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\252\0\0\0\0\0\0"..., 832) = 832
fstat(3</usr/lib/libzfs.so.2.0.0>, {st_mode=S_IFREG|0644, st_size=275968, ...}) = 0
mmap(NULL, 2371208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</usr/lib/libzfs.so.2.0.0>, 0) = 0x7f100d2a4000
mprotect(0x7f100d2e6000, 2093056, PROT_NONE) = 0
mmap(0x7f100d4e5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</usr/lib/libzfs.so.2.0.0>, 0x41000) = 0x7f100d4e5000
close(3</usr/lib/libzfs.so.2.0.0>)      = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libzfs_core.so.1", O_RDONLY|O_CLOEXEC) = 3</usr/lib/libzfs_core.so.1.0.0>
read(3</usr/lib/libzfs_core.so.1.0.0>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\21\0\0\0\0\0\0"..., 832) = 832
fstat(3</usr/lib/libzfs_core.so.1.0.0>, {st_mode=S_IFREG|0644, st_size=14544, ...}) = 0
mmap(NULL, 2109840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</usr/lib/libzfs_core.so.1.0.0>, 0) = 0x7f100d09c000
mprotect(0x7f100d09f000, 2093056, PROT_NONE) = 0
mmap(0x7f100d29e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</usr/lib/libzfs_core.so.1.0.0>, 0x2000) = 0x7f100d29e000
close(3</usr/lib/libzfs_core.so.1.0.0>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libpthread-2.23.so>
read(3</lib/x86_64-linux-gnu/libpthread-2.23.so>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360`\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libpthread-2.23.so>, {st_mode=S_IFREG|0755, st_size=138744, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfdd000
mmap(NULL, 2212904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libpthread-2.23.so>, 0) = 0x7f100ce7c000
mprotect(0x7f100ce94000, 2093056, PROT_NONE) = 0
mmap(0x7f100d093000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libpthread-2.23.so>, 0x17000) = 0x7f100d093000
mmap(0x7f100d095000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f100d095000
close(3</lib/x86_64-linux-gnu/libpthread-2.23.so>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libc-2.23.so>
read(3</lib/x86_64-linux-gnu/libc-2.23.so>, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libc-2.23.so>, {st_mode=S_IFREG|0755, st_size=1864888, ...}) = 0
mmap(NULL, 3967488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libc-2.23.so>, 0) = 0x7f100caac000
mprotect(0x7f100cc6c000, 2093056, PROT_NONE) = 0
mmap(0x7f100ce6b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libc-2.23.so>, 0x1bf000) = 0x7f100ce6b000
mmap(0x7f100ce71000, 14848, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f100ce71000
close(3</lib/x86_64-linux-gnu/libc-2.23.so>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/librt-2.23.so>
read(3</lib/x86_64-linux-gnu/librt-2.23.so>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0!\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/librt-2.23.so>, {st_mode=S_IFREG|0644, st_size=31712, ...}) = 0
mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/librt-2.23.so>, 0) = 0x7f100c8a4000
mprotect(0x7f100c8ab000, 2093056, PROT_NONE) = 0
mmap(0x7f100caaa000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/librt-2.23.so>, 0x6000) = 0x7f100caaa000
close(3</lib/x86_64-linux-gnu/librt-2.23.so>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libuuid.so.1", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>
read(3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\25\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>, {st_mode=S_IFREG|0644, st_size=18976, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfdc000
mmap(NULL, 2113904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>, 0) = 0x7f100c69c000
mprotect(0x7f100c6a0000, 2093056, PROT_NONE) = 0
mmap(0x7f100c89f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>, 0x3000) = 0x7f100c89f000
close(3</lib/x86_64-linux-gnu/libuuid.so.1.3.0>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libz.so.1.2.8>
read(3</lib/x86_64-linux-gnu/libz.so.1.2.8>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\35\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libz.so.1.2.8>, {st_mode=S_IFREG|0644, st_size=104824, ...}) = 0
mmap(NULL, 2199880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libz.so.1.2.8>, 0) = 0x7f100c47c000
mprotect(0x7f100c495000, 2093056, PROT_NONE) = 0
mmap(0x7f100c694000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libz.so.1.2.8>, 0x18000) = 0x7f100c694000
close(3</lib/x86_64-linux-gnu/libz.so.1.2.8>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libm-2.23.so>
read(3</lib/x86_64-linux-gnu/libm-2.23.so>, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0V\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libm-2.23.so>, {st_mode=S_IFREG|0644, st_size=1088952, ...}) = 0
mmap(NULL, 3178744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libm-2.23.so>, 0) = 0x7f100c16c000
mprotect(0x7f100c274000, 2093056, PROT_NONE) = 0
mmap(0x7f100c473000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libm-2.23.so>, 0x107000) = 0x7f100c473000
close(3</lib/x86_64-linux-gnu/libm-2.23.so>) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libblkid.so.1", O_RDONLY|O_CLOEXEC) = 3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>
read(3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\201\0\0\0\0\0\0"..., 832) = 832
fstat(3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>, {st_mode=S_IFREG|0644, st_size=262408, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfbb000
mmap(NULL, 2361576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>, 0) = 0x7f100bf24000
mprotect(0x7f100bf60000, 2093056, PROT_NONE) = 0
mmap(0x7f100c15f000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>, 0x3b000) = 0x7f100c15f000
mmap(0x7f100c164000, 2280, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f100c164000
close(3</lib/x86_64-linux-gnu/libblkid.so.1.1.0>) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfba000
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f100dfb7000
arch_prctl(ARCH_SET_FS, 0x7f100dfb8780) = 0
mprotect(0x7f100ce6b000, 16384, PROT_READ) = 0
mprotect(0x7f100c89f000, 4096, PROT_READ) = 0
mprotect(0x7f100c15f000, 16384, PROT_READ) = 0
mprotect(0x7f100c473000, 4096, PROT_READ) = 0
mprotect(0x7f100c694000, 4096, PROT_READ) = 0
mprotect(0x7f100d093000, 4096, PROT_READ) = 0
mprotect(0x7f100caaa000, 4096, PROT_READ) = 0
mprotect(0x7f100db9c000, 4096, PROT_READ) = 0
mprotect(0x7f100ddb6000, 4096, PROT_READ) = 0
mprotect(0x7f100d29e000, 4096, PROT_READ) = 0
mprotect(0x7f100d81d000, 8192, PROT_READ) = 0
mprotect(0x7f100d4e5000, 4096, PROT_READ) = 0
mprotect(0x617000, 4096, PROT_READ)     = 0
mprotect(0x7f100dfe1000, 4096, PROT_READ) = 0
munmap(0x7f100dfbc000, 128650)          = 0
set_tid_address(0x7f100dfb8a50)         = 7717
set_robust_list(0x7f100dfb8a60, 24)     = 0
rt_sigaction(SIGRTMIN, {0x7f100ce81b90, [], SA_RESTORER|SA_SIGINFO, 0x7f100ce8d3d0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f100ce81c20, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f100ce8d3d0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x2372000
brk(0x2393000)                          = 0x2393000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3</usr/lib/locale/locale-archive>
fstat(3</usr/lib/locale/locale-archive>, {st_mode=S_IFREG|0644, st_size=2977184, ...}) = 0
mmap(NULL, 2977184, PROT_READ, MAP_PRIVATE, 3</usr/lib/locale/locale-archive>, 0) = 0x7f100bc4c000
close(3</usr/lib/locale/locale-archive>) = 0
access("/sys/module/zfs", F_OK)         = 0
access("/sys/module/zfs", F_OK)         = 0
open("/dev/zfs", O_RDWR)                = 3</dev/zfs>
close(3</dev/zfs>)                      = 0
open("/dev/zfs", O_RDWR)                = 3</dev/zfs>
open("/etc/mtab", O_RDONLY)             = 4</proc/7717/mounts>
open("/etc/dfs/sharetab", O_RDONLY)     = 5</etc/dfs/sharetab>
open("/dev/zfs", O_RDWR)                = 6</dev/zfs>
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x04, 0x00), 0x7ffc53b06cc0) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x12, 0x00), 0x7ffc53b06cd0) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x05, 0x00), 0x7ffc53b03680) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x12, 0x00), 0x7ffc53b06cd0) = 0
brk(0x23bf000)                          = 0x23bf000
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x05, 0x00), 0x7ffc53b03680) = 0
brk(0x23af000)                          = 0x23af000
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ENOMEM (Cannot allocate memory)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b00030) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b03660) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x14, 0x00), 0x7ffc53b06c90) = -1 ESRCH (No such process)
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x27, 0x00), 0x7ffc53b038e0) = 0
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x27, 0x00), 0x7ffc53b038e0) = 0
open("/etc/mtab", O_RDONLY)             = 7</proc/7717/mounts>
dup3(7</proc/7717/mounts>, 4</proc/7717/mounts>, 0) = 4</proc/7717/mounts>
close(7</proc/7717/mounts>)             = 0
fstat(4</proc/7717/mounts>, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(4</proc/7717/mounts>, "sysfs /sys sysfs rw,nosuid,nodev"..., 1024) = 1024
read(4</proc/7717/mounts>, "0 0\ncgroup /sys/fs/cgroup/pids c"..., 1024) = 1024
read(4</proc/7717/mounts>, " mqueue rw,relatime 0 0\ndebugfs "..., 1024) = 1024
read(4</proc/7717/mounts>, " 0 0\nhugetlb /run/lxcfs/controll"..., 1024) = 1024
read(4</proc/7717/mounts>, "00,uid=127,gid=136 0 0\ntmpfs /ru"..., 1024) = 99
read(4</proc/7717/mounts>, "", 1024)    = 0
fstat(5</etc/dfs/sharetab>, {st_mode=S_IFREG|0600, st_size=43, ...}) = 0
lseek(5</etc/dfs/sharetab>, 0, SEEK_SET) = 0
read(5</etc/dfs/sharetab>, "/pool2/home\t-\tsmb\ton\n/pool2/Medi"..., 4096) = 43
read(5</etc/dfs/sharetab>, "", 4096)    = 0
lseek(5</etc/dfs/sharetab>, 0, SEEK_SET) = 0
read(5</etc/dfs/sharetab>, "/pool2/home\t-\tsmb\ton\n/pool2/Medi"..., 4096) = 43
lseek(5</etc/dfs/sharetab>, 43, SEEK_SET) = 43
read(5</etc/dfs/sharetab>, "", 4096)    = 0
lseek(5</etc/dfs/sharetab>, 0, SEEK_SET) = 0
read(5</etc/dfs/sharetab>, "/pool2/home\t-\tsmb\ton\n/pool2/Medi"..., 4096) = 43
ioctl(3</dev/zfs>, _IOC(0, 0x5a, 0x3f, 0x00), 0x7ffc53b06dd0) = -1 EPERM (Operation not permitted)
close(3</dev/zfs>)                      = 0
close(4</proc/7717/mounts>)             = 0
close(5</etc/dfs/sharetab>)             = 0
close(6</dev/zfs>)                      = 0
exit_group(0)                           = ?
+++ exited with 0 +++

共享數據集的唯一方法是將sharesmb屬性重置為on

root@igor:~# zfs set sharesmb=on pool2/home
root@igor:~# net usershare list
pool2_home
root@igor:~# zfs set sharesmb=on pool2/Media
root@igor:~# net usershare list
pool2_home
pool2_Media

我的問題

我知道我可以通過在 /etc/rc.local 中添加這些條目來解決這個問題

zfs set sharesmb=on pool2/Main
zfs set sharesmb=on pool2/home

我會的。但是有誰知道為什麼zfs share -a不能按預期工作(一如既往)?有沒有其他人經歷過這個?也許它會影響所有 Ubuntu Xenial 安裝,或者可能只是我。即使沒有修復程序並且這是一個錯誤,我也想知道。

謝謝!

我找到了答案,不幸的是它並不好

我在 ZoL 票務系統上得到了答案。顯然這個問題是已知的,並以某種方式進入了 Ubuntu,而 Ubuntu 讓它飛起來:

https://github.com/zfsonlinux/zfs/issues/4999

恐怕眾所周知的問題。目前在 ZoL 中的 SMB 實現嚴重損壞!我已經完全重寫了它,但是沒有興趣將它合併。

雖然它被稱為一個眾所周知的問題,但它對我來說似乎並不為人所知。事實上它幾個月前就開始工作了,我找不到任何票或Google搜尋結果。

個人咆哮- 如果您對答案感到滿意,請停止閱讀此處。

我不知道 Ubuntu 如何處理這樣的錯誤。我記得以前我管理 RedHat 系統時,他們實際上會修復其他人程式碼中的錯誤。太好了。在 Ubuntu LTS 中有一個“眾所周知的”錯誤真的讓我很煩惱,讓我想知道它們都是其他包,還有哪些其他眾所周知的錯誤被忽略了。

開發者在 github 上的這個 bug 報告中的評論非常有趣。當有可用的更新檔程序時,ZoL 故意在他們的軟體中留下錯誤。過去版本中的更新檔!這讓我非常失望。讓我感到驚訝的是,Ubuntu 不會自己應用更新檔,而是假裝該軟體在他們的新 LTS 版本上執行並且穩定。

引用自:https://serverfault.com/questions/797938