In our previous article, we showed you how to install TrueNAS server. This article will guide you through configuring TrueNAS to set up ZFS storage disks and create NFS shares, enabling you to store and share data efficiently across your network.

Hardware Requirements

Before diving into the configuration of TrueNAS, ensure that you have a minimum of two disks properly connected and recognized by the system to create a ZFS pool.

However, three or more disks are recommended for better performance and redundancy (RAID-Z1, RAID-Z2, or RAID-Z3).

Configuring ZFS Storage Disks

To add a ZFS storage disk, navigate to Storage > Disks and click on the Add Disk button to select and configure the disks you want to use for storage.

Connected Disks
Connected Disks

To create a ZFS Pool, navigate to Storage > Pools and click on the Add button to create a new pool.

Create New ZFS Pool
Create a New ZFS Pool

Next, enter a name for your pool and select the disks you want to include in the pool from the available list.

Create ZFS Storage Pool
Create ZFS Storage Pool

Your ZFS pool is now set up and ready for use.

ZFS Pool Storage
ZFS Pool Storage

After creating the storage pool, click on the pool you just created and click on the ... (three dots) next to it and choose Add Dataset to create a new dataset.

Create a New Dataset
Create a New Dataset

Next, enter a name for the dataset and configure the permissions for the dataset by navigating to the Permissions tab. Set the owner and group permissions, as well as read, write, and execute permissions as needed.

Add Dataset Name
Add Dataset Name
Dataset Permissions
Dataset Permissions

Creating NFS Shares for ZFS Datasets

To share ZFS datasets on Unix machines, go to the “Sharing” tab from the top menu, and choose the Unix Shares (NFS) type.

Choose Unix Shares NFS
Choose Unix Shares NFS

Next, click on the Add NFS Share button choose the location of the dataset you created earlier, and configure the share settings, including options for read/write access and allowed hosts.

Choose ZFS Dataset for NFS Share
Choose ZFS Dataset for NFS Share

After clicking on Submit, a confirmation message will prompt, asking if you would like to enable this service. Click Yes to enable the sharing. You will then see that the NFS service has been started.

Enable NFS Service
Enable NFS Service

To confirm the NFS service status, navigate to Services and look for the NFS service. Make sure the toggle is in the ON position to confirm that the service is running.

Confirm NFS Status
Confirm NFS Status

Mounting NFS Share on Unix Client

Now login to your Unix client machine (Here I’ve used Ubuntu 22.04 with IP Address 192.168.122.12), and check whether NFS share from TrueNAS works or not.

But, before checking TrueNAS NFS shares, your client machine must have the NFS package installed on the system.

sudo dnf install nfs-utils -y	    [On RedHat systems]
sudo apt install nfs-common -y	    [On Debian systems]

After installing NFS, use the following command to list the NFS share from TrueNAS.

showmount -e 192.168.122.103
Check TrueNAS NFS Share
Check TrueNAS NFS Share

Now, create a mount directory under ‘/mnt/TrueNAS_Share‘ in the client machine, mount the TrueNAS NFS Share in this mount point, and confirm it using the df command.

sudo mkdir /mnt/TrueNAS_Share
sudo mount 192.168.122.103:/mnt/tecmint_pool/tecmint_docs /mnt/TrueNAS_Share/
df -hT
Mount TrueNAS NFS Share
Mount TrueNAS NFS Share

Once the NFS share is mounted, go inside that directory and try to create a file under this share to confirm that the root user has permission to this share.

sudo su
cd /mnt/TrueNAS_Share/
touch tecmint.txt
Create Files in TrueNAS NFS Share
Create Files in TrueNAS NFS Share

That’s it! we have configured the storage volume and defined an NFS share from TrueNAS.

Conclusion

TrueNAS provides a user-friendly interface to manage the storage server. TrueNAS supports a large file system using ZFS with features such as compression, quotas, and permissions.

In future articles, we’ll explore how to use TrueNAS as a streaming server and torrent server.

Similar Posts