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:
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:
.
When the test is done, you may issue: to see the result. You look for this line, near the top of that output: 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.
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:
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:
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:
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:
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
Code:
Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run.
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"
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.
- 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.
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:
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.
Last edited: