Deprecated: Creation of dynamic property InsertHeadersAndFooters::$plugin is deprecated in /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php on line 41

Deprecated: Creation of dynamic property InsertHeadersAndFooters::$body_open_supported is deprecated in /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php on line 48

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 955

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 955

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 1528

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 2267

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 3112

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 3118

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home2/itenterp/public_html/wp-content/plugins/updraftplus/class-updraftplus.php on line 3236

Deprecated: Creation of dynamic property WP_Rocket\Engine\Preload\SitemapPreloadSubscriber::$options is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-rocket/inc/Engine/Preload/SitemapPreloadSubscriber.php on line 26

Deprecated: Creation of dynamic property WP_Rocket\Engine\Preload\SitemapPreloadSubscriber::$sitemap_preload is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-rocket/inc/Engine/Preload/SitemapPreloadSubscriber.php on line 27

Deprecated: Automatic conversion of false to array is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-rocket/inc/3rd-party/plugins/seo/yoast-seo.php on line 10

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-smushit/core/modules/helpers/class-parser.php on line 229

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-smushit/core/modules/helpers/class-parser.php on line 234

Deprecated: Creation of dynamic property Smush\Core\Modules::$webp is deprecated in /home2/itenterp/public_html/wp-content/plugins/wp-smushit/core/class-modules.php on line 95

Deprecated: Optional parameter $output declared before required parameter $atts is implicitly treated as a required parameter in /home2/itenterp/public_html/wp-content/plugins/td-composer/legacy/common/wp_booster/td_wp_booster_functions.php on line 1599

Deprecated: Optional parameter $depth declared before required parameter $output is implicitly treated as a required parameter in /home2/itenterp/public_html/wp-content/plugins/td-cloud-library/includes/tdb_menu.php on line 251

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_classic_block is deprecated in /home2/itenterp/public_html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 347

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block is deprecated in /home2/itenterp/public_html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 349

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block_side is deprecated in /home2/itenterp/public_html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 350

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$panels_block is deprecated in /home2/itenterp/public_html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 351

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$used_block_buttons is deprecated in /home2/itenterp/public_html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 354

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home2/itenterp/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php:41) in /home2/itenterp/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":4143,"date":"2021-03-08T18:59:32","date_gmt":"2021-03-08T09:59:32","guid":{"rendered":"https:\/\/itenterpriser.com\/?p=4143"},"modified":"2021-03-08T19:01:52","modified_gmt":"2021-03-08T10:01:52","slug":"how-to-setup-truenas-core-and-connect-to-it-from-ubuntu","status":"publish","type":"post","link":"https:\/\/itenterpriser.com\/how-to\/how-to-setup-truenas-core-and-connect-to-it-from-ubuntu\/","title":{"rendered":"How to Set Up TrueNAS CORE and Connect to it From Ubuntu"},"content":{"rendered":"

TrueNAS CORE is a class-leading network-attached storage system. It’s fantastic but can be overwhelming. Here’s how to get a basic setup configured and running, and how to connect to it from Ubuntu.<\/p>\n

TrueNAS CORE<\/h2>\n

TrueNAS CORE<\/a>\u00a0is\u00a0the successor to FreeNAS<\/a>. It\u2019s a free and\u00a0open source<\/a> Network-Attached Storage (NAS) application. It\u2019s produced by iXsystems Inc.<\/a>\u00a0and the\u00a0TrueNAS community<\/a>. iXSystems produce hardware and software NAS solutions for business of all size. They have hardware solutions tailored to home and small businesses, small to medium enterprises (SMEs), and enterprise-scale units for mission-critical applications.<\/p>\n

All of their systems use the\u00a0ZFS file system<\/a>. The ZFS file system is remarkably robust and to a great extent self-healing. It can store zettabytes of data, supports RAID<\/a> natively, and incorporates copy-on-write. The ZFS system architects and software developers\u2014working for the legendary Sun Microsystems\u2014went to extraordinary lengths to guarantee the integrity of the file system and to make sure ZFS wouldn\u2019t lose data.<\/p>\n

TrueNAS Core is the community edition of the enterprise-class software and OS used in the commercial product offerings. You can download a TrueNAS CORE ISO image, populate a spare PC with some fast, cheap hard drives, install TrueNAS on it, and have a fully-featured, modern, professional-quality NAS for your own network.<\/p>\n

We\u2019re going to do just that, and also show how to connect to your TrueNAS CORE from Ubuntu.<\/p>\n

Installing TrueNAS Core<\/h2>\n

System Requirements<\/h3>\n

