Build your own NAS using FreeNAS


Worrying about a bunch of external drives, on your floor that you inadvertedly stumble upon and kick? Tired of wasting time looking for data, not knowing in which drive it resides? Tired of having to transport these drives from computer instead of having them accessible to all computers all the time? Have you been thinking of buying a NAS but the available choices do not meet your criteria for Data Safety, Space Utilization, Cooling, etc? or, if they do they are not on your price range? If you answered yes to any of those questions or you are looking for an entertaining project, then this article is definitely for you. This article will teach you how to build your own RAID 5, 1-terabyte NAS (Network Attached Storage) using very reliable and inexpensive components.

Components:

  • FreeNAS (Monowall, FreeBSD based NAS software)
  • PIII motherboard (Intel Chipset)
  • PNY CF Card
  • CF to IDE adapter
  • SEAGATE 320Gb Hard Drive Barracuda drives (4 Units)
  • Adaptec 2610SA SATA Raid Card (6 ports, hardware Raid)

First of all let me give you some price figures:

Component Origin Price
FreeNAS Web download, under BSD license $0
PIII motherboard Computer Upgrades Leftover $0
PNY CF 64 MB Card Ebay (Used) $3
CF to IDE adapter Ebay (New) $3.30
Tower Case and Power Supply Computer Upgrades Leftover $0
Sata cables and SATA power adapters Ebay (New) $5
Cooling fans Computer Upgrades Leftover $0
Four 320GB SATA Seagate Barracuda 16MB Cache 7200rpm Hard Drives Tiger Direct / New Egg , etc (Some with rebates) @ .23c / Gb combined cost $276
Adaptec 2610SA 6 port SATA Raid Controller Card EBay (New) $82
Shipping for all components $44
Total $402

In comparison the least expensive of the Buffalo’s 1TB stations costs $453 (not including shipping, Source: Froogle) and has two 500mb drives inside and is only capable of RAID 0 and RAID 1. RAID 0 which will give you a full 1TB (before formatting) but without any redundancy, so you know what will happen to your data if one of those hard drives happens to fail. RAID 1 will give you redundancy mirroring both drives but will reduce your total capacity from 1TB to 500GB (before formatting). This project will give you 1.2TB before formatting and RAID, it will give you the ability to run RAID 5 which as opposed to RAID 0 will give you redundancy for all your data, which means it is totally safe in case of hard drive failure. In addition, and unlike RAID 1 it will make use of the space a lot more efficiently giving you significantly less overhead. The total capacity after RAID 5 and formatting will be 919GB. It will also have far better cooling capabilities than the Buffalo Station, which is critical for the life of the hard drives. Why were these particular components chosen for this project? Simple… Price, Reliability and Features. FreeNAS was chosen for this project because as its name states… its free. In addition it is reliable, stable and there is plenty of support for it on the web. FreeNAS runs solid but you do have to be careful when configuring it. FreeNAS is still in BETA stage and some parts of the configuration can conflict with each other and ruin what you had previously accomplished without warning. You do need to know the order of the configuration steps. However, once it is up and running it is as stable as any other BSD based system. I will give you the right steps you need to follow to configure FreeNAS in this tutorial. To build my NAS I chose a normal Tower case, why? Cooling…. Cooling is critical for data safety, the more heat you have the less your Hard Drives are going to last. In the following picture I placed only two of the four Hard Drives so you can notice the 120mm fan at the front of the case. Other fans were also installed on the back of the case to evacuate accumulated internal heat and provide an appropriate airflow. I chose a 120mm fan so that it covers all four drives. Make sure that the case you choose for your NAS has space for all drives at the same location. Also make sure that there is space between them. Notice the gap between each drive on the picture below. If drives are not on the same location ensure that all of them have proper cooling and consequently that if a separate cooling source is provided, this does not interfere with the airflow inside your case. Air should flow from the front of the case to the back and then out. This arrangement will provide excellent cooling capabilities for your NAS box.

