My problem with ZFS on Ubuntu Xenial (16.04)
I've been running ZFS for years from the package maintainer's zfsonlinux.org site. Things have been good. But recently I upgraded to Ubuntu 16.04 when it came out. I was excited that it had ZFS built in. And so far everything is working great except one thing.
zfs share -a
and zfs share filesystem
don't work and because of that, whenever I reboot the system, zfs-share.service
does not enable my SMB shares configured in ZFS. I did not have this problem with Debian 8.x or older versions of Ubuntu with the packages from zfsonlinux.org.
I've submitted this as a bug with ZoL and Ubuntu. I have no idea how far that will go. I don't know if it's a bug at all or a problem with Ubuntu, or me. So I'm also hoping someone here will have an idea or can confirm this as a problem they're having too.
ZoL: https://github.com/zfsonlinux/zfs/issues/4999
Ubuntu: https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1615405
See at the bottom for my actual question.
Debugging info
No shares! I verified on several client computers too - that's how the problem was discovered.
root@igor:~# net usershare list
root@igor:~#
Systemd zfs-share.status
after a fresh reboot seems fine
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
after a fresh reboot seems fine
● 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)
Datasets are configured properly
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
Even when I share manually nothing happens
root@igor:~# zfs share -a
root@igor:~# net usershare list
root@igor:~# ls /var/lib/samba/usershares/
root@igor:~#
Already shared message when I share a specific filesystem
root@igor:~# zfs share pool2/home
cannot share 'pool2/home': filesystem already shared
ZFS code uses /etc/dfs/sharetab but Linux/Samba don't (after boot) 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 It looks like ZFS could be making no attempt to share the datasets because it finds them in /etc/dfs/sharetab, but I could be misinterpreting that.
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 +++
The only way to get the datasets shared is to reset the sharesmb
property to 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
My question
I know I can fix this by adding these entries in /etc/rc.local
zfs set sharesmb=on pool2/Main
zfs set sharesmb=on pool2/home
And I will. But does anyone know why zfs share -a
doesn't work as intended (as it always did)? Has anyone else experienced this? Perhaps it affects all Ubuntu Xenial installs or perhaps it's just me. Even if there's no fix and it's a bug, I'd like to know.
Thanks!
I found my answer and unfortunately it's not good
I got an answer on the ZoL ticket system. Apparently this issue is known and somehow made it into Ubuntu and Ubuntu let it fly:
https://github.com/zfsonlinux/zfs/issues/4999
Though it's stated as a well known problem, it's doesn't seem so well known to me. It fact it was working a few months ago and I couldn't find any tickets for it or google results.
Personal rant - stop reading here if you're happy with the answer.
I don't know how Ubuntu deals with bugs like this. I remember way back when I used to manage RedHat systems and they would actually fix bugs in other peoples code. It was great. Having a "well known" bug in Ubuntu LTS really bugs me and makes me wonder about all of they're other packages and what other well known bugs are in there that are being ignored.
The comments made by a developer in this bug report on github are quite interesting. ZoL is intentionally leaving bugs in their software when they have patches available. Patches which were in past versions! This is very disappointing to me. And it surprises me that Ubuntu would not apply the patches themselves, rather than pretend that the software is working and stable on their new LTS release.
I recently came across this after updating one of my storage boxes from 14.04 to 16.04
Curiously, I did not encounter this on the first box I updated, though that was a clean re-installation rather that a dist-upgrade.
I found the main problem was that despite all the sharesmb=on parameters being set, there was no entry for the usershare in /var/lib/samba/usershares/
So, I just created one manually using the other box's file as a template, restarted samba, and voila, it all works again.
Very kludgy, though.