How to build a DIY NAS

nas

I'm looking for good, detailed instructions on how to build a DIY NAS (Network Access Storage). I'm planning on doing it cheap (old PC config + open source software). But not too cheap either. I'm ok with investing in a RAID card setup if you think that's advisable.

I would like to know:

  • What hardware I need to build one
    • What kind of hard-drive setup I should take (like RAID cards)
    • Or any other relevant hardware specific advices (power supply, motherboard, fans etc…)
  • What software I should run on it, both what OS and software to manage the contents effectively
    • So the NAS is recognizable and accessible to my network
    • I can make sure my Windows computers will recognize it (when using Linux distro's)
    • I can access my files from outside my network
  • What I'm trying to accomplish
    • I'm looking to use this as a share hub at home. That being said, should be robust enough to handle a "big" home 😉 say 5-6 desktops.
    • primary goal is essentially to store and access all my home/family's media in one common safe location.Types of files include media/movies/music/videos/documents etc. (Streaming would be a big +).
    • backup is critical. All my data needs to be kept in safe location. Should any of the comps go down or under the formatting knife, I want the media available at all times in a safe location.
    • A good balance between storage/redundancy/speed? Neither a university/corporate setup sized setup nor a 2 pc powered home setup. 🙂

To sum it up: The ultimate DIY geek built home purpose NAS. If such a thing exists.


I did a fair bit of searching and found these links:

Ubuntu

FreeNAS

While these links are great, they don't have detailed instructions with regards to reasoning and how the build was approached. I'm looking for more instructions and detailed recommendations at each stage, including the software instructions.

Best Answer

What kind of hard-drive setup I should take (like RAID)

If you want redundancy, you'll need at least two disks and at the least create a RAID 1 mirror. Personally, if you want any solid prevention of data loss, a solid RAID card from a reputable manufacturer (3Ware, LSI, Adaptec) would help. Some people want flexibility and (linux) software RAID these days I hear/read is much more reliable than previous years. Linux LVM is a software based RAID solution that adds a lot of flexibility to volumes that's very convenient to have. If money is an issue, odds are software RAID will be your best choice.

RAID is all about trade-offs; how many disks to get the redundancy you want vs. how much storage you can actually use. RAID 5 is commonly used because the trade-off is less in comparison to RAID 1 or 10. The downside is some minor performance issues. So how many disks do you have? How much total storage do you want? How many disk failures are you willing to endure? Worse, how many concurrent disk failures will you tolerate?

One word of advice: stay away from on-board SATA RAID controllers from either nVidia or Intel. In terms of stability/reliability, those on-board controllers (IMO) are cheap substitutes for the real thing and may put your data in a complicated situation. I'm sure the nVidia/Intel solutions do well enough with speed and such, but when you're messing with data, making sure it's intact is the most important thing (to me). With hardware RAID, more money is a trade-off for reliability and at times speed. Pick your battle and plan from there.

Or any other relevant hardware related advices (power supply, motherboard etc...)

It sounds like you have a budget in mind, and all I can tell you is to prioritize money towards your objectives. If you're building a NAS simply to share storage with several computers and don't care about too much about any factors, than any equipment will do. If you want to be able to expand/append more drives later with minimal effort, this may require some additional hardware.

What software I should run on it, both what OS and software to manage the contents effectively So the NAS is recognizable and accessible to my network

I use OpenFiler and so far, it's been pretty easy. There will be a bit of a learning curve no matter what you choose, but make sure you read the documentation before hand. I tried FreeNAS a while ago and didn't really like it, but it may have changed for the better since then.

For storage to be recognizable for your client computers, it's all about protocol (see the next response).

I can make sure my Windows computers will recognize it (when using Linux distro's)

For windows, you'll need a specific protocol: SMB (samba) which FreeNAS, OpenFiler, etc. support. Granted you can use others like NFS, CIFS, but SMB is best suited for Windows networking with Linux machines. Recognizing SMB shares is pretty simple these days, but if you have a domain controller (which I doubt) then authentication tied with SMB can get a little harry.

I can access my files from outside my network

This is partially a network issue. Between having a port open on your firewall and port forwarding to your NAS, this might get a little complicated and isn't as straight forwards as RAID or simple file sharing is.

How do you want to access your files? Via the web (http)? VPN? NFS? FTP? Rsync?


While it's a lot of fun to build stuff, sometimes people forget the simplest things. In your case, knowing how to build isn't as important as what you're trying to do. Network storage is relatively simple, but complexities can rear their ugly heads without some planning/foresight. If you can update your post, please include what you're trying to accomplish. For example: is this for work/home? Will the NAS host media/documents/databases/code? Do you want to maximize storage over redundancy or speed? What's the primary goal/need for the NAS? (etc. etc.)

Hope my rant helps. ;)


Update response to changes in OP

I'm looking to use this as a share hub at home. That being said, should be robust enough to handle a "big" home ;) say 5-6 desktops.

Ok, this is not too "big" but I understand your aim. Read on for my responses to your goals.

primary goal is essentially to store and access all my home/family's media in one common safe location.Types of files include media/movies/music/videos/documents etc. (Streaming would be a big +).

Ok, most home (consumer-type) NASes on the market pretty much do exactly what your asking for. The great thing about an off the shelf solution is that for the most part the value-add is simplicity/usability, support and size in comparison to rolling your own solution. The con of course is typically pricing which is usually dependent on the number of disks. Small NAS solutions are fairly cheap in comparison to making your own, however in your case, it appears that your primary goal seems to be aligned with a large storage pool, flexibility in terms of usage and ultimately some level of redundancy. Not to fear, there several vendors that would meet your needs. It all comes down to budget.

Actually things boil down to budget, technology and ease of use.

backup is critical. All my data needs to be kept in safe location. Should any of the comps go down or under the formatting knife, I want the media available at all times in a safe location.

Most would claim that NAS isn't a backup per se, but rather a redundant solution and to some degree, they're correct. But I understand your concern for data integrity.

As long as your RAID holds up, your data should be okay. I'd recommend looking at an off-site offsite back solution if you're really worried about the array being broken/corrupted. Rsync.net, Carbonite and other services may be what you're looking for. The great thing about most consumer NASes is that they include rsync so either path you choose, it'll be an option.

A good balance between storage/redundancy/speed? Neither a university/corporate setup sized setup nor a 2 pc powered home setup. :)