You need a hard drive\u2014mechanical or Solid State Drive (SSD)<\/a>\u2014to install the TrueNAS CORE system on, and some drives to save data on. You can\u2019t save data to the system drive. You only get redundancy with more than one data drive, so as a minimum you really need one hard drive for the TrueNAS system and two drives for data. TrueNAS advise that these drives should use conventional magnetic recording\u00a0(CMR) techology and not\u00a0shingled magnetic recording\u00a0(SMR) technology.<\/p>\n

You need a minimum of 8GB RAM for TrueNAS CORE. If you\u2019re using more than eight data drives you need an additional 1GB of RAM for each additional drive over the eight.<\/p>\n

Get the TrueNAS CORE installation Image<\/h3>\n

Download the\u00a0TrueNAS Core installation ISO image<\/a>. If you’re installing TrueNAS CORE on a computer with a CD-ROM, burn the ISO image to CD. If you\u2019re installing TrueNAS from a USB memory stick, use a tool such as Etcher<\/a>\u00a0to create a bootable memory stick from the ISO image.<\/p>\n

The Installation Process<\/h3>\n

Boot from the installation media. You’ll see the installation welcome menu.<\/p>\n

\"TrueNAS<\/p>\n

Hit “Enter” to continue.\u00a0 The install, reboot, or shutdown menu appears.<\/p>\n

\"TrueNAS<\/p>\n

We’re going to install, so highlight option 1 and press “Enter.” The disk selection screen appears.<\/p>\n

\"TrueNAS<\/p>\n

We’re installing TrueNAS CORE on the first drive. Highlight the first drive and hit “Space” to select it. Then press “Enter.” TrueNAS CORE reminds you that the drive will be wiped, and gives you chance to back out.<\/p>\n

\"TrueNAS<\/p>\n

Highlight the “Yes” option and press “Enter.” The root password screen appears.<\/p>\n

\"TrueNAS<\/p>\n

Type in a password for the TrueNAS CORE root user. Make sure you remember the password. You’re going to need it to log into TrueNAS CORE. You must type it twice.<\/p>\n

Highlight the “OK” button and press “Enter.” The boot type menu will appear. You can choose to boot your TrueNAS CORE in UEFI or BIOS modes.<\/p>\n

\"TrueNAS<\/p>\n

Select either “Boot with UEFI” or “Boot with BIOS” according to the vintage of your TrueNAS CORE computer, then press “Enter.” The installation process will start. It completes surprisingly quickly. When it has completed you’ll see the installation completed notification screen.<\/p>\n

\"TrueNAS<\/p>\n

Press “Enter.” The install, reboot, or shutdown menu appears.<\/p>\n

\"TrueNAS<\/p>\n

Highlight option 3, press “Enter”, and eject the installation media. The computer will reboot and start TrueNAS CORE. The first time TrueNAS CORE boots it takes longer than usual because one-time configuration steps are performed. Very shortly you’ll see the TrueNAS CORE boot menu.<\/p>\n

\"TrueNAS<\/p>\n

Press “Enter” or wait five seconds to boot into TrueNAS CORE. Presently you’ll see the TrueNAS CORE console application.<\/p>\n

\"TrueNAS<\/p>\n

The only thing you need to take note of here is the IP address of the web interface.<\/p>\n

Configuring TrueNAS CORE<\/h2>\n

Enter the IP address of the TrueNAS Core computer into the browser of another computer on the same network. We’re using an Ubuntu computer. The TrueNAS Core login window appears.<\/p>\n

\"the<\/p>\n

Enter “root” as the username and use the password you created earlier. Once you’re authenticated and logged in, you’ll see the TrueNAS CORE dashboard.<\/p>\n

\"TrueNAS<\/p>\n

The main display contains panels of information. They show the real-time status of your TrueNAS CORE installation. For example, here is the memory panel:<\/p>\n

\"TrueNAS<\/p>\n

There’s a side-panel at the left-hand edge of the display. It holds a list of options. You’ll use these options to configure your TrueNAS CORE. Here’s the top of that list of options.<\/p>\n

\"Side<\/p>\n

Notice that the name of the currently logged-in user and the network name of the TrueNAS CORE computer are shown above the options.<\/p>\n

Setting Up a Pool<\/h3>\n

A pool is a collection of hard drives that have been added to a single virtual device. The device is treated as if it were a single drive, and the ZFS file system handles the distribution of the data across the different physical drives.<\/p>\n

In the options list select Storage > Pools. There are no pools in the system yet.<\/p>\n

\"TyureNAS<\/p>\n

Click the blue “Add” button at the far right of the display. You can import an existing pool or create a new pool.<\/p>\n

\"TureNAS<\/p>\n

