Set up a network share with TrueNAS Scale and finally use that extra drive space and storage over your network! File sharing really is this easy.
STEP 1 – Storage for your share
First we need to create a storage pool in TrueNAS scale to store the files that you wish to share.
This is done by navigating to the Storage tab on the left, then Create Pool on the top right
On the Create Pool Page, Input a name for your pool, then check mark the disks you wish to have in this storage pool, Once selected, click the left pointing arrow to move them to the “Data VDevs” section.
Now we can select the TYPE of VDevs these selected disks will be, I have chosen Raidz1
Now select “Create” at the bottom and confirm your setup.
Now that there is a Storage Pool with your disk(s), we can now create a Dataset.
Do this by selecting Datasets on the Left tabs, Then click to highlight the Storage Pool we had just created.
Now fill in the right side panel, make note to change the “Share Type” field to “SMB” once complete, select “Save” at the bottom of the panel.
STEP 2 – Users and Groups for Access
Now that we have the Storage space for the file we need to define users or groups that will have access to that storage space.
Currently is it set to users that have access to your TrueNAS web Interface or the builtin_administrators and builtin_users group. Typically these users have access to the TrueNAS interface, you may want to separate the access to TrueNAS interfaces and the shares TrueNAS is presenting for security reasons.
If this is OK for your use case, then you can jump to the next steps.
To create a new group.
Select in the left side panel tabs: Credentials > Local Groups Then “Add” at the top right.
Here fill in the Group Name and Check the “Samba Authentication” option.
To Create a new User
Select in the left side panel tabs: Credentials > Local Users Then “Add” at the top right.
Fill in this new user panel, There are some options you can select and deselect specifically for a user that is only going to have access to the network share, they are as follows.
Deselect “Create New Primary Group” – a new users named group is not needed to access the share.
Auxilary Group – Set this to the group you created that will have access to the share
Primary Group – Set this to nogroup
Shell – Set this to nologin – there is no need to have this user need a shell to login to the TrueNAS command line
Check “Samba Authentication” option
STEP 3 – Add Permissions to the DataSet
In the Left Panel, Select the Datasets Tab
Highlight the Dataset that was created in step 1
Click “Edit” on the “Permissions” Tile
On the new Page you can REMOVE the 2 groups called “Group – builtin_administrator” and “Group – builtin_users” as these groups will give access to any users and administrators already on the TrueNAS using the current credentials they use to access the TrueNAS web UI, which may pose a security issue. They can be remove by clicking the small x beside each one.
Now we can add the Group or User we want to have Access to the Dataset share.
Click “Add Item” – This will create a new line item in the Access Control List
Highlight the new Item that was created.
In the “Who*” Dropdown list, Select the user or Group you want to have access to this Dataset Share
If you selected a Group, then you will need to specify the group in the next “Group*” drop down.
In the Permissions Tile for the you can generally leave this as default to allow the user/group access to read and write access for the Dataset. You can also change the advanced permissions for different levels and access permissions here if needed.
Once configured, Click the “Save Access Control List“
STEP 4 – Add the Dataset to Windows Share Service
Now we are going to add the Dataset to the Windows Share service, as this service is what presents and handles the Dataset to the Network.
In the Left Panel select the “Shares” tab
You should see the “Windows (SMB) Shares” is in the Running State, if it is NOT running, you can select the vertical ellipse’s (⋮) and select Start.
To add the Dataset to the Windows Share Service, click the “Add” button on the right side of the service tile.
Fill in the “Add SMB” panel
For the Path, expand the /mnt path and then expand Storage pool until you see the Dataset created earlier and select it.
For the Name it can be anything you want and does not need to match the dataset name.
Under the “Purpose” dropdown, select the appropriate purpose, in most circumstances “Default share parameters” is just fine.
Check the “Enabled” box and select Save
Step 5 – Connect to the Share
Open a file explorer window and enter “\\<TrueNAS_IP>
” and you should get a pop-up for your credentials, enter the user credentials and off you go!
For Mac you may need to go to a machine connection and select SMB or type SMB:\\<TrueNAS_IP>