For your needs, speed will not be a major factor. Granted, performance boils down technology used (RAID level, controller vs. software, protocols, etc. etc.). I doubt that you'll use SCSI hard drives running at 15k rpm so don't fret on speed.


I sense you're really in the mid-market of NASes. You need a lot of storage, expandability with redundancy. So I'll tackle your question in 2 domains: building your own NAS vs. buying a NAS solution.

Building your own NAS:

Pros:

  • Can be cheaper vs. off the shelf solutions
  • Depending on OS/software, building NAS can be more flexible vs. consumer solution
  • Imagination is your only limitation
  • Repairing or adding more components is usually not dependent on proprietary vendor solution

Cons:

  • Typically longer setup vs. consumer NAS
  • Numerous technologies make decisions more complicated; vendors simplify work
  • May requires mastery/expertise in configuration and troubleshooting

Buying a NAS solution:

Pros:

  • Simple user experience; easier management
  • Usually faster setup depending on vendor solution
  • Vendor support; good vendors usually turn out numerous updates and additional features over time to compensate vs. building your own
  • Depending vendor, customer community may be very helpful (ReadyNas.com comes to mind)

Cons:

  • Price. Usually more expensive after 3-4 disks. 2 Disk NASes are usually very competitvely priced, but don't give you all the features and redundancy you might need.
  • Vendor proprietary technologies; drobo, netgear and other vendors have their own RAID solutions. If you plan on sticking with a vendor, you're pretty much stuck with the quality of their technology. This can be good or bad, depending on the vendor.
  • Most likely that vendors use software RAID vs. building your own hardware RAID

From reading your post, if you are very comfortable with building a machine, supporting and configuring it, I'd say rolling your own NAS might be the way to go. You didn't mention specific protocols (NFS, iSCSI, SMB, CIFS, etc.) so my thoughts say you're really looking for a simple file share for all computers to use. Fine. That's pretty easy. You could use any free linux distro (Ubuntu, SuSE) or NAS OS (FreeNAS, OpenFiler) but use what you're comfortable with.

To reduce costs, you could use software RAID but I personally prefer hardware RAID. It's a matter of choice/trade-offs. If cost is a concern, Linux RAID should probably do just fine.

If you're not comfortable with Linux/BSD, uncertain about which RAID to use or worry about troubleshooting, I'd say go with a consumer NAS. There are several vendors out on the market: Netgear, Drobo, QNAP and Thecus come to mind. You're probably looking for a minimum 4-disk solution and a maximum of 8-disks for redundancy. Don't worry too much about speed, but if it's a concern, from reading numerous reviews, Netgear and Thecus do fairly well in terms of performance.

I'm looking for more instructions and detailed recommendations at each stage, including the software instructions.

I'd say determine which path you're going to go first: DIY or out of the box. Detailed recommendations can come after that decision.

Hope this helps!

Related Question