Sharing ZFS vdev to Windows computers via smb = not supported?

742 views
Skip to first unread message

Hommie

unread,
Nov 14, 2010, 4:19:28 PM11/14/10
to zfs-fuse
Hi

I am new to zfs-fuse (I just installed it on Ubuntu 10.10 x64), and I
am trying to setup a smb share so that I can mount it on my windows
computers around the house. The ubuntu machine is my media storage/
home theather pc.

I have tried to add the feature like you would do in Opensolaris...

root@Gserver:~# zfs create -o casesensitivity=mixed -o nbmand=on music
cannot create 'music': missing dataset name
root@Gserver:~# zfs create -o casesensitivity=mixed -o nbmand=on gio/
music
root@Gserver:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
gio 144K 1.78T 28.0K /gio
gio/music 28.0K 1.78T 28.0K /gio/music
root@Gserver:~# zfs set sharesmb=on /gio/music
cannot open '/gio/music': invalid dataset name
root@Gserver:~# zfs set sharesmb=on gio/music
protocol smb not supported yet
cannot share 'gio/music': smb add share failed
root@Gserver:~#


any help is appreciated. Thanks

Gavin Chappell

unread,
Nov 14, 2010, 4:36:54 PM11/14/10
to zfs-...@googlegroups.com
As I understand it, there's no "in-kernel" SMB/CIFS server in Linux which is what would normally be used on OpenSolaris, which is why the built-in SMB support in ZFS is broken under zfs-fuse. Sharing with Samba works for me, but at least on my setup, it's very slow. Granted, my setup is built more for its HTPC properties (it's small, Atom-based, and quiet, with small, quiet USB2 disks for zfs-fuse storage) but it's always benchmarked slower than using a better supported fs, and it nowhere near saturates my powerline network adapters (which themselves aren't quite 100mb/s LAN speeds but manage about 90mb/s).

As an example, I was copying Office 2007 from my software backups share onto a laptop earlier for reinstallation, using Teracopy. It reported around 800kb/s for most of the copy, it may have picked up later on but I just left it going and did something else...


--
To post to this group, send email to zfs-...@googlegroups.com
To visit our Web site, click on http://zfs-fuse.net/

ljlj

unread,
Nov 25, 2010, 3:36:53 PM11/25/10
to zfs-fuse
Hommie,

Gavin's right, I think. You're going to need to configure something
separately. If you need Windows connectivity then use Samba (avoid
version 4 since it's still in development afaik); and if you don't
then use NFS, which is quicker.


Gavin,

There is something very wrong in your setup if you get 800kb/s
transfer over a 90/100Mbit link: my DSL syncs at 10Mbit and I get
1.1-1.2MB/s download rate

Over a 100Mbit link the slowness of samba should not be the
bottleneck. You should be able to get pretty close to 9MB/s
throughput; I know that I did (over Samba*). Once you use gigabit
network connections then I think that samba has a more pronounced
effect but I haven't seen it.

You're post implies that you are using USB2 disks; which I take to
mean that the disks are connected via USB2.
USB 2.0 is a max of 480Mbit which would give you approximately a
maximum of 60MB/s (not considering overhead) per controller (which is
obviously going to be less if that bandwidth is shared by multiple
devices connecting to the same USB 2.0 controller). Likewise, two
disks would share the bandwidth which means that each device has
(theoretically) about 240Mbit to play with and so the expected
theoretical transfer rate would be around 30MB/s. In fact, the only
way you could get 800kb/s-1MB/s is if you had around 5 USB 2.0 disks
connected to the same controller; realistically, it would need to be
more like 4 devices taking into account USB, FS and network overhead.

You could always create a RAM drive on the destination system and copy
to that to see if it's a DISK I/O issue on the destination system (or
see what you disk queues look like).



* Sharing between Ubuntu Server 10.04 and Windows 7

Regards,

Luis.

On Nov 14, 9:36 pm, Gavin Chappell <gavin.chapp...@gmail.com> wrote:
> As I understand it, there's no "in-kernel" SMB/CIFS server in Linux which is
> what would normally be used on OpenSolaris, which is why the built-in SMB
> support in ZFS is broken under zfs-fuse. Sharing with Samba works for me,
> but at least on my setup, it's very slow. Granted, my setup is built more
> for its HTPC properties (it's small, Atom-based, and quiet, with small,
> quiet USB2 disks for zfs-fuse storage) but it's always benchmarked slower
> than using a better supported fs, and it nowhere near saturates my powerline
> network adapters (which themselves aren't quite 100mb/s LAN speeds but
> manage about 90mb/s).
>
> As an example, I was copying Office 2007 from my software backups share onto
> a laptop earlier for reinstallation, using Teracopy. It reported around
> 800kb/s for most of the copy, it may have picked up later on but I just left
> it going and did something else...
>

Gavin Chappell

unread,
Nov 25, 2010, 3:55:49 PM11/25/10
to zfs-...@googlegroups.com
You're right, it's a small Atom HTPC system which necessitates USB2 disks (there's only one internal drive bay, and I didn't spring for a model with eSATA or similar as I already had these disks laying around and figured I'd test the "ZFS loves random small, cheap disks" statements....). Being an Atom, there's a single USB bus like so:

root@XBMCLive:~# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/6p, 12M
    |__ Port 3: Dev 2, If 0, Class=HID, Driver=usbhid, 1.5M
    |__ Port 3: Dev 2, If 1, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 2: Dev 6, If 0, Class=stor., Driver=usb-storage, 480M
    |__ Port 4: Dev 3, If 0, Class=stor., Driver=usb-storage, 480M
    |__ Port 5: Dev 4, If 0, Class=stor., Driver=usb-storage, 480M
    |__ Port 6: Dev 5, If 0, Class=stor., Driver=usb-storage, 480M

The destination system is my brand new quad-core i5, 4GB RAM, 1Tb SATA2 disk system (so plenty good specs, and should be little to no fragmentation, the disk is new and still almost empty). I dare say I could get plenty more out of my setup, but it will happily play back 720p (and I think even 1080p but most TV shows aren't encoded that way and I don't have a 1080p set anyway) x264 so there's nothing too wrong on the box itself as 800k/s would cripple that. It's something about my Samba setup I think that drops the speed so much, but it's so rare that I copy stuff off it (only when fixing PCs for friends really) that I've just never bothered fixing it. The only reason I mentioned it was to bring to the OP's attention that just "aptitude install samba" doesn't seem to be enough for good zfs-fuse/Samba performance and it may take more tinkering.

Emmanuel Anne

unread,
Nov 25, 2010, 5:43:28 PM11/25/10
to zfs-...@googlegroups.com
For some reason, nobody took the time so far to do the tinkering...
So if you find ways to improve the samba setup, let us know !

2010/11/25 Gavin Chappell <gavin.c...@gmail.com>



--
zfs-fuse git repository : http://rainemu.swishparty.co.uk/cgi-bin/gitweb.cgi?p=zfs;a=summary

Aneurin Price

unread,
Nov 26, 2010, 7:31:03 AM11/26/10
to zfs-...@googlegroups.com
On Thu, Nov 25, 2010 at 20:55, Gavin Chappell <gavin.c...@gmail.com> wrote:
> You're right, it's a small Atom HTPC system which necessitates USB2 disks
> (there's only one internal drive bay, and I didn't spring for a model with
> eSATA or similar as I already had these disks laying around and figured I'd
> test the "ZFS loves random small, cheap disks" statements....). Being an
> Atom, there's a single USB bus like so:

It does sound like there's something wrong, unless it's one of the
older, very low-powered Atoms.

I have a D510 system with one SATA SSD storing /, swap, and L2ARC, one
SATA HDD as part of my ZFS pool, and 5 USB HDDs as the rest of the
pool. All the devices in the pool are 2-way mirrored. I've just tried
out a selection of tests and even in the worst case my results are far
better than yours.

Copy ZFS to Windows, via Samba:
6-8 MB/s, cold cache
10 MB/s, hot cache

Copy ZFS to Windows, via scp:
9 MB/s, cold cache
18MB/s, hot cache

Copy ZFS to SSD or to /dev/null (so no network involved; saving to the
SSD was just as fast as /dev/null):
15MB/s, cold cache
25MB/s, hot cache

Copy SSD to Windows, via scp:
21MB/s, caching makes no difference, this is purely CPU bound

Copy SSD to Windows, via Samba:
11MB/s, once again this is entirely CPU bound

Note that the files I was copying were too large to fit in RAM, so the
hot cache cases aren't simply a case of reading it straight from page
cache, but it's possible some of the file is cached in memory and some
is probably cached in the L2ARC.

So from that it looks like Samba is the bottleneck in my system
(disappointing that it's half as fast as scp, which is even encrypting
it on the fly), but it's still ten times faster than yours. I haven't
done anything to optimise Samba as I wouldn't even know where to
begin, so unless your Atom is really that much slower than mine I
would imagine there's a problem somewhere (of course if it's good
enough for you, then that's not an issue).

Nye

Andrea Gelmini

unread,
Nov 26, 2010, 9:34:36 AM11/26/10
to zfs-...@googlegroups.com
2010/11/26 Aneurin Price <aneuri...@gmail.com>:

> So from that it looks like Samba is the bottleneck in my system
> (disappointing that it's half as fast as scp, which is even encrypting
> it on the fly), but it's still ten times faster than yours. I haven't

Maybe the point is that SCP can read in big chunk?
Can you try do comment
zfs-prefetch-disable
in /etc/zfs/zfsrc ?

Ciao,
Andrea

Aneurin Price

unread,
Nov 26, 2010, 10:40:30 AM11/26/10
to zfs-...@googlegroups.com

I do already have that commented out, though I've done a bit of
testing with it before and not had particularly conclusive results
either way.

I don't think that's likely to be it though since samba is still far
slower than scp when copying from the SSD, which is far faster than
ZFS.

Anyway samba is fast enough for my needs, but I think the speeds Gavin
is getting would be a different story.

Nye

Nye

Daniel Smedegaard Buus

unread,
Dec 13, 2010, 12:22:43 PM12/13/10
to zfs-fuse
For the record here, I'm sharing my pool via Samba, too, and I'm
experiencing none of these issues.

My read speed from my pool to my other (working, gaming, music making)
computer which are tethered by a 1Gb connection maxes out at just shy
of 75 MBps which I think is more than acceptable for consumer-grade
hardware and a feeble-processor'ed ZFS box (Intel E2200). The write
speed is slower, but that is expected, as it maxes out at just over 50
MB/s locally on the "server".

So definitely there's something wrong, even considering the USB2-
connected devices (sure, that's not as fast as anything internal, but
IMO you should still be able to get throughput somewhere near one
drive connected via USB2).

Question: Is this throughput measured when copying large files? I
helped some other peeps at my previous job with their Win7 boxes, and
there's something seriously broken in Windows 7 with regards to small
files over Samba shares (be they served by Redmond or our beloved
Penguin). Check out 20 MB of SVN source files onto a Samba share in
Windows 7 and you might as well go shopping, it's gonna take hours.
Seems to not affect everyone, but it's affected me and at least two
other people at my old workplace, all with different hardware.

Tip: I'm on Kubuntu 10.10 (Ubuntu's the same). I previously had issues
with Samba performance setting up shares for Windows clients. This
time it was point-and-click (or as close to that as it'll get when in
a terminal ;) and I have awesome performance. Try comparing versions
(my version is 3.5.4), and smb.confs. I'm gonna paste mine right here,
just for reference. Something's just not right with your setup, and
I'm pretty sure it ain't ZFS-FUSE. Didn't really change anything
except enable home shares, AFAIR. Good luck.

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================

[global]

# Them here's for enabling symlinks:
follow symlinks = yes
wide links = yes
unix extensions = no

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will
part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS
Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT
both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host
names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine
is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog.
Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to
log
# through syslog you should set the following parameter to something
higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix
account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the
Unix
# password with the SMB password when the encrypted SMB password in
the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the
following
# parameters must be set (thanks to Ian Kahan <<ka...@informatik.tu-
muenchen.de> for
# sending the correct chat script for the passwd program in Debian
Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*
\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are
mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home
directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the
client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be
stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via
the SAMR
# RPC pipe. The example command creates a user account with a
disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --
gecos "" %u

# This allows machine accounts to be created on the domain controller
via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine
account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via
the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/
speed.html
# for details
# You may want to add the following on a Linux system:
SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup
package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and
samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm
%s' &

# Domain Master specifies Samba to be the Domain Master Browser. If
this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is
recommended.
# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is
disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to
suit)
# to enable the default home directory shares. This will share each
# user's home director as \\server\username
[homes]
comment = Home Directories
browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no

# File creation mask is set to 0700 for security reasons. If you want
to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you
want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# The following parameter makes sure that only "username" can connect
#
# This might need tweaking when using external authentication schemes
valid users = %S

# Un-comment the following and create the netlogon directory for
Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

ljlj

unread,
Dec 14, 2010, 5:50:20 AM12/14/10
to zfs-fuse
That's interesting because I have done testing and found that:
SO_RCVBUF=8192 SO_SNDBUF=8192

absolutely kills performance. If I get some time I'll post details of
what results I got with other config options.

Regards,

Luis.

On Dec 13, 5:22 pm, Daniel Smedegaard Buus <danielb...@gmail.com>
wrote:
> package ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages