msgbartop
The ins and outs of Yvo’s life.
msgbarbottom

16 Oct 07 How I build my 2 TB NAS

I mentioned in my last post that I procured 4x 500GB at a very good price. The intention the entire time was to build a cost effective but reliable NAS in order to store my various files centrally instead of a copy on the iMac, a copy on the laptop and another copy elsewhere. Not to mention that all these systems only had one hard drive, meaning one single failure could wipe out some of my data (with exception to the iMac which has a 250gb firewire drive to which it syncs data every night with my own little written rsync script).

There are some software solutions that have been released that purely focus on the ability to quickly create a NAS. I had simple requirements. I needed Samba for my Windows based laptops, NFS for my Linux workstation and AFP for the Macs. FreeNAS was the first thing that came to my mind. Openfiler was out, one because it hadn’t been developed in over a year (doesn’t show developer commitment in my mind then) and NAS lite required you to have a hardware RAID controller. While ideally that would’ve been the nicest, there are some software solutions that do a very well job. Unfortunately FreeNAS was not reliable. The latest RC missed a ata.timeout flag, which caused my disks to get “detached” because the spinup too longer then my 5 seconds. I tried the beta which did include this functionality but after the loads were without any clear reason why at 2.x – 3.x and my file transfers were moving like molasses, I rebooted the machine. It never came back up. The restart process literally damaged the software based RAID. At this point I let the idea rest for 3 days until I decided that I didn’t need a dedicated NAS solution/package to get my NAS to work. I have enough experience now to get my own machine together and it’ll be exactly what I want.

My current job requires me to use Red Hat and Solaris. Both are very well developed operating systems (I’m even going to a Solaris training camp in December paid by my work) but they aren’t my choice of operating system. My last employment had me use Debian and I really like how Debian works and is setup. DEB packages are fantastic and aptitude (apt-get previously) makes it even better. It is, in my opinion, years ahead of RPMs and the Yum software. So I downloaded the 140MB Debian 4.0 Netinst CD and I was on my way to getting Debian rolled onto my old desktop.

I ran into some problems with the power settings my ASUS BIOS was handing to Debian. Adding pci=noacpi and disabling Hyperthreading (what was Intel thinking) made the problems go away. Debian comes with the md software package which includes mdadm. A great utility to manage software raids. I created a 4 disk RAID 5 array with disk 4 being a “spare” drive. I know you are probably thinking that I am nuts as that’ll cost me 500gb of usable space (plus the 500ish that RAID5 requires for parity data) leaving me only with 1 TB instead of 1.5TB of storage capacity. I’d rather be safe then sorry and if that means giving up a bit of space to make sure that I have a reliable setup, then so be it.

After installation I setup up netatalk (had to get the apt sources and flip a switch as the default one comes with ssl disabled thus only clear text passwords, which PAM doesn’t accept are sent to the server), samba and NFS. My home partition is where the big partition is mounted. I have a symlink called /share pointed to /home/share. Reason I did home is so that Cam can also put our personal documents in unique home directories.

Machine has been up for a week now without any issue.

References I used from other sources to help me get that perfect setup (giving credit where credit is due):
Software RAID5 and LVM with the Etch Installer
Apple File Server on Linux

Tags: , , , , ,

Leave a Comment