As you can see, for this project I’ve chosen a CF Card with a CF to IDE adapter as my main boot drive. The advantage of this is that is that a CF Card is significantly more reliable than a Hard Drive since it is solid state, its basically memory, it does not have any moving components inside that are prone to failure. This CF Card is mounted on a CF to IDE adapter which as is name states converts the CF card into an IDE Drive, it uses the regular IDE ribbon Cable and the small power plugs that are usually used to power floppy drives. I addition, being a memory card, it will consume very little power as well as generate practically no additional heat inside the case. And finally, it is dirt cheap you can basically get both the card and the adapter for $10 including shipping. That is if you do your research on eBay and are willing to wait the two weeks it takes for the adapter to be shipped from Hong Kong. You can also get them from a national reseller buy they will cost you a bit more. I’ve read some postings on the web of people saying, why waste a whole computer by using it excusively for a NAS when it can run other utilities as well. I beg to differ… fist if all, what are you going to use an old PIII or a PII for nowadays? And even if you had a good use for it, why are you going to waste hard drive space installing an operating system on your cluster? Either that or purchase another hard drive for your project and we already went trough the advantages of a CF card over a regular Hard Drive. The jewel of this project is definitely the Adaptec 2610SA RAID Card. This card was made by Adaptec to run on Dell servers. This is a true Hardware RAID card, which makes it totally software independent and guaranteed to work with almost any operating system on the face of the planet, since you do not have to install any software to drive the RAID cluster. In addition it is capable of RAID 0, 1 and 5. As some of you might know, software RAID’s restoring procedure can be sometimes difficult, hardware RAID is straightforward and pain free. Moreover, since this card does not depend on the operating system, you do not have to worry about the operating system becoming corrupt, if the operating system stops working you can just reload it, it will see your drive with all your data without much configuration. Don’t worry about the large PCI connector, it will fit well on a regular PCI slot, the reason why it is so large is because you can also use it in 64bit PCI slots. I purchased this card new on eBay for around $82, be sure to get the one made for DELL and not the one made for HP, there are many reports on forums stating that this card will not work with FreeNAS. Procedure to configure RAID 5 on the adaptec 2610SA 1) Turn the computer on and hit CTRL-A when you see the following message come up on the screen

2) Click on SATASelect Utility and then on Controller Configuration

3) Make Sure everything looks exactly the same as in the following screen:

4) Go back to the initial screen and click on Array Configuration Utility, then Click on “Create Array”

5) Press INS button to select all drives and ENTER when done

6) Next screen should look as the following picture, note that I have chosen to disable WRITE CACHE since having this option enabled makes the array prone to data corruption in the event of a power failure. Notice that the stripe size was left at 256K since this is what Dell recommends for most network environments. In the array label you can basically input whatever name you desire, I chose FreeNAS as my label name.

Hit ENTER when done and the Dell 2610SA RAID Card will start configuring the drives, this process will take many hours. Mine took approximately 10 hours. However, once you begin the process you will get a message telling you that the array is available immediately but performance is degraded due to the Build/Verify process. To check the status of the Build/Verify process go to the Main Menu and click on “MANAGE ARRAY” then hit enter to select the array you just formed and then look under “ARRAY STATUS” it should display a percent completed or “OPTIMAL” when done. Configuring FreeNAS FreeNAS is fairly simple to install, just burn the ISO provided in the FreeNAS website, boot the NAS server with it and follow the installation procedure. Once installed, if you happen to get error messages when trying to run it, bear in mind that you need at least 96mb of memory to run FreeNAS. However, this is the minimum that the FreeNAS creators recommend but it is impossible to run a 1Tb Raid 5 box with this amount of memory, it will not even allow you mount the partition. I would recommend 256mb or 512mb. Once we have FreeNAS up and running we are going to Select option 2 “Set LAN IP Address” It will then ask you if you want to set the IP as DHCP, I chose DHCP since this is what I use on my home network, but if you want to have permanent links or shared drives on the client computer you better use a fixed IP. Regardpess if you use a dynamic or static IP, FreeNAS will display this IP above the FreeNAS main menu, in URL format, this is what you are going to input in your web browser to log in remotely to your NAS box.

Example: http://192.168.1.3 Username: admin Pass: freenas Once you log in change the login name and password to something you can remember Next Click on “MANAGE” and add your RAID array to the list of available Hard Drives, you do this by clicking on the round sign with the plus sign in the middle. Once you are done click on the format tab and proceed to format the Array as USF or USF with soft updates, whichever one you prefer. This process will take some time.

Which file system to choose? The best file system for FreeNAS is actually “UFS with Soft Updates (use 8% space disk)” this is a more advanced and updated version of UFS, I was told by the FreeNAS people that this is the way to go. Since, even if you loose 8% of space, the file system will always be in optimal condition as it does not need to be defragged. Fragmentation in a 1Tb NAS is definitely not something to be overlooked; it can greatly reduce the performance of your NAS. Some people will erroneously tell you that EXT3 is the file system to use, some will even claim that EXT3 is better when recovering data in case of a disaster, but the reality is that the disadvantages far outweigh the advantages, besides we are running a RAID5 array which is already secure enough. EXT3 is partially supported on FreeNAS but is not native to FreeNAS so performance will be greatly reduced. FreeNAS does not even have the option to format in EXT3 it will have to be done with a Linux Live CD and once it is up and running you will not even have the capability of running FSCK (File System Check). Only use EXT3 if you are running FreeNAS with Linux as an operating system because EXT3 is native to Linux, but if you (like me) installed it with the FreeNAS ISO cd then you have FreeNAS running in FreeBSD and UFS is the file sytem to use. Once you have chosen the file system, format it and its ready to go.