We need to create a pool, so accept the defaults and click the “Create Pool” button. The “Pool Manager” window appears. You need to name your pool. We used “pool1.”<\/p>\n

The available hard drives are listed for you. The computer we’re using has two 500 GB hard drives in it for data storage.<\/p>\n

\"TrueNAS<\/p>\n

If you click the “Suggest Layout” button TrueNAS CORE will make a sensible choice of combination of drives, RAID, and mirroring.<\/p>\n

\"TrueNAS<\/p>\n

In our example, it used both drives in a virtual device and mirrored them. This gives 100% redundancy because both disks are a copy of each other. Our storage capacity is (almost) 500 GB, the same as one of the mirrored drives.<\/p>\n

Click the blue “Create” button to create our new pool. A confirmation window appears.<\/p>\n

\"TrueNAS<\/p>\n

Click the “Confirm” checkbox and click the “Create Pool” button. The data drives are formatted to ZFS during this step. Our new pool, “pool1”, is listed in the pool list.<\/p>\n

\"TrueNAS<\/p>\n

Creating Datasets<\/h3>\n

We’re now going to create a dataset in our pool. A dataset is a ZFS construction that behaves like a filesystem. Click the three-dotted menu button over to the far right of the “pool1” line.<\/p>\n

\"TrueNAS<\/p>\n

Select “Add Dataset” from the drop-down menu. The “Name and Options” dialog appears.<\/p>\n

\"TrueNAS<\/p>\n

You need to name your dataset. We’ve used “dataset1.” Enter whatever you think will be useful to you in the comment field. You can accept all the other defaults and click the blue “Submit” button at the bottom of the dialog box.<\/p>\n

\"TrueNAS<\/p>\n

Our new dataset, “dataset1”, is listed as a child of our pool, “pool1.”<\/p>\n

Now we’re going to create another dataset inside “dataset1.” This will be where a user called “dave” is going to store his data. Click the three-dotted menu button over to the far right of the “dataset1” line, then click “Add Dataset” in the drop-down menu.<\/p>\n

\"TrueNAS<\/p>\n

We called our new dataset “dave-data”, added a comment, and accepted all other defaults. Click the blue “Submit” button at the bottom of the dialog box.<\/p>\n

\"TrueNAS<\/p>\n

Our “dave-data” dataset is listed as a child of “dataset1.”<\/p>\n

If you have several users who will use the TrueNAS Core, create more datasets—one per user—as children of “dataset1.” That way they can share the storage capacity of “dataset1” but only see their own files. We’ve only got a single user so we don’t need to create more datasets.<\/p>\n

Creating Users<\/h3>\n

In the options list, click on Accounts > Users. The “Users” list appears. The only user listed is “root.”<\/p>\n

\"TrueNAS<\/p>\n

Click the blue “Add” button at the far right of the display. The “Identification” dialog appears.<\/p>\n

\"TrueNAS<\/p>\n

Complete the fields in the top half of the dialog box. You need to provide a full name and a user name. It’s convenient to use the same name as the user’s Linux account name. You can provide an email address if you like.<\/p>\n

Provide a password, and enter it once more to verify you typed it correctly. Don’t use the same password as the user’s Linux account. Leave the “New Primary Group” checkbox selected, and scroll down to see the bottom of the “Identification” dialog.<\/p>\n

\"TrueNAS<\/p>\n

Expand the directory tree until you find the “dave-data” dataset. This is where the user’s “home” directory will be created. There is no “\/home” directory in the operating system (which is FreeBSD<\/a>) because TrueNAS CORE doesn’t want you to be storing files on the OS drive.<\/p>\n

Click the blue “Submit” button to create the user.<\/p>\n

\"TrueNAS<\/p>\n

Sharing the User’s Dataset<\/h3>\n

For a user to send files to TrueNAS CORE they have to be able to access their dataset remotely. We’re going to accomplish that in a couple of ways. The first is going to use a Network Filing System (NFS) share.<\/p>\n

In the options list, click on Sharing > Unix Shares (NFS). The “Sharing \/ NFS” list appears. There are no shares listed in it yet.<\/p>\n

\"TrueNAS<\/p>\n

Click the blue “Add” button at the far right of the display. The “Paths” dialog appears.<\/p>\n

\"TrueNAS<\/p>\n

Expand the directory tree until you see the “dave-data” dataset. Click the blue “Submit” button to create the share. You’re asked whether TrueNAS CORE should start the NFS service.<\/p>\n

\"TrueNAS<\/p>\n

We’re definitely going to need that, so click the “Enable Service” button.<\/p>\n

The new share is listed in the “Sharing \/ NFS” list.<\/p>\n

