Optimal Storage and Access Setup

0nighthawk0

Dabbler
Joined
Jan 6, 2021
Messages
21
Hi all,

I'll try to keep this short, I've dobe a numberof searches and read a lot of articles and much seems to have changed for Truenas compared to older versions of Freenas.

To keep it short I used to run Freenas a long while back and then moved to Nas4free mainly due to the knowledgebase still veing present for that version.
I'm now trying to setup my server properly for some services instead of it effectively being a data store.

My use case is I have a single storage pool - Mirrored/Stripe ZFS (4 drives). I have created the pool and its currently blank.

Ideally i want to host a few jails/containers and have this be a server of services rather than files etc.

I will eventually transfer my data from my old server to the new one but really want to have my storage on the pool set up in a nice segregated way, with certain jails/containers able to have a read access to certain directories etc. I'd also like to use encryption on some data, but don't want to store keys or cache them locally or have to type in a password every single time if at all possible.

Basically I'm looking for a tried and tested setup that will work for the latest edition of Truenas. With segregation of data, making it easy to back up/update the jails containers etc. Once this server is setup on Truenas and it works, i'll be upgrading my old nas4free server so may have the option of syncing data etc.

Really appreciate anyone sharing their setup and hints/tips with what has worked for them.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Really appreciate anyone sharing their setup and hints/tips with what has worked for them.
We have a good group of members here that will help to get you going.

As the release of TrueNAS Core is still fairly fresh, there is still a bit of a shortage of documentation that is specific to that version. Documentation takes time. The resources we have that were written for older versions, when it was still called FreeNAS, should still be applicable, as long as you are a bit flexible with interpretation. For example, I was able to use the same setup steps that worked in FreeNAS 9.10 to configure TrueNAS. It just takes a little extra effort to find things because the menu looks different.

Anyhow, I am sure that others will share, but I wanted to point you to some resource links:

Forum Guidelines - always good to know:

Building, Burn-In, and Testing your FreeNAS system

GitHub repository for FreeNAS scripts, including disk burnin

There is a guide called, "Uncle Fester's FreeNAS Beginner's Guide". It is currently being updated with new graphics to bring it from the FreeNAS 11.1 (old GUI) to the FreeNAS 11.2 version with the new GUI. You can find a link to this very informative, step-by-step, guide here:

It might be a little while before Fester's guide gets updated to TrueNAS, but we have several folks on the forum that can answer specific questions if you run into trouble.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
[..] I'd also like to use encryption on some data, but don't want to store keys or cache them locally or have to type in a password every single time if at all possible. [..]

Well, unless I completely misunderstand things, this will not be possible. Encryption requires a shared secret, which can be a passphrase/password or a private key. There is simply no way around this.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I'd also like to use encryption on some data, but don't want to store keys or cache them locally or have to type in a password every single time if at all possible.
There is a new ZFS encryption that I have not used yet, but I imagine it would function in a similar way as the old encryption worked. With the old encryption system, you unlocked it when you booted the system and mount the pool. From then, it stayed unlocked until the system rebooted. It does require you to retain the key files or you would loose access to the pool, but you only enter the key on the FreeNAS / TrueNAS console to give the NAS access to the pool. Network shares are using whatever network security you have configured.
 

0nighthawk0

Dabbler
Joined
Jan 6, 2021
Messages
21
Thanks all.

I've looked at the ZFS encryption and I think I'm just going to use it for specific datasets. I have been using whole disk encryption with GELI up to this point.

I've just flattened the new box again as I tweaked a few things.

Can anyone tell me the command that the GUI sends to the backend when it creates a pool. I was hoping to be able to set the "ashift" value via the GUI but don't appear to be able to do so. I know the general commands to create a pool with a starting dataset, but wanted to know the exact command echo'd through the gui to the shell... This latest box is a cheap headless unit without a ILO/IPMI/DRAC etc option - so i can;t follow it on that.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Can anyone tell me the command that the GUI sends to the backend when it creates a pool.
I guess I would need to know why you ask because the answer is detailed and depends on what you have asked FreeNAS to do...

The series of commands are actually quite complicated. By default, FreeNAS first creates a 2G partition for swap and a second partiton for data using the rest of the space on the drive, on each pool disk. Then it uses the partition id of the data partition to create the pool based on what you have selected as a pool type. The last time I did that manually with a large number of disks, I used a batch file... It is not something you would type at the console without reviewing it for accuracy many times.
This reference will show you the pool commands, but not the exact way they are used from within FreeNAS:

While you could create or modify your pool from the console, it is not usually a good idea. Two reasons I can think of, as an example, first is that FreeNAS does things that matter to FreeNAS (like the swap space) that are peculiar, second it is easy to make a mistake. As long as there is no data invoved, a mistake is fairly easy to fix. With data, there is more risk.

When i say "starting dataset" i mean "initial vdev"....

Terminology and Abbreviations Primer
https://www.ixsystems.com/community/threads/terminology-and-abbreviations-primer.28174/
 

0nighthawk0

Dabbler
Joined
Jan 6, 2021
Messages
21
I guess I would need to know why you ask because the answer is detailed and depends on what you have asked FreeNAS to do...

The series of commands are actually quite complicated. By default, FreeNAS first creates a 2G partition for swap and a second partiton for data using the rest of the space on the drive, on each pool disk. Then it uses the partition id of the data partition to create the pool based on what you have selected as a pool type. The last time I did that manually with a large number of disks, I used a batch file... It is not something you would type at the console without reviewing it for accuracy many times.
This reference will show you the pool commands, but not the exact way they are used from within FreeNAS:

While you could create or modify your pool from the console, it is not usually a good idea. Two reasons I can think of, as an example, first is that FreeNAS does things that matter to FreeNAS (like the swap space) that are peculiar, second it is easy to make a mistake. As long as there is no data invoved, a mistake is fairly easy to fix. With data, there is more risk.



Terminology and Abbreviations Primer
https://www.ixsystems.com/community/threads/terminology-and-abbreviations-primer.28174/

Thanks for the information and links. Good to know.

Thanks for the terminology link but I knew what I was asking, just about 50 thoughts running through my head at the same time and mistyped. I was trying to setup datasets but realised I didnt know what the ashift value on the first vdev was and wanted to set that for perfromance purposes, it may be worth adding it as an option to advanced options in the GUI.
 
Top