How to Configure ZFS Storage and NFS Shares in TrueNAS – Part 2

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.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

12 Comments

Leave a Reply
  1. I tried to install it on Synology DS214play, I could not connect or run on the NAS, even it was directly connected with a brand new ethernet cable between the laptop and NAS unit.

    With Synology software DSM ver.6.2.4, it was installed once. But I have an 8TB NAS HDD 7200rpm, and I want to put ZFS on it.

    How should I proceed?

    Reply
  2. Can you just have one hard drive for storage? I tried following your steps but your screen shots are not like mine but close. But I cannot create any volumes. Current setup: 8GB Flash drive(freeNAS installed to) and 1 500GB HDD want to use for storage.

    Reply
  3. Thanks Ravi Saive its very useful.
    But how to accesses this sharing folder in Windows based PC can it will be access-able only through IP address.

    Reply
  4. How might I print your articles – specifically the three part “Installing and Configuring FreeNAS (Network-attached Storage)”?

    Reply
    • @James,
      Currently there isn’t any support added on print option, but we will soon add this feature to site so that users can print directly from the browser….give us some time to implement this..

      Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.