\"TrueNAS<\/p>\n

Configuring Services<\/h3>\n

We need to configure the services we’re going to use to access TrueNAS CORE. For this test, we’re going to connect to TrueNAS CORE in two different ways. One of those is via the NFS share we just configured and the other is via Secure Shell<\/a> (SSH).<\/p>\n

In the options list, click on “Services.” The list of services is displayed. Scroll through it until you see the “NFS” entry.<\/p>\n

\"TrueNAS<\/p>\n

Because we told TrueNAS CORE to start the service for us, the slider is already set to “on” for us, and is colored blue. Click on the checkbox to have the service started automatically when TrueNAS CORE boots up.<\/p>\n

Click on the pencil icon at the end of the NFS entry line to open the “General Options” dialog.<\/p>\n

\"TrueNAS<\/p>\n

Click the “Enable NFSv4” checkbox, then click the blue “Save” button at the bottom of the dialog. Look through the services list and locate the SSH entry.<\/p>\n

\"TrueNAS<\/p>\n

Click the slider so that it moves to the right and turns blue, and click the checkbox so that it has a tick in it.<\/p>\n

Setting Permissions on Datasets<\/h3>\n

We’ve created a pool of drives, added a dataset, then added another dataset for the user “dave.” We’ve created the user “dave”, and we’ve enabled the services we’re going to use to connect to TrueNAS CORE.<\/p>\n

The step that ties this all together is setting the permissions on the user’s dataset so that they are allowed to connect to it. In the options list, click on Storage > Pools, then click on the three-dotted menu at the end of the “dave-data” list entry.<\/p>\n

\"TrueNAS<\/p>\n

Click on the “Edit Permissions” menu entry.<\/p>\n

\"TrueNAS<\/p>\n

Use the drop-down menus to set the “user” and “group” fields to “dave.” Make sure you click on the “Apply User” and “Apply Group” checkboxes so that they are selected.<\/p>\n

\"TrueNAS<\/p>\n

Click the blue “Save” button.<\/p>\n

Connecting from Ubuntu<\/h2>\n

Connecting with SSH<\/h3>\n

On the Ubuntu computer, open a terminal window and type the following command to connect to the TrueNAS CORE computer using SSH. Substitute the name of your user and the IP address of your TrueNAS CORE computer in the command:<\/p>\n

ssh dave@192.168.1.22<\/pre>\n

\"ssh<\/p>\n

You can use the network name of the TrueNAS CORE if you prefer:<\/p>\n

ssh dave@truenas.local<\/pre>\n

\"ssh<\/p>\n

Once you’ve entered your password you’ll be connected to the TrueNAS CORE computer, in your user’s home directory. The command prompt will remind you you’re in a remote session on the TrueNAS CORE computer. The directory will be empty.<\/p>\n

ls<\/pre>\n

\"ls<\/p>\n

To disconnect, use the exit<\/code> command.<\/p>\n

exit<\/pre>\n

We’ve verified we can connect to the TrueNAS CORE computer via SSH. Let’s use SSH to send some data to the TrueNAS CORE. The rsync<\/code> file syncing and backup utility<\/a> uses SSH to transfer files. If you don’t have rsync<\/code> installed on your computer you can install it with:<\/p>\n

sudo apt install rsync<\/pre>\n

\"sudo<\/p>\n

Here’s the rsync<\/code> command we’re using.<\/p>\n

rsync -avh \/home\/dave\/Documents\/ dave@192.168.1.22:\/mnt\/pool1\/dataset1\/dave-data<\/pre>\n

\"rsync<\/p>\n

You’ll be prompted for the password of the “dave” account on the TrueNAS CORE—not your Ubuntu Linux account password—and then the file transfer takes place.<\/p>\n

\"rsync<\/p>\n

Connecting via NFS<\/h3>\n

Because we configured TrueNAS CORE to share the user’s dataset by NFS, we can mount the shared dataset on our Ubuntu computer and access it as though it were a local directory.<\/p>\n

If you don’t already use them you’ll need to install the NFS utilities.<\/p>\n

sudo apt install nfs-common<\/pre>\n

\"sudo<\/p>\n

Now we’ll create a mount point to mount the remote dataset on.<\/p>\n

sudo mkdir \/mnt\/truenas<\/pre>\n

\"sudo<\/p>\n

Now we’ll mount the remote dataset:<\/p>\n

sudo mount -t nfs 192.168.1.22:\/mnt\/pool1\/dataset1\/dave-data \/mnt\/truenas<\/pre>\n

\"sudo<\/p>\n

When you break that command down, it isn’t as bad as it looks.<\/p>\n