How-to: First Configuration for Small FreeNAS Deployments

Status
Not open for further replies.

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
EDIT: This post was written in 2015. A lot of things have changed in FreeNAS since then. Exercise some caution and judiciousness when trying to apply the below today; some still is good advice, of course, but some less so.

Note: Many (probably most) of the things I'm putting together here are echoed in some form in Cyberjock's presentation, as well as in countless bits and pieces in the forum. I just thought an ordered checklist format would be useful for the community. Everyone should have read Cyberjock's guide, before they do anything.

We have been getting a lot of questions in the forum recently having to do with what appears to be an increase in the number of users looking for tips and tricks for their initial FreeNAS configuration. It dawns on me that we don't have a checklist-format post that gives you all of the Cyberjock, DrKK, Marbus, CPUroast, various devs, etc., officially-sanctioned checklist items for getting underway. Let's remedy that now. I'm going to show you exactly what I would be doing when I build a new box for someone. The steps I show you below are more or less widely agreed to in the community, with perhaps small, inconsequential changes.

Assumptions: You have purchased new, recommended hardware, for a dedicated FreeNAS build according to the community's selection guidance. You have assembled your build. It looks good, and you're ready. Perhaps it is something like a SuperMicro X10 series, ECC Ram, and an appropriate HBA (if you have more drives than are drivable from your onboard SATA ports), and whatnot. Or maybe it's one of the recommended Avoton boards. Your build is done, you have installed FreeNAS 9.3 (or whatever is current when you read this), preferably using good quality boot devices in a two-device mirror (I personally recommend a pair of the Sandisk Cruzer Fit 16GB) and you want to set up the system. It is a virgin system.

Here are the steps I would guide you to perform, in order:

1. Congratulations. If you have followed our recommendations, and the guidance below, your data should be at almost no risk of loss, and in most cases, you will have a very well performing NAS system. Pat yourself on the back.

1a. Perform pre-checks on your disks. If you have not already done so, I recommend performing a "conveyance" (supposed to check for typical shipping damage) and/or "long" (full surface scan) S.M.A.R.T. test on each of your drives (these take, respectively, 5-15 minutes, versus a couple hours). If such tests pass, you have about as much assurance as you can have at this stage that your drives are "good". This is how you do the tests: Your drives usually will be designated by "adaN" or "daN", depending on how they're connected, by FreeBSD. You can see your drives' designators by dropping to the shell, and typing camcontrol devlist. For example:
Code:
[root@giskard] ~# camcontrol devlist
<WDC WD20EFRX-68EUZN0 80.00A80>  at scbus0 target 0 lun 0 (ada0,pass0)
<WDC WD20EFRX-68EUZN0 80.00A80>  at scbus1 target 0 lun 0 (ada1,pass1)
<WDC WD20EFRX-68EUZN0 80.00A80>  at scbus2 target 0 lun 0 (ada2,pass2)
<SanDisk SDSSDP064G 3.1.0>  at scbus3 target 0 lun 0 (ada3,pass3)
<SanDisk Cruzer Fit 1.27>  at scbus7 target 0 lun 0 (da0,pass4)
<SanDisk Cruzer Fit 1.27>  at scbus8 target 0 lun 0 (da1,pass5)

You can see in this list that the three 2TB WD red drives are ada0, ada1, and ada2. There is also a Sandisk SSD as ada3 in this build, as well as two Sandisk boot thumb drives, known as da0 and da1.

If any of your drives that you believe are installed do not show up in this list, then STOP, you have a problem that must be remedied before you proceed.

You may perform the S.M.A.R.T. tests immediately by typing smartctl -t [long|conveyance|etc] [devname], so for example, I would perform the conveyance test on ada0 as follows:
Code:
smartctl -t conveyance /dev/ada0
.

When the test is done, you may issue:
Code:
smartctl -a /dev/ada0
to see the result. You look for this line, near the top of that output:
Code:
Self-test execution status:  (  0) The previous self-test routine completed
  without error or no self-test has ever
  been run.
If the test is NOT done yet, it will tell you so in this position. You can run tests on all of your drives at the same time, of course. I strongly recommend doing at least the "conveyance" test.

