TrueNAS SCALETrueNAS SCALE Nightly Development Documentation
This content follows experimental early release software. Use the Product and Version selectors above to view content specific to a stable software release.

Setting Up Data Sharing

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.

Sharing Data Methods

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.

Creating Share Users

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 > Local 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 local users are members of a built-in group called builtin_users. You can use a group to grant access to all local users on the server or add more groups to fine-tune permissions for large numbers of users.

Why not just allow anonymous access to the share? Anonymous or guest access to a share is possible, but it is a security vulnerability and not recommended for Enterprise or systems with more than one share administrator account. Using a guest account also increases the likelihood of unauthorized users gaining access to your data.

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.

Creating a Basic Dataset

To create a basic dataset, go to Datasets. Default settings include those inherited from the parent dataset.

Select a dataset (root, parent, or child), then click Add Dataset.

Enter a value in Name.

Select the Dataset Preset option you want to use. Options are:

  • Generic for non-SMB share datasets such as iSCSI and NFS share datasets or datasets not associated with application storage.
  • Multiprotocol for datasets optimized for SMB and NFS multi-mode shares or to create a dataset for NFS shares.
  • SMB for datasets optimized for SMB shares.
  • Apps for datasets optimized for application storage.

Generic sets ACL permissions equivalent to Unix permissions 755, granting the owner full control and the group and other users read and execute privileges.

SMB, Apps, and Multiprotocol inherit ACL permissions based on the parent dataset. If there is no ACL to inherit, one is calculated granting full control to the owner@, group@, members of the builtin_administrators group, and domain administrators. Modify control is granted to other members of the builtin_users group and directory services domain users.

Apps includes an additional entry granting modify control to group 568 (Apps).

ACL Settings for Dataset Presets
ACL TypeACL ModeCase SensitivityEnable atime
GenericPOSIXn/aSensitiveInherit
SMBNFSv4RestrictedInsensitiveOn
AppsNFSv4PassthroughSensitiveOff
MultiprotocolNFSv4PassthroughSensitiveOff

If creating an SMB or multi-protocol (SMB and NFS) share the dataset name value auto-populates the share name field with the dataset name.

If you plan to deploy container applications, the system automatically creates the ix-applications dataset, but this dataset is not used for application data storage. If you want to store data by application, create the dataset(s) first, then deploy your application. When creating a dataset for an application, select Apps as the Dataset Preset. This optimizes the dataset for use by an application.

If you want to configure advanced setting options, click Advanced Options. For the Sync option, we recommend production systems with critical data use the default Standard choice or increase to Always. Choosing Disabled is only suitable in situations where data loss from system crashes or power loss is acceptable.

Select either Sensitive or Insensitive from the Case Sensitivity dropdown. The Case Sensitivity setting is found under Advanced Options and is not editable after saving the dataset.

Click Save.

Review the Dataset Preset and Case Sensitivity under Advanced Options on the Add Dataset screen before clicking Save. You cannot change these or the Name setting after clicking Save.

Setting up SMB Shares for Windows

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:

  1. 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.

    Browsing to select a path

    Click the arrow to the left of the folder icon to expand that folder and show any child datasets and directories. A solid folder icon shows for datasets and an outlined folder for directories. A selected dataset or directory folder and name shows in blue.

    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.

  2. Start the SMB service when prompted.

  3. Edit the SMB share permissions to set the share owner and/or group.

    a. Click on share 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.

  4. Edit the dataset for the SMB share permissions to set the share owner and/or group.

    a. Click on share 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.

  5. 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.

Setting up NFS for Unix-Like Shares

For more information on creating NFS shares, see Adding NFS Shares.

To set up NFS sharing:

  1. Add additional packages like nfs-common to any client systems that require them.

  2. 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.

    Browsing to select a path

    Click the arrow to the left of the folder icon to expand that folder and show any child datasets and directories. A solid folder icon shows for datasets and an outlined folder for directories. A selected dataset or directory folder and name shows in blue.

    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.

  3. 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)
    
  4. Make a local directory for the NFS mount. Enter command sudo mkdir nfstemp/.

    tmoore@ChimaeraPrime:~$ sudo mkdir nfstemp/
    
  5. 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/
    
  6. From here, cd into the local directory and view or modify the files as needed.

Setting up an iSCSI Block Share

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.