Hire me if you like: blake.irvin@gmail.com

Thursday, April 19, 2007

Quickly Sharing a ZFS filesystem with Samba on Solaris 10

Just the commands here, assuming you have a recent distro of Solaris 10 (I was using Solaris Nevada build 55b):

su root


this gets us a list of raw devices to group in our zfs pool

zpool create raidz [name_of_pool] [device1] [device2] [device3]

zfs create [name_of_pool]/[name_of_filesystem]

path to filesystem will be /[name_of_pool]/[name_of_filesystem]

svcadm enable samba

svcs -a | grep samba

this double-checks to make sure samba is up and running properly

svcadm enable swat

svcs -a | grep swat

double-checking again - if any of these services fails or goes to maintenance status,
we can check it's log in /var/svc/log/[full_service_title].log


(or mozilla or any other modern browser installed on the solaris box - firefox comes installed by default now)

We can now navigate to in the browser and configure our Samba shares. Log in as root and don't forget to add new users to the Samba config under the Password heading (unless you need to tie Samba authentication to an NT or Active Directory domain or LDAP).

Create a share with the default User level access, but change the path from the default (/tmp) to /[name_of_pool]/[name_of_filesystem]

From a client machine, navigate to \\[ipaddress]\[sharename] (PC) or smb://[ipaddress]/[sharename] (Mac), authenticate and enjoy!

(Astute readers will not that the web-based SWAT administration tool for Samba is for sissies. However, I wanted to write a tutorial that fairly inexperienced users could follow easily.)