2. Create your main pool. I suggest NOT using the wizard (I know that's blasphemy to Jordan, so I apologize). Go to the volume manager, and create your pool, in accordance with the documentation. Pools are traditionally named "tank". Unless you have a compelling reason, I suggest you call your pool "tank", and avoid names like "movies" or "media" or what have you. The initial ZFS format will not take too long.

3. Go to System->System Dataset in the GUI, select the pool you just created for "System dataset pool", and I suggest (unless you understand these options and consciously have something else in mind for some reason) that you check both the "syslog" and "reporting database" options.

4. Go to Network->Global Configuration. Select a "Hostname". This will be the "name of the computer". A character from your favorite book is a common hostname. (Mine is named "Giskard", after one of the most important Robots in the Asimov canon of books). In most cases, "Domain" will be "local" unless you know what you're doing. If you know you have a fixed IP for your IPv4 Default Gateway (e.g., maybe your router is 192.168.1.1), put it in here. It is also sensible to add at least one or two "Nameservers". If you don't know what this means, then you certainly cannot hurt yourself by putting in the Google nameservers, which are 8.8.8.8 and 8.8.4.4, respectively, into Nameserver 1 and 2. Most of the other options will be blank, unless you need them. If you don't have a proper Nameserver, then half of the things remaining in this guide won't work. So, do set this up. To see if your nameserver (DNS) is working, you can perform a "dig" command in the shell:

Note (added 2 Nov 2016): In more up-to-date versions of FreeBSD, and hence possibly your FreeNAS, you may have to use "drill" instead of "dig". It's pretty much the same thing.
Code:
[root@giskard] ~# dig www.google.com

; <<>> DiG 9.9.5 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51355
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.google.com.  IN  A

;; ANSWER SECTION:
www.google.com.  220  IN  A  74.125.196.147
www.google.com.  220  IN  A  74.125.196.104
www.google.com.  220  IN  A  74.125.196.105
www.google.com.  220  IN  A  74.125.196.103
www.google.com.  220  IN  A  74.125.196.106
www.google.com.  220  IN  A  74.125.196.99

;; Query time: 0 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sat Jan 24 23:03:50 EST 2015
;; MSG SIZE  rcvd: 139



5. Go to System->General. Set your timezone. For example, for Eastern Time in the United States, you will select "America/New_York".

6. Go to System->Advanced. "Enable Console Menu" should be checked. In most cases, never check "use serial console". You can enable "powerd" if you like; Cyberjock does not recommend this, whereas I recommend it. It is up to you; do your research. Also, the following should be checked for most users:
  • "Show console messages in the footer"
  • "Show tracebacks in case of fatal errors"
  • "Show advanced fields by default"
The checkbox for "Enable Autotune" should NOT BE CHECKED, EVER, for a small home user. Do *NOT* check it, it will make changes to your FreeNAS that will be problematic.

7. Set up outgoing email credentials (this can be very tricky). This step is very important, because all of the warnings, critical notices, and failure modes of FreeNAS are communicated to you according to the accuracy of the information entered here, so this is CRUCIAL, and is an often-overlooked step. Unfortunately, you will be somewhat on your own here. A mix of the documentation, and some googling, will help you. If you are using gmail, you will probably find that the following settings will be approximately correct:
  • "From email": It really doesn't matter what you put in here. Probably your actual email address is the wisest choice.
  • "Outgoing mail server": smtp.gmail.com
  • "Port to connect to": 465
  • "TLS/SSL": SSL
  • Edit: Probably setting this to TLS and port 587 is better security.
  • "Use SMTP Authentication": checked
  • Username: yourusername@gmail.com
  • Password/Password confirmation: whatever your gmail password is.
Now, click "Send Test Mail".

  • If you're lucky, you will now receive a test email.
  • But what's likely to happen (in the case of gmail) is that Google will possibly refuse to send it, until you allow certain permissions on your gmail account. If this happens, you will probably get a warning in red in the top of GUI, with a link to follow to Google on how to set this up.
Now, set this up for your root email. Go to Account->Users, highlight user ID 0 (root), and click "change e-mail", and enter your email address.

8. Set up UPS service. (You *DID* buy a UPS, I hope??! You'll be sorry if you didn't...). The information in the documentation is good. Go to Services->UPS, click the wrench. The two most important things in here are the "driver" type (which you should set to your UPS type), and the "Port", which you can see by plugging in your USB cable to your UPS (the kernel will throw a message to your footer, saying that a device has been plugged into a particular port). Now, save your changes, and turn the service ON. If it turns on, you should be in business. If it doesn't turn on, one of your settings is wrong.

9. Set up SMART service. Go to Services->S.M.A.R.T, click the wrench. (Service should already be on). "Check Interval" is how often the S.M.A.R.T. information on your drives is checked. "30" is good. For power mode, I suggest you set this to "Never - Check the drive regardless". I don't use "Difference" or "informational" warnings, so I leave those to 0. But, I do set a "critical" temperature. You should set it to the Celsius temperature that is like 7 or 8 degrees warmer than your drive typically gets under operational conditions. In my case, I have "critical" set to 42, which is quite low. If you don't know what's safe to put here, I suggest "50". If your drive gets to "50", you have problems with your cooling, to say the least. Make sure you put a valid emails address in "Email to report". NOTE: The rumor is that with FreeNAS 10, when that comes out, this whole screen will be unrecognizably different, so we may have to update this.

10. Set up SSH. Most people will want SSH. Now's a good time to set that up. Check out the FreeNAS documentation.

11. Set up Snapshots. Go to Storage->Periodic Snapshot Tasks. Most people will want snapshots. Read the documentation on what they are.

12. Set up Scrubs. Go to Storage->Scrubs. Scrubs are one way ZFS heals itself. You should perform scrubs on your main pool probably about twice per month for typical consumer grade hardware. Click "Add Scrub", select your volume, and set your "Threshold days" to something like 10, 14, 20. Something like that. If you scroll down, you'll see it (probably) defaults to only performing scrubs on Sundays. For most home users, it doesn't much matter what day of the week a scrub is performed, so you could checkmark all the days of the week.

12a. Boot scrubs. The scrubbing for the boot pool is handled separately. Go to System->Boot. In most cases, a default scrub interval of "35 days" will be set at the top. In my view, that's far too long--USB drives throwing errors is VERY common, and I like to know the minute it happens. I recommend a much smaller value. Mine is set to "5 days".

13. Set up SMART tests. Go to Tasks->S.M.A.R.T. tests. I recommend a regimen of Long tests every fortnight, and Short tests every few days. A lot of people out there think "short" tests are completely useless, just for full disclosure. Here's what mine looks like:

smart.jpg

14. Set up a file share. Go to the "Sharing" tab, and set up your main share. For Joe Blow home user, this will often be a Windows/CIFS share. This, too, can be very tricky; reference the FreeNAS documentation. Remember: after setting up the share, you'll want to verify that the related "service" has been turned on in the "Services" menu. (e.g., "CIFS" in the case of a Windows share).

And that should do it!!!

Parting thoughts:

We recommend that you perform a check for updates in the system->updates screen at regular intervals.

We recommend that you use HTTPS for the GUI. Look in to how to set that up in the documentation.

FreeNAS machines should generally be powered on 24/7. They are (usually) low power machines, and often consume only a couple dozen watts at idle. The power savings you would get by turning it off when not in use pales in comparison to the wear-and-tear on your components (particularly hard drives spinning up).

The "Reporting" Tab has seen many improvements as of late. Reference the various displays in there frequently so that you can understand what "normal" is supposed to look like.

Never do anything at the command-line that is supposed to be done in the GUI. You'll be sorry. If you want to be a command-line H4x0r, then install FreeBSD itself--don't use our appliance.

"Permissions", i.e., file permissions, any kind of "active directory" stuff, "I can't write to my folders", "how do I get it so user A, B, C can write to this dataset but other users cannot", etc., when we hear those questions, we just stop listening. You're mostly on your own with permissions. They are complicated questions with complicated answers, they have pernicious cross-interactions between Unix and Windows styles, blah, blah blah, and you're going to have to do your own research. Look at forum posts, documentation, and so on.

If you need more help, you can usually get service within 24 hours by making a proper, reasonable, post in the forum. Obey the rules and culture of the forum, and one of us will almost certainly help you. If you find that no one is helping you, this is almost certainly because you have not made it easy to help you--i.e., by disobeying the rules that make it easier to help you, or you have asked a question that five seconds with google (or even our brokenass forum search) would have answered for you.

For faster service, and really, for a fun time, you can talk to most of us nearly instantly in the IRC channel. Look in the forum and in the documentation for instructions on how to find us there. At any given time (but, particularly, at times that are afternoons in North America and Europe) you will find several of us in there, generally available to provide some level of help or support. Believe it or not, we are one of the most active, most easily accessible subject matter experts, and most responsive support communities you're going to find for a product like this.

But remember: this is volunteer work. Almost no one you deal with in the forums, or on the IRC channel, is being paid to help you. Accordingly, those that are helping you hold all of the cards, so it would be wise business to make it as easy as possible to help you. You can do that by:
  • Giving the appearance of having done a reasonable amount of your own homework
  • Giving the appearance of already having taken the time to see if something one of the guys has already put together for you (forum stickies, documentation, etc) easily solves your problem
  • Having the right hardware in the first place
  • Remembering that you are getting a very valuable service for free, so a good attitude, and some acknowledgement to the person(s) that help you would be nice.
We recommend that you back up your pools. We provide several options for that, including rsync, and various plugins for backup services. Even though FreeNAS is far, far, far, far better than just a random external USB hard drive for data integrity (assuming it's well-run, anyway), it's still cheap, and easy, to have a backup. ZFS is a dangerous file system in a novice's hands, so if you are new to FreeNAS, and have a tendency to tinker and click shit that we don't tell you to click, then especially you will want a viable backup solution. Most of the active Community members would agree with the general backup philosophy of the so-called 3-2-1 Rule. I personally recommend Amazon Glacier for the "1" part of "3-2-1".
 
Last edited:

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
I just liked your post :smile: Thank you!

My only thoughts would be on creating the first pool may be a little bit later, like having current items 2. and 3. after SSH is setup. And having current item 13. before SSH setup.

On the other hand, I understand a desire to get logs (etc.) being written to the disks early in the setup.

P.S.
My above opinions are based on my existing workflow. Why didn't I share it? It includes advanced items...
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
@Allan Jude would like me to advise the community that the classic name for ZFS pools--"tank"--comes from the fact that the original ZFS dev team called their pools "Tank" and "Dozer" after the characters from The Matrix. True story.

Now you know.

Tank.jpg

360402_1263761011156_full-1.jpg
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630

DiViDeR

Dabbler
Joined
May 22, 2014
Messages
22
Also, why is this post not a sticky? @cyberjock @dlavigne

What he said! I missed this when looking for guides on configuring a system for initial use and although I'd done some of this, there was plenty here I needed to do. Very useful indeed, thanks DrKK ;)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
@Allan Jude would like me to advise the community that the classic name for ZFS pools--"tank"--comes from the fact that the original ZFS dev team called their pools "Tank" and "Dozer" after the characters from The Matrix. True story.

Now you know.

Tank.jpg

360402_1263761011156_full-1.jpg
I recommend we undertake some revisionism and create this tale:

The ZFS dev team, in Its glory, determined that this new Filesystem was as indestructible as a Tank, and hence determined that the default name for a Pool be Tank.
When John from the Java team, who fancied himself a history expert, mentioned that the Sherman tank was quite the deathtrap, the ZFS dev team did cast him into the pit of eternal despair, that unholy place mortals call "Human Resources".

Please incinerate all writings not conforming to this ASAP and report any inconsistencies to the ZFS police.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
@Allan Jude would like me to advise the community that the classic name for ZFS pools--"tank"--comes from the fact that the original ZFS dev team called their pools "Tank" and "Dozer" after the characters from The Matrix. True story.

Now you know.

Tank.jpg

360402_1263761011156_full-1.jpg

And has nothing to do with

%zpool scrub tank

And the mental image thus invoked of a man scrubbing a large shark tank with a brush ;)

Sharks. Like the logo.

Shark-tank-cleaner-397219.jpg
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
Because you're asking the wrong people.

Currently pinned in "Unsorted Help and Support Posts"

Would probably be better somewhere else, perhaps Guides -> Installation/Configuration etc?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,681
Currently pinned in "Unsorted Help and Support Posts"

Would probably be better somewhere else, perhaps Guides -> Installation/Configuration etc?

@DrKK is free to ask for it to be moved. I would never dream of implying that our little tinpot wannabe dictator marionette was incapable of properly selecting a forum prior to posting; if I did so, I think I'd kinda be afraid of some half-baked ICBM made out of legos being launched halfway across the world with some bluster of how it was going to get me. ;-)
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
@DrKK is free to ask for it to be moved. I would never dream of implying that our little tinpot wannabe dictator marionette was incapable of properly selecting a forum prior to posting; if I did so, I think I'd kinda be afraid of some half-baked ICBM made out of legos being launched halfway across the world with some bluster of how it was going to get me. ;-)
Sir, you are free to move this, and any other DrKK post, to any location you deem would best serve the beloved FreeNAS community.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
... looks, can't find "Circular File Forum". :p
Perhaps those aren't allowed.

It does beg the question of what a moderator should do if he decides this is the right place for it. Then he'd be sorting it into the unsorted help and support posts forums. Obviously someone put it here (since the category didn't exist before). So obviously they have been sorted. Perhaps we should call it the "meh... help and support posts".
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Code:
<anodos> I just intentionally misused "beg the question" in one of DrKK 's how-to threads.
<DrKK`> I was just going to ask you
<DrKK`> you son of a bitch
<DrKK`> you just made the list
<shadow35[win2k12> LOL
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Wait, is the forum bleeping shit out?

Edit: No, only the word for "female dog" gets bleeped.
 
Status
Not open for further replies.
Top