1

I turn on sharenfs for ZFS file system, but after reboot it is not shared. And I need to turn file system share again.

Here how it looks:

user@ht ~ $ sudo zfs get sharenfs
NAME          PROPERTY  VALUE     SOURCE
family        sharenfs  off       local
family/album  sharenfs  on        local

As you can see sharenfs is on. But file system is not shared:

user@ht ~ $ showmount -e 
Export list for ht:
user@ht ~ $

When I set sharenfs again. File system is shared and I can mount it:

user@ht ~ $ sudo zfs set sharenfs=on family/album
user@ht ~ $ showmount -e 
Export list for ht:
/media/user/family/album *

UPD

My system is Linux Mint 18.0

$ uname -a
Linux kes-desktop 4.8.0-30-generic #32~16.04.1-Ubuntu SMP Fri Dec 2 03:43:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

UPD2

I expect it is shared automatically according to doc

ZFS can automatically share file systems by setting the sharenfs property.

UPD3

$ cat /etc/default/zfs
ht default # cat zfs
ZFS_AUTOIMPORT_TIMEOUT='30'
ZFS_SHARE='no'
ZFS_UNSHARE='no'
ZFS_DKMS_ENABLE_DEBUG='no'
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'
ZFS_DKMS_DISABLE_STRIP='no'
3
  • Do you have the /etc/default/zfs file? If not, best would be to read this post. – Thomas Jan 8 '17 at 14:20
  • If you installed zfs form the Ubuntu repositories, there is a file /etc/default/zfs and by default ZFS_SHARE='no' and ZFS_UNSHARE='no' is disabled which does not automatically export your pool, no matter if you have set sharenfs or not on your pool. So, it would be helpful to know the settings you have in that file. – Thomas Jan 8 '17 at 15:36
  • @Thomas In my file those settings are no – Eugen Konkov Jan 8 '17 at 17:27
6

You have to set the following options in /etc/default/zfs.

ZFS_SHARE='yes'
ZFS_UNSHARE='yes'

This will start the NFS exports of zfs pools which additionally have the sharenfs set to on or valid NFS export options.

I also would recommend to read this documention.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.