TrueNAS Nightly Development DocumentationThis content follows experimental nightly development software. Pre-release software is intended for testing purposes only.
Use the Product and Version selectors above to view content specific to a stable software release.
Setting Up Data Sharing
9 minute read.
After setting up storage on your TrueNAS, it is time to begin sharing data! There are several sharing solutions available on SCALE, but in this article we discuss the most common.
TrueNAS SCALE provides three types of sharing methods:
- SMB for Windows shares
- NFS for Unix-like shares
- ISCSi block shares
For more information on TrueNAS SCALE shares, see the Shares tutorials.
Regardless of what type of share you create, you need to create the user and dataset for the share.
Share users are those with permissions to access the share. You can create the user before you create the share or after creating the share. Administrators can provision share users using a directory server such as Active Directory or LDAP.
To add non-SMB share users or edit users, go to Credentials > Users to add or edit the user(s). Click Add to create a new or as many new user accounts as you need.
Enter the values in each required field, verify Samba Authentication is selected for SMB share users, then click Save. For more information on the fields and adding users, see Creating User Accounts.
By default, all new users are members of a built-in group called builtin_users. You can use a group to grant access to all users on the server or add more groups to fine-tune permissions for large numbers of users. This approach is particularly useful for high availability (HA) configurations and efficient data sharing across multiple users.
After creating the share user account(s), next create the share and dataset. For iSCSI shares, create the dataset then the share. You can create an SMB or NFS share while creating the dataset or create the dataset while creating the share.
For more information on adding SMB shares, see Adding SMB Shares.
TrueNAS must be joined to Active Directory or have at least one local SMB user before creating an SMB share. When creating an SMB user, ensure that Samba Authentication is enabled. You cannot access SMB shares using the root user, TrueNAS built-in user accounts, or those without Samba Authentication selected.
To set up a basic SMB share:
Create the share and dataset.
a. Go to Shares, then click Add on the Windows (SMB) Shares widget to open the Add SMB configuration screen.
b. Select the dataset mount path or enter it in Path. You can click on the to the left of mnt, and then at the pool to expand the options. Continue expanding until reaching the dataset where you want to add the share dataset. Click on the dataset to populate the field with the full path.
c. Click Create Dataset, enter a name in the Create Dataset dialog, then click Create. The system creates the share dataset and populates both the Path and share Name fields with the name given the dataset. The dataset name becomes the share name.
d. Change any Advanced Options settings you want to customize the dataset and share. Click Enable to set up audit logging, or to change case sensitivity from the default Sensitive setting, then click Save.
Start the SMB service when prompted.
Edit the SMB share permissions to set the share owner and/or group.
a. Click on
Edit Share ACL icon to open the Edit Share ACL screen.b. Select either User in Who, then the user name in User, and then set the permission level using Permissions and Type.
c. (Optional) Click Add then select Group, then the group name, and set the group permissions.
d. Click Save.
Edit the dataset for the SMB share permissions to set the share owner and/or group.
a. Click on
Edit Filesystem ACL icon to open the Edit ACL screen for the dataset.b. Select the Owner and Group and click Apply Owner and Apply Group. With Who set to Owner, set the permission level using Permissions and Type.
c. Click Save.
As of SCALE 22.12 (Bluefin) and later, TrueNAS does not support SMB client operating systems that are labeled by their vendor as End of Life or End of Support. This means MS-DOS (including Windows 98) clients, among others, cannot connect to TrueNAS SCALE SMB servers.
The upstream Samba project that TrueNAS uses for SMB features notes in the 4.11 release that the SMB1 protocol is deprecated and warns portions of the protocol might be further removed in future releases. Administrators should work to phase out any clients using the SMB1 protocol from their environments.
Connect to the share. On a Windows 10 or later system, open the File Browsers and then:
a. Enter
\\
and the TrueNAS system name or IP address in the navigation bar. A login credentials dialog displays.b. Enter the TrueNAS user account credentials you created on the TrueNAS system.
c. Begin browsing the dataset.
For more information on creating NFS shares, see Adding NFS Shares.
To set up NFS sharing:
Add additional packages like
nfs-common
to any client systems that require them.Create the NFS share and dataset.
a. Go to Shares, then click Add on the UNIX (NFS) Share Targets to open the Add NFS configuration screen.
b. Select the dataset mount path or enter it in Path. You can click on the to the left of mnt, and then at the pool to expand the options. Continue expanding until reaching the dataset where you want to add the share dataset. Click on the dataset to populate the field with the full path.
c. Click Create Dataset, enter a name in the Create Dataset dialog, then click Create. The system creates the share dataset and populates both the Path and share Name fields with the name given the dataset. The dataset name becomes the share name.
d. Finish the NFS share configuration if you want to add network and hosts at this time, or click Advanced Options to configure additional settings.
e. Click Save.
Access the dataset. On a Unix-like system, open a command line and enter command
showmount -e {IPADDRESS}
where {IPADDRESS} is your TrueNAS system IP address.tmoore@ChimaeraPrime:~$ showmount -e 10.238.15.194 Export list for 10.238.15.194: /mnt/pool1/testds (everyone)
Make a local directory for the NFS mount. Enter command
sudo mkdir nfstemp/
.tmoore@ChimaeraPrime:~$ sudo mkdir nfstemp/
Mount the shared directory. Enter command
sudo mount -t nfs {IPADDRESS:dataset path}
where {IPADDRESS} is your system IP address and {:dataset path} is the full path displayed in step 3.b. above.tmoore@ChimaeraPrime:~$ sudo mount -t nfs 10.238.15.194:/mnt/pool1/testds nfstemp/
From here,
cd
into the local directory and view or modify the files as needed.
Setting up block sharing is a complicated scenario that requires detailed configuration steps and knowledge of your network environment. A simple configuration is beyond the scope of this getting started guide, but detailed articles are available in the SCALE Tutorials section.
With simple sharing now set up, you can back up your configuration and set up data backup.