Worrying about a bunch of external drives, on your floor that you inadvertently 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.
Note: Before we start the project. If you are still trying to decide between Openfiler and FreeNAS, read my article: Openfiler Vs. FreeNAS.
- 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:
|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|
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
Turn the computer on and hit CTRL-A when you see the following message come up on the screen
Click on SATASelect Utility and then on Controller Configuration
Make Sure everything looks exactly the same as in the following screen:
Go back to the initial screen and click on Array Configuration Utility, then Click on “Create Array”
Press INS button to select all drives and ENTER when done
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.
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.