With large amounts of disk being available to the average consumer, it's becoming more and more common to build a pool for your home office and serve shared resources to your LAN. This is usually one of the more difficult situations to share files because there are usually many versions of many different operating systems. We'll explore several options below with some hints for clarification on how to make them work.
One thing to keep in mind if sharing a zfs file system over NFS and SMB at the same time is to create your file system with mixed case-sensitivity and nbmand "non-blocking mandatory locking" as in the example below:
$ zfs create -o casesensitivity=mixed -o nbmand=on yourpool/share
NFS
It's very simple to export an NFS share using zfs tools. The command below will allow any host to mount a nfs share.
$ zfs set sharenfs=rw yourpool/yourshare
To restrict the share to a single host execute something like the following:
$ zfs set sharenfs=rw=@192.168.5.1 yourpool/yourshare
Or to restrict the share to a subnet execute the following:
$ zfs set sharenfs=rw=@192.168.5.0/24 yourpool/yourshare
To restrict a NFS share to multiple subnets use a colon followed by an at-sign:
$ zfs set sharenfs=rw=@192.168.5.0/24:@192.168.9.0/24 yourpool/yourshare
Check your work or see the current status with:
$ zfs get sharenfs yourpool/yourshare
Suppose you are migrating a lot of data to OpenIndiana from a GNU/Linux machine. Specifying the version number is necessary if the Linux machines NFS server is v3; the OpenIndiana NFS client defaults to NFSv4.
If you run into problems, check:
MAX_CLIENT_VERISON in the file, /etc/default/nfs
This is the correct way to mount a standard Linux NFSv3 share on OpenIndiana:
$ mount -F nfs -o vers=3,ro linuxhost:/share/stuff /mnt/temp
OS X Clients (NFS)
In order to make OS X clients work properly you'll need to force the client to default to v3 of NFS. As reported in the man page:
For NFS versions that use a separate mount protocol, mount_nfs implements the mount proto-col as described in RFC 1094, Appendix A and NFS: Network File System Version 3 Protocol Specification, RFC 1813, Appendix I.
...
The current NFSv4 functionality is "alpha quality" software. Some basic functionality is not yet implemented. Use at your own risk. Currently, the only way to enable NFSv4 is to specify the mount option:
-o vers=4.0alpha
You can test mounts using the following. These will not be persistent across reboots but will allow you to test the usability of your NFS shares. You'll need to force NFSv3 using the vers=3 option even though the man page says it defaults to that. Things do not work properly when the version is not explicitly set.
$ sudo mount_nfs -o sync -o vers=3 storeageserver:/yourpool/yourshare localmount/
OS X Clients (AFP)
By using the "netatalk" package, you can provide Apple Filesharing Protocol shares to OS X clients, with good support for Time Machine backups.
See this page for more information about Netatalk on OpenIndiana.
CIFS / SMB
To share a zfs file system named "bob" via smb/cifs execute a command like the following below. Note that the share name is arbitrary and can be completely different than the name of the file system itself, as seen in the example below.
$ zfs set sharesmb=name=myshare yourpool/shares/bob
You can set some text description (Windows Explorer shows this text) for the share using this:
$ zfs set "sharesmb=name=myshare,description=My ZFS share" yourpool/shares/bob
To just turn on cifs sharing for a zfs file system without specifying a share name execute a command like the following. Note that the auto-generated names created using this method are usually not user-friendly.
$ zfs set sharesmb=on yourpool/shares/bob
Check your work or check current status with:
$ zfs get sharesmb yourpool/shares/bob
You may need to enable "pam_smb_passwd" to make regular OpenIndiana users have smb passwords. To do so, add the following line to the end of the file "/etc/pam.conf":
other password required pam_smb_passwd.so.1 nowarn
And then change the user's password with the "passwd" command. After this, their smb password will also be set so they can connect via smb with the same username and password.
If you want to use AD to manage your users then take a look at the following
http://docs.oracle.com/cd/E19963-01/html/821-1449/manageidmutm.html#enableidmusupporttask
It allows you to enable IDMU so you can easily keep UIDs and SIDs in sync.
9 Comments
Hide/Show CommentsFeb 20, 2011
Anonymous
you may completely setup and manage OpenIndiana via my free napp-it web-gui
see http://www.napp-it.org/doc/downloads/napp-it.pdf
to setup and configure a OpenIndiana NAS + web-Gui ready to use, login, su to get root permission and enter
wget -O - www.napp-it.org/nappit | perl
to setup and configure a ready to use AFP Server + Timemachine support (netatalk 2.1.5)
wget -O - www.napp-it.org/afp | perl
Manage the whole server via your preferred browser:
http://serverip:81
Gea
Feb 20, 2011
Deano Calver
Its not clear on the web-site (at least the English part) what the license of napp-it? Can you clarify please? in particular its commerical use license (sure I've read its not allowed for that but can't find where I read it now).
Thanks
Feb 21, 2011
Anonymous
about napp-it licence in short
you are allowed to use it for free (also commercially) and you are allowed to modify it.
you are not allowed to sell it or charge money for it.
if you want to sell it (alone or bundeled for example preinstalled on a storage box)
you need a agreement
Gea
Apr 29, 2011
Anonymous
Can someone shed light on the missing of sunwsmb packages in oi repository? Are there copyright issues with the Sun CIFS server? Are these issues permanent?
One reason to use OpenSolaris was that Samba could be avoided as a CIFS server.
Regards,
Sebastian
May 09, 2011
n2deep
will get you the in-kernel CIFS server.
Sep 02, 2011
Anonymous
Is there any way to authenticate CIFS user via LDAP in workgroup mode?
I can successfully configure to authenticate shell users with ldapclinet command.
But those LDAP account can't access to any CIFS share folder which local user can.
I don't like to use domain mode because it requires Windows Active Directory.
Apr 12, 2012
tinta menzi
I keep getting an invalid options error when trying to share with krb5i on an nfs volume (create with the zfs command). Any pointers?
Sep 03, 2012
p
wget -O - www.napp-it.org/nappit | perl <--- works fine to install nappit
How to uninstall/remove nappit?
Sep 22, 2012
Predrag Zečević
In order to get CIFS server working i had to do:
instead just LAST command (as has been explained here): My box runs:
$ head -1 /etc/release
OpenIndiana Development oi_151.1.6 X86 (powered by illumos)
$ optisa $(isainfo)
i386
Regards.