25 comments:

  1. xpto, 17. November 2008, 15:12

    Pablo

    Can you tell me the steps to add the “old” array.
    Or please post the link here.

    Thanks

     
  2. Pablo Garcia, 16. November 2008, 13:21

    Hi, I will suggest you go the the FreeNAS site and ask for help. They have exellent support and usually respond within the same day. Ususally when you have a brand new FreeNAS installation with an old array there is a few steps that you need to follow to get it back online. (very simple nothing complicated or time consumming) The motherboard that I used to build this project actally died on me, I had to replace it with a totally different one and reintall FreeNAS on the main drive again, everything worked like a charm and now it is as stable as ever.

     
  3. xpto, 16. November 2008, 12:50

    I was using the same controller as you.
    1 ide disk for install freenas
    3 sata disks for making the array.

    today my first ide disk died. I add a new one and I instaled freenas again.
    But now freenas is not seeing/recognizing my array. :(
    Any susgestions? Please help

     
  4. Kurgan, 15. September 2008, 16:28

    Great article!! only one question, how do you know if the card is made for dell or hp?

     
  5. Chris, 17. June 2008, 18:39

    …s’ok! Found it on the Dell support site “Overall width including bracket = 6.65 in or 16.9 cm”

     
  6. Chris, 17. June 2008, 18:34

    Firstly - great find in the Adaptec 2610SA as a profesional grade piece of kit available for a tiny price!

    Quick question though - how long is the card? I plan on using it in a rather confined space.

     
  7. Pablo Garcia, 31. March 2008, 19:25

    Lewis:

    1) There are some utilities listed in the manual. However, the 2610SA is a hardware RAID card which makes it OS independent. Everything is controlled by the card’s BIOS, the OS just sees the RAID array as one big drive.

    2) This is a question for the FreeNAS forum, sometimes it could be something so simple as a bad Ethernet connection.

    3) You can install OpenVPN on the FreeNAS server. Again, go to the FreeNAS forum and you will find information on this.

    Here’s a link to the forum.

     
  8. Lewis Dundas, 31. March 2008, 10:01

    Mr. Garcia:

    Thank you for the link to the manual. You wouldn’t by chance know where I can get a download of the Utilities and drivers? I cannot find anything either on Dell or Adaptec sites. I would like to get this so I can use this card with any OS in the future.

    I tried running Quicken with the files on the NAS, but quicken behaved strangely, some times not responding to a “backup command” and sometimes loosing a sessions transactions. Do you think this is Quicken not liking the data files being located on a NAS or something wrong with my installation of FreeNAS?

    Also, if you have the time, is there any free VPN software that can run concurrently with the Freenas using the linix engine that the Freenas uses. I would like to be able to access remotely if possible. And any free software that automates backing up network computers to the NAS?

    I know this is alot, and appreciate any info you want to provide. Thanks again for all you have done.

    Regards,

    Lewis

     
  9. Pablo Garcia, 28. March 2008, 11:00
  10. Nate, 28. March 2008, 10:57

    Hello,

    Where can i get the Nas software?

     
  11. Pablo Garcia, 8. March 2008, 11:53

    Its SATA 1 (1.5) but remember that your bottleneck is the network card, even using a gigabit card (1Gbps) your 1.5Gbps drives will be faster. Here is the manual for the 2610SA

     
  12. Lewis Dundas, 7. March 2008, 10:07

    Mr. Garcia:

    Thank you for this article, I am building it now. I have a question about the 2610SA controler. Is this a SATA I or II controler? Should I set my drive jumpers to 1.5 or 3.0 Gbs? And finally do you know where I can get a manual for this controler? One other thing on the CF to IDE adapter, I have it set to “Master” but do I need to do anything with the second jumper under the power connector or leave in the default position?

    Thank you for any help.

    Lewis

     
  13. Pablo Garcia, 27. February 2008, 23:02

    Chris

    I am not sure of the maximum capacity that this card supports but some seem to have the opinion that it can only support up to 2.5TB so I would do some research before investing. Also bear in mind that increasing the number of drives on your RAID will not make it safer it will only reduce overhead. In an RAID 5 array only one drive can fail at a time. If more than one drive fails you loose your data no matter the amount of drives you have. I would make two arrays with three hard drives on each, that way you won’t have all your eggs in one basket.

    Make sure you provide good cooling for that amount of drives. However, never exagerate on the number of fans unless you have air filters since dust sticks to electronic components and acts as an insulator preventing the heat from escaping, just make sure each drive has air flowing arround it.

     
  14. Chris, 27. February 2008, 9:14

    LOoe the Article - IM going to start a project right away. I have like 2 or 3 PII or PII machines sitting in my garage!

    Whats the Max SATA size Drive this card supports? I would like to use 6 (1TB) drives. Is that an Issue?

    Will this work with 2 of the same card in 2 PCI slots and allow for a 12GB NAS in one machine?

    I now have a PC with (12) 500 GB drives in it and I fill it up with lots of mlultimedia, MUSIC, MOVIES, TV SHOWS - ect.. It’s my HTPC and run media center edition - it’s like a super duper Tivo - But I have no redudceny - so this project would be great especially if a drive fails - Just pop a new one in and Im good to go.

    I might just do (2) 6TB nas’s instead of 12 all in one machine.

    Any Information you can provide would be great!

    Thanks,

     
  15. Pablo Garcia, 3. February 2008, 2:13

    John, The reason why I chose four Hard drives is to minimize overhead and to get as close as possible to 1TB with 320GB hard drives (which were cheap at the time), but you can use three if you like, three is the minimum with RAID5. you should be able to replace your RAID card with the same one with no problems. This card is made by ADAPTEC for DELL servers, so there should be replacements available for a while, you can even find them new or used on eBay. I’ve never had that happen to me but I did have the motherboard die and I replaced it with a totally different one, with a different chipset and it worked flawless. The comments section came with the WordPress theme that i am using, I forgot the name of it though.

     
  16. john, 28. January 2008, 7:13

    sorry, 2 more questions:

    1 do you not require only 3 disks for RAID5? Why are you using 4 in this setup?
    2) what Wordpress Plugin do you use for the comments? It looks nice and clean.

    Thanks for this great tutorial

     
  17. john, 28. January 2008, 7:10

    What happens if your raid card goes bust? Would replacing it (with just any new raid card) fix the problem, and you can carry on as before?

     
  18. PV, 7. January 2008, 18:41

    Very thorough, I’m thinking about trying it.

     
  19. Robert, 3. December 2007, 23:06

    First let me say thank you. This was a great article, it help me so much.

    I’m fairly new to the Linux world. My Company does video editing and we deal with very large files and Projects. On average one project is about 105GB or so.
    We run out of disk space very fast. Backing up and storage is a issue.

    Your instruction allowed me to build a 2.5TB or 1.8TB RAID5 for under $600.00 bucks with room to grow WOW.

    I will be adding another 2.5TB to the same system soon. The gaming case (Antec NINE HUNDRED Advance gaming case) I purchase has room for the upgrade.

    Once again Thank you

     
  20. Ken Crouch, 29. November 2007, 13:51

    Can You tell me the biggest SATA drives that can be installed on the Dell 2610SA RAID controller? I would like to use 4 500Gb drives, but I’m not sure if they are supported.

     
  21. theodosios, 10. September 2007, 17:04

    Hi, i actually have the Adaptec 2610SA in an HP storage server with 6 250 gb disks attached, works fine.
    What i want to know is, how much disk capacity does the Adaptec 2610SA support ? Can I exchange the 250 gb disks for 500 or even 750 gb ones ? Is there an issue with the adapter bios ?

     
  22. Kache, 9. September 2007, 3:57

    I’m still contemplating if I will try and set a FreeNAS box up and if so how I will do it. One thing I have learned is that I can can set the FreeNAS up in a virtual machine (VIrtualPC or VMWare or whatever) then take the “virtual HDD” file and use the dd command to “raw write” the file to a USB flash “thumb” drive (this actually makes the USB thumb drive a bootable device). Assuming the PC you’re using can support booting from such a thing you’ll have an extra place in your IDE chain for a another storage drive. And like you mentioned no moving parts so it should last that much longer. Doesn’t even have to be a fancy thumb drive. Even a 128Meg one will be sufficient. What do ya think? Good idea? Maybe I should write something about this…Oh, and there’s a dd port for Windows.

     
  23. John, 24. August 2007, 10:42

    Great! I am impressed with the good specific details and screenshots, please write more articles.

     
  24. omars, 25. May 2007, 22:14

    Thanks for the guide through the 2610SA setup, have the card and working perfectly, but was unsure about the options.
    You should look into clarkconnect, great linux server with capabilities for so much more

     
  25. Jannay, 1. May 2007, 16:13

    great article!! thanks for posting it! I actually built it and it works great, thank again!

     

Write a comment:

.