12,063,278 members (62,633 online)
Network Attached Storage - otherwise referred to as NAS - is probably the best way to add storage that is generally available across your LAN. Possible uses for a NAS device are as varied as the myriad of choices of hardware made to support it. You can use one solely as an automatic backup device, share videos and music across the LAN, or even stream content to a HTPC.
Yeah, you can buy pre-built devices the size of a hardcover book, but what fun is that? The reason I'm building one is that I need to automate backups of four systems in my house. I don't want to have to think about it beyond the initial setup. I'm also tired of burning DVD's (I've probably spent thousands of dollars on blank media). Sure, an occasional backup to DVD is probably warranted, but not every backup. It's a pain, and I have to baby-sit the process. No thanks.
Note: This article deals expressly within the realm of a trusted networking environment where you don't have to worry about local intruders (your kids and their friends), idiot users (your spouse and your friends), and your LAN is not exposed in any way to external access (the internet). Also, my intended use is currently just a way to conveniently store incremental backups and the occasional restore point for all of my machines.
If you intend to share files (videos and music) across your LAN, you're pretty much on your own as far as adequate hardware is concerned, but I suspect that everything I say below is applicable to the most extreme usage. Now, let's get on with the show.
Why would you want to? There are several commercial items available, ranging from simple single-disk units targeted at home networks to veritable behemoths, supporting as many as a dozen drives in a single rack. The more money you spend, the more capable the pre-built NAS is. The same is also true of a homemade NAS device, although you automatically start out over-spec'd because I assume that like me, you'd be using fairly modern hardware (even if you start out with used hardware).
As far as pre-built units are concerned, I've found (by reading user reviews of various devices) that service is spotty, reliability is a crap shoot, and anything even remotely adequate starts at about the $500 price range, and that's for a diskless 4-disk NAS device that supports RAID 0, 1, 5, 10, and JBOD, and allows hot-swapping and unlimited (but variable) drive sizes. Remember, you've spent $500 so far and STILL don't have any drives installed in it. If that's the case, then why not build it yourself? After all, a NAS is nothing more than a dedicated file server, right?
Chances are pretty good that you have some almost-ancient hardware laying around. You know, that box that nobody wants because it's got a single-core CPU in it and only 512mb of ram, a machine that wouldn't boot Vista on a bet, and is barely usable under Windows XP. Say hello to your soon-to-be home-made NAS device. However, before you press that old 386 system into service as a NAS device, there are several aspects you should consider.
Before building your own NAS, there are a few things you have to consider. Since it's probably going to be powered up 24/7, you have to think about power consumption, heat, and noise. A typical workstation-class computer consumes considerable electricity, and generates a moderate amount of heat, despite making enough noise to wake the dead in an attempt to evacuate the heat. Next, how much space is it going to consume, and just where the hell do you put something like that?
Your primary goal should be to reduce power consumption, because that cascades into an overall reduction in heat (and noise). At the same time, you don't want to sacrifice too much performance in your quest for arctic-like temperatures. Here are some general tips to reduce power consumption:
If there's one thing you don't want from your NAS, it's noise. You'll have as many as four (or more) hard drives in the box, a power supply fan, (maybe) a CPU fan, and at least a case exhaust fan. You might even have a case intake fan. All of these items can add up to a very loud system unless you take steps.
Putting the drives on power-save mode where they spin down during periods of inactivity will reduce the noise level (and heat). Putting a fan rheostat panel in the machine will allow you to reduce the rotation speed of your fans, thus making them more quiet. Under-clocking the CPU may allow you to even eliminate a fan. To reduce the fan noise, make sure your system uses nothing but 120mm fans. They're bigger, and move more air at lower speeds. A 120mm fan rotating slower than it's maximum speed usually moves more air than a smaller fan at it's maximum speed.
One other tip is to replace the fans that come in the case with higher-performance fans. They move more air and are much more quiet than the fans that come in computer cases. The key is to get the quietest fan that moves the most air when operated at 12 volts. A fan rheostat will allow you t dial down the speed without sacrificing too much air movement.
Using a computer as the basis for a NAS means the case is gong to be - well - huge, especially when you compare the that to a pre-made NAS. Make sure you have the floor space to stand it up. A mid-tower case is not a bad thing because it promotes better cooling and the possibility of using passively cooled components. Obviously, this is going to reduce the noise level and power consumption as well.
I realize I started out talking about using old hardware that you have just laying around, and that's still a very viable option, but when you throw the heat/power considerations at your ancient hardware, you must certainly realize that power/heat ratios will be worse with old hardware because they simply didn't have the technology to address those things as well back in the day those components were built.
Further, old motherboards don't have SATA2 connectors, forcing you to buy a SATA2 controller card, and most probably in the lower performing PCI form factor. The PCI bus is notoriously narrow, so you'll be throttling the performance of your NAS, and believe me, if you're doing anything other than backups, this will not be a "good thing"(tm).
Do yourself a favor and build a new box. It's not nearly as expensive as you might think it is. I just build a COMPLETE system for my sister that cost less than $400 (AM2 single-core 45w CPU, 2GB RAM and a nVidia 8400GS video card). The motherboard I chose for her wouldn't be a good NAS candidate because it only has two SATA connectors, but there are an adequate number of motherboards with the correct specs and almost as cheap.
For a NAS device, I would pick a motherboard with four SATA2 connectors, at least three PCIe slots, built-in video, and built-in gigabit LAN, as well as support for at least 4gb of RAM.
You can save a lot of money buying a motherboard with the required built-in components, but be sure to keep an eye on compatibility with your chosen NAS software. A modern system should provide a sustained minimum transfer rate of 8MBs on a 100Mb LAN, and that's a LOT better than many of the lower-end pre-built NAS devices.
In my case, I have a complete system that is so unused that it had been unplugged and retired to the closet. The system is comprised of the following components.
This system is built inside a Rosewill R5604-BK mid-tower case that provides 120mm fan openings for both intake and exhaust. Yay! This case cost me all of $55 when I bought it a couple of years ago. It also provides a flip-up cover that exposes front-panel USB and Firewire400 ports. Convenient, but probably not necessary. There is room for four external (5-1/4 inch) drives and four internal 3.5-inch drives. This case is screwless, so installing and removing drives will be a bit less of a hassle. I will be keeping this component.
For a device that will be powered up 24/7, you need a reasonably high-quality and reliable power supply. The one in my system is a CoolerMax unit providing a maximum of 430 watts to the system (far above the presumed needs). It also has a number of SATA power connectors. I will be keeping this component.
The motherboard is an ASRock 939Dual-SATA2, and has the following NAS-related specs:
The following external ports are provided:
What's really cool about this motherboard is that I can run a AGP video card, leaving the PCI Express slots available for other cards with more demanding throughput needs. I can also upgrade to an AM2 CPU that consumes less power. I probably won't be doing this since throwing money at this motherboard is beyond pointless given the nature of it's availability.
Initially, I decided to just use the single SATA2 connector on the motherboard, more as a test than anything else. Eventually, I'm going to replace the motherboard with something that has built-in video and LAN, and at least four SATA2 connectors. Reducing the hardware in the box is always a good thing, and a new motherboard like I described will allow me to get rid of the 3Com NIC and the video card (less heat, less power consumption).
I won't be needing the on-board SATA1 ports. In fact, the on-board SATA1 controllers are disabled, as is the floppy controller. I had to keep both of the IDE controllers enabled so that I can a) boot the system, and b) install software from a CD. Actually, I could even get a IDE-to-USB converter and just plug the DVD drive in as needed, thus allowing me to disable the 2nd IDE channel, but that means two more wires hanging around outside the machine. I also don't need the serial, parallel, or sound functionality, so those are disabled as well. I'm not sure if this will affect the power needed by the motherboard, but there's really no point in having this stuff enabled if I'm not going to need it.
I'm very fortunate to already have an acceptable CPU. It's a single-core Winchester-based AMD64 3200+ that runs at 2.0ghz. While a dual-core chip would provide better performance, the single-core consumes less power (and makes less heat). It's also almost 3 times as powerful as the CPUs used in your typical pre-built NAS device. This means I can under-clock it and STILL have something with more oomph than a pre-built NAS. I may even be able to get by with a passive cooing system for it. The motherboard also supports the AMD Cool-n-Quiet functionality of the CPU, so it can reduce power when the CPU is idle.
The system currently contains two 512mb sticks of memory. Less memory would present a better heat/power profile, but I'm not sure what kind of memeory requirements I'll have to deal with. Again, we're only running a NAS here, not a gamer/workstation box. For now, I'll be keeping the memory that's in the box.
One of the advantages of using the motherboard that's in this box is that you can run a AGP video card OR a PCIe video card in it. Using a AGP card frees up the PCIe slots for cards that can actually improve the performance of the system due to higher available throughput, such as an appropriate add-on SATA2 controller. The system already utilizes a passively cooled ATI Radeon 9200. I'm not a fan of ATI, and the 9200 really is much more powerful than is necessary, but I'll be keeping it for now.
The motherboard has it's own LAN connector, but I added a 3Com 905TX when I originally built the system because I don't inherently trust built-in components on motherboards. I know, that's a weird and completely unfounded attitude. However, the card is well-supported in Linux and FreeBSD, so to avoid hassles, I use it. I'll be keeping this component until I upgrade the rest of the network to Gigabit status.
The system current contains a pair of 80gb hard drives and a DVD-Rom. The hard drives will be removed and replaced with an alternative boot device (discussed below, and the DVD player will remain to allow installation/update of the NAS software.
The system is currently equipped with a brace of 120mm cooling fans - one for exhaust, one for intake, and one for the CPU. All of these are controlled by a fan rheostat panel. When building the box, I purchased the fans for their low noise levels and the amount of air they move. Each fan was about $20.
To make my existing system a NAS, I have to change out some of the components. Fortunately for me, the list is quite small.
First, I need to remove the original hard drives and install something to boot from. The idea is to use something that doesn't make heat, and doesn't use much power (I can't stress this enough).
Since most of the NAS software out there consumes so little hard drive space, you may be able to get away with using an IDE flash drive/CF card combination. This, of course, depends on which NAS software you've chosen. The typical flash drive plugs directly into your motherboard's IDE connector, and a Compact Flash card is then inserted to act as an IDE hard drive. The cost of a flash drive and a reasonably large/fast CF card is around $60.
The only downside to using a Compact Flash drive is that it doesn't support DMA (without a hardware mod to the flash drive itself), and will therefore adversely affect the performance of the system. Granted, the flash drive will only be used to boot the system and modify configuration files, but for me, any performance hit is simply unacceptable when there are better options available.
In my case, I have a couple of old 2.5 inch IDE hard drives that were removed from laptops. The one I'll be using is a Hitachi TravelStar that spins at 4200 RPM. The model number is IC25N020ATMR04-0, and it was manufactured in January 2004. The benefit of using this drive is that I can get a 2.5-3.5 converter for just $5 from NewEgg (saving $55 because I don't have to get the flash drive/card), and it's capacity is much higher than any affordable flash card.
The only downside is that since it's a hard drive, it will consume more power and make more heat than a flash/CF drive. However, being a laptop hard drive, it certainly consumes a lot less power and makes a lot less heat than a typical desktop hard drive. I think the trade-off is worth it, especially when you factor in the better performance as well. You can find used laptop drives for as little as $20 on EBay, and ranging in size from 20-gb up to 160gb (definitely overkill). If you go this route, try to stick with the 4200rpm or 5400rpm drives because they use less power and make less heat.
Lastly, if your motherboard allows you to boot from a USB device, you can use a USB stick to store the NAS software. I don't see this as being nearly as worry-free as having an internal boot device, so I chose not to go this way.
Okay, this is the big cahuna. Remember, the motherboard I'm using already has two SATA1 connectors, and one SATA2 connector built-in. Since disk performance is one of my primary goals, the SATA1 connectors are automatically eliminated from the "usable" category. Also, there is only one SATA2 connector, effectively eliminating the use of more than one SATA2 drive.Not only that, but having only one SATA2 drive eliminates the possibility of using RAID. Finally, I don't like built-in components due to the possibility of failure and compatibility issues. The card I've chosen is a PCI Express Highpoint RocketRAID 2300, and runs $110 at NewEgg.
For those reasons, I feel that it's best to go ahead and purchase an add-on RAID-capable SATA2 controller that supports at least four drives. This pretty well future-proofs your NAS, even if you don't use all the capabilities of the card.
Next, you have to select the actual hard drives. The best advice I can give you is buy the biggest drive you can possibly afford. If you're sharing files on the LAN (videos, music, etc) your hard drive space will get chewed up faster than you can say "V for Vendetta". If you're using your NAS to hold backups, your storage needs are considerably less dramatic since most of the time, you'll be performing incremental backups.
For my initial setup, I got a 500gb drive (about $95 if you get an OEM drive).
So, should you use old hardware, or new hardware. There are pros and cons to both approaches.
Old hardware is probably going to be more compatible with the Linux/BSD kernel. This is a big benefit to using old hardware, but there really is no guarantee that Linux/BSD will support YOUR hardware. This biggest con about using old hardware is performance. If the motherboard doesn't have PCIe and SATA2 built in, your disk throughput will suffer, sometimes dramatically so.
New hardware's biggest benefit is that you'll be able to exploit much faster CPUs, more (and higher-performing) memory, and higher storage throughput. However, compatibility with Linux/BSD may not be as thorough (right now).
As you can see, you must take steps to ensure hat your selected hardware can run under Linux/BSD. Check their Hardware Compatibility Lists, scan the appropriate forums, and pray that you made the correct hardware buying decisions.
I would recommend that you buy a spare NIC, SATA2 Controller card, and hard drive, just in case something fails. It's hell when you have to wait a week (or more) for the UPS guy to show up with replacement parts.
I also HIGHLY recommend that you get a UPS for the NAS. Most NAS software features UPS-handling code that will perform a controlled shutdown of your box in the event of a power outage. It doesn't have to be a monster UPS (probably a 600/650 will do), and it's really cheap insurance against damage.
There are a few free packages available that turn your system into a NAS device, but the three that seem to get the most use are FreeNAS, OpenFiler, and NASLite. Since my use is restricted to a home network for the purposes of storing backups of my other systems, I chose FreeNAS.
NASLite was a viable candidate until I found out that it doesn't have a webGUI interface. We're well into the 21st century, and there's absolutely no reason to settle for a Telnet interface in this day and age. Besides that, it costs money - not a lot of money ($30), but money nonetheless. Finally, the HCL seemed to be lacking in my view.
OpenFiler exerts a much heavier footprint in terms of OS image, and is in fact a full-blown Linux distro that consumes about 500mb of space when installed. It also has a lot of heavy-duty features such as quotas, user and group management, and other enterprise features. This also makes it more difficult to use from a hobbyist/home LAN admin standpoint. If you're up to it, I'd definitely recommend using this package.
FreeNAS is a small-footprint (about 40mb) distro based on FreeBSD. It's reasonably feature rich, and development is on-going. There is also a very active user community, with the code and forums being hosted on SourceForge. This software was my choice due to it's lighter footprint, ease of use, and availablity of user-based help via the forums.
Using FreeNAS is a piece of cake. Just download the ISO, burn it to a CD, and boot your soon-to-be NAS machine from the CD. Assuming you've done your homework and selected the most compatible hardware you can find, FreeNAS should install in less then a minute onto your boot device. It's really just that simple. When you get the FreeNAS splash screen, wait for the little audible tweeter sound, and press Enter. At this point you will be presented with a text-based menu that allows you to configure the system. Here are the default settings you need to know:
You can change all of the settings available in the menu from the WebGUI, so just open your browser and browse to the IP address shown above. You will be prompted for the admin user ID and password, and upon providing that info, you will be presented with the FreeNAS webGUI.
From this point on, I must refer you to the documentation and FreeNAS support system. Have a ball with your new NAS. The reason is because you're probably going to use your NAS differently than I do mine. I will say, however, that I chose NFS for the disk format, and enabled CIFS. If you're using Vista workstations, remember to disable "Allow null passwords" in the CIFS setup.
The only thing I wish FreeNAS had was printer server capability. I'd love to dump my Keyspan print server device because it doesn't have (and the manufacturer isn't planning to have) any 64-bit driver support.
For those of you that suffer from a complete absence of the "google" gene, here are some links that are bound to go bad sometime in the future.
It's been two years, and I need to make some changes to my NAS. Performance and reliability up to this point has been top-notch. Nothing has failed, and it "just works". However, I now want to add many more hard drives so that the machine can serve as an auxiliary media tank for my HTPC. This means I need more SATA ports.
One of the downsides of the motherboard I'm using is that it is severely limited regarding the number of on-board SATA2 ports - and I now need many more than that. I now have a few choices:
The benefits of replacing the motherboard are that I'd be getting GB LAN (to match the rest of my network) and built-on video (removing the need for an add-on video card). The cost of upgrading would definitely cause one to lean heavily toward the add-on SATA controller (and an add-on GB LAN network card), but the less add-on stuff you have, the cooler your system runs. Lastly, buying more socket-939 stuff would be kind of pointless since it's getting harder and harder to find decently priced replacement motherboards, so it looks like I'm going to be getting a new motherboard. When I decide what I'm going to get, I'll update this article again.
As you know, I use FreeNAS. In fact, until 02/18/2010, I was still using the original version I installed back in 2008. I finally updated to the latest version (0.7.1-4997), and found out that FreeNAS is being converted from FreeBSD to Linux. The reason is that the author feels that trying to extend the capabilities of FreeNAS is impossible without a total rewrite, and without moving to a Linux-based distribution. I don't have any idea as to when this conversion is supposed to be ready, but you can bet I'll be moving to it when it's available.
Most of you may already know that I also built a HTPC (Home Theater PC), and that I've copied most of my movies and TV shows to it so I can just select movies without having to go find the disc in our media cabinet. My HTPF has no more room for additional hard drives (there are three 1TB drives in it right now), so I decided to see if I could use the NAS as a storage container for additional movies.
The only roadblock keeping me from implementing this (beyond needing more drives for the NAS) is that the HTPC has a wireless (802.11g) connected to my network. This means that it takes about 30 minutes to copy a 5gb movie ISO file from the machine I ripped it on to the HTPC. This is a pain because if I want to get any performance on my ripping machine, I have to wait until just before I go to bet to copy ripped movies to the HTPC.
As I type this, I'm waiting for my "N" router (with GB LAN) and a GB switch, which should improve the copy time to be a little faster than a 100mb wired connection (which takes just 8 minutes to copy the same ISO file).
My other issue was that I didn't know how effectively the NAS could stream media to the HTPC since it was a wireless connection. Well, I tried it last night with my 802.11g connection and 100mb LAN, and was pleasantly surprised to see that streaming was perfectly fine. There was no degradation in picture, and the movie appeared to play at the expected speed. However, there's no point in pushing my luck, and that's why I'm upgrading my entire LAN to GB and wireless "N".
Another aspect of putting the media files on the NAS is that I can build minimal "receivers" and make it possible for ANY TV in the house to show movies stored on the NAS. I'm positive that if you want to be able to do this with a wireless connection, you'll need a 300mbps capable router. If you want to stream to more than two TV's you'll probably need a 2nd router (on a different channel). Of course, you could always just run a wired connection to all of the TV's you can, and this would definitely be better.
This update should at least prove that building your own NAS is a LOT more flexible than being a "consumer" and buying a pre-built NAS box. As your needs and capacity requirements change, you can re-configure your NAS to be as powerful as you need it to be.
I thought I'd share my recent update experience. If you've been following along, you know that I was intending to upgrade the motherboard in order to get a system that a) required no add-on adapter cards, and b) had more SATA2 ports. Tonight, I made just such an upgrade. While the motherboard is currently available as of this update, like all things related to computers, it may not be in the near future, but I'll go ahead and mention it anyway. It's a Gigabyte MA-785G-UD3H. It's got on-board video, on-board gigabit LAN, and SIX SATA2 ports, and it supports AM2, AM2+, and AM3 processors from AMD. I also added a 2TB WD hard drive to the system.
To say the upgrade was painless would be a significant understatement. I simply removed the old Socket 939 motherboard (and CPU and RAM), and installed the new stuff. Then, I turned on the system, and FreeNAS booted right up. Finally, I added the new hard drive to FreeNAS, and it's ready to go. Counting the hardware swap, it took about 45 minutes to complete the upgrade. Try that with your every-day pre-built NAS...
Again, this really illustrates the flexibility that comes along with building your own hardware. I couldn't be more pleased with the lack of drama.
Nobody can say that I know when to leave well-enough alone. Today, I upgraded my boot drive from the original laptop 4000rpm IDE hard drive to a 32GB Corsair unit - their Nova Series CSSD-V32GB2-BRKT for $75 on Amazon.
FreeNAS only requires about 500MB of space (including a reasonably sized swap partition), and to be completely honest, I only partitioned 1GB of space for use on the drive. That means I have 28GB of unpartitioned space on the drive. I could EASILY have spent $20 less and got a 16GB SSD, but bigger is always better, right? Besides, I still have to put a SSD in my pfSense box, so the Kingston 16GB drive I ordered will go into that machine. Anyway, back to the show.
PANIC: OHCI_ADD_DONE: Device at 0x6fdf1cb0 not found
I figured I had somehow messed up the BIOS with the changes I'd made, so for the next two hours, I tried different things until finally, I realized that the problem was because the motherboard doesn't do things with USB in a way that BSD understands. I swapped the keyboard out for a PS2 unit, and the problem was solved.
My NAS box now boots at lightning speeds, and runs just a little cooler and quieter than before.01/10/2011 - Edited to fix the step numbers.