You are not logged in.

#1 2014-08-18 16:47:46

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

[SOLVED] ZFS sharesmb

I have a rather simple NAS setup that was converted recently to ZFS.
For windows sharing I still have the samba installed but I see that I can also have zfs directly publish SMB or CIFS devices. I consulted the oracle docs in http://docs.oracle.com/cd/E19253-01/819 … index.html and the arch wiki.

When on

$ sudo zfs list
NAME           USED  AVAIL  REFER  MOUNTPOINT
zdata         1.48T  1.19T  41.9K  /mnt/zdata
zdata/backup   177G   323G   177G  /srv/backup
zdata/media   1.25T   216G  1.25T  /srv/media
zdata/sw      50.5G  49.5G  50.5G  /srv/software

I try

$ sudo zfs set sharesmb=on zdata/media

I get following error

cannot share 'zdata/media': smb add share failed

I looked in dmesg but couln't find anything specific to this, nor in journalctl

What could be the cause of this

Last edited by theking2 (2015-01-18 14:54:22)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#2 2014-08-18 18:26:14

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] ZFS sharesmb

ZFSonLinux does not implement SMB itself; it just adds/removes shares to an SMB provider. It's trying to add a share to your provider, but that fails - at a guess I'd say your SMB provider (samba?) is not running.

Offline

#3 2014-08-18 18:35:57

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,458

Re: [SOLVED] ZFS sharesmb

Yes, I guess you need to edit samba.conf.
And, I may have a more decent/recent guide for you from the same club: http://docs.oracle.com/cd/E23824_01/htm … gayne.html

Offline

#4 2014-08-20 01:54:00

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

Re: [SOLVED] ZFS sharesmb

Thank you both.

Interesting (but a bit confusing). I already had this

[media]
   comment = Media files
   path = /srv/media
   browseable = yes
   guest ok = yes
   writable = yes

in my smb.conf.

For my understanding what is the effect of sharesmb=on? Is it required for a mounted volume to share over samba?

Or is it a way of sharing a volume without mounting it localy?

Last edited by theking2 (2014-08-20 01:57:23)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#5 2014-08-20 09:12:43

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,458

Re: [SOLVED] ZFS sharesmb

theking2 wrote:

Or is it a way of sharing a volume without mounting it localy?

I don't use samba myself, but yes, that is what I understand from: http://zfsonlinux.org/faq.html#HowDoISetupShares

Offline

#6 2014-12-16 20:49:50

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

Re: [SOLVED] ZFS sharesmb

I'm still confused why or if I should set up shares on both zfs AND on smbd.conf. Do I set this in both? or only one? why would I need a sharesmb if it already is shared in smbd.conf should I remove these from smbd.conf and only specify sharesmb in zfs? Should I set them up in both? and when so why?

It is confusing that one need to setup share in two just remotely connected places.

Puzzled


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#7 2014-12-22 11:58:30

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,458

Re: [SOLVED] ZFS sharesmb

According to that page(see #5) you need to set only one.

You can share a ZFS file system by setting the sharenfs or sharesmb file system property.

Offline

#8 2014-12-23 16:38:49

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

Re: [SOLVED] ZFS sharesmb

In smb.conf I have

[backup]
   comment = Bakcup Files
   path = /srv/backup
   browseable = yes
#   guest ok = yes
   writable = yes

How do I configure this with zfs sharesmb? Apart from zfs set sharesmb=on

EDIT---
BTW:

$ sudo zfs get sharesmb
NAME          PROPERTY  VALUE     SOURCE
zdata         sharesmb  off       local
zdata/backup  sharesmb  off       local
zdata/media   sharesmb  off       local
zdata/sw      sharesmb  off       local

although sharesmb is off I can access the share from a Win box.

Last edited by theking2 (2014-12-23 16:49:31)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#9 2014-12-23 18:34:53

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,060
Website

Re: [SOLVED] ZFS sharesmb

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2014-12-23 21:56:12

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,458

Re: [SOLVED] ZFS sharesmb

Well, I guess that's because smb.conf is set. Name it smb.bak.
Then set the share again for zfs,  'sudo zfs set sharesmb=on share/path'.
I,m not familiar with this, so I could be wrong..

Offline

#11 2015-01-18 14:53:59

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

Re: [SOLVED] ZFS sharesmb

I've switch off sharesmb from all the datasets and instead user smbd.conf to share the mounted volumes which seems to work just fine..


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#12 2016-05-18 17:55:58

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] ZFS sharesmb

I don't mean to necro bump this thread, but it turns up as first result on the big G, and beeing marked as solved it deserves an actual solution.

Configure /etc/samba/smb.conf

[global]
...
   usershare path = /var/lib/samba/usershares
   usershare max shares = 100
   usershare allow guests = yes
   usershare owner only = no

Create that usershare directory and set proper permissions on it. As root:

mkdir /var/lib/samba/usershares
chmod +t /var/lib/samba/usershares

Create users using smbpasswd, restart smbd. Works.

Offline

Board footer

Powered by FluxBB