Homemaded Network Attached Storage: the way you save your bucks but not your bill. Ask for a fast network attached storage, we do it ourselves. With the inspiration from the article “DIY NAS Smackdown” by smallnetbuilder.com and requirement to store much more things, DIY NAS comes to my mind. The first thing we have to know about NAS is what it is exactly. NAS is a computer which does only a purpose, sharing a storage. So, it could be very limited computer such as 300MHz CPU, 128MB RAM, hard drive, and NIC. That means you can reuse your old computer in a garrage as a file server for your home network. Because of this small requirement, recent NAS products like LaCie Ethernet mini, Buffalo Storage Station, etc, come in very small factor as same as Firewire, USB Storage. But instead of only a controller that transform internal interface into external interface, this is a whole computer set with embedded OS that is the point to differentiate the performance and usuability of each product.

an OS that requires to run on NAS can be not only embedded OS but full one as well. However, in order to cut down the product cost, no one braves enough to put Windows XP Professional Edition into its product. Like LaCie, they have two OSs for their products which are their tiny Linux distribution for low-end product and Windows embeded for high-end product that needs an agressive performance. This time, we will pay attention to how boost our DIY NAS with nice Linux distro, Ubuntu, and Windows XP to make a comparison. The thing that makes NAS differs in term of performance is packages that send over the network has headers which is different by each OS and protocol and how they handle data over network.

For you guys who don’t familiar with Linux, you have to know Samba, the service to share a file over Windows network. You will have to set up only a few things to make it work. About the installation, Ubuntu team does make it very easy for everyone, I’m sure.

Step 1: Choosing the hardware

I will start with all parts building this NAS; my purpose is doing NAS, HTTP, MySQL, and FTP server. The best thing of being in the US is there are a lot of rebate throughout the year. Sometimes it’s mail-in rebate which is not really good; sometimes it’s an instant rebate. That’s really awesome. Every parts I got is rebated-stuff. Here we go:-

AMD Opteron 144 1MB L2 Cache 1.6@2.0GHz $69.99 
256MB PC3200 RAM (from sidewalk garbage, so it's free)  
M/B Foxconn WinFast 6150K8MA-8EKRS $69.99 
DVD-RW SATA Sony NEC $31.99 
2*Seagate Barracuda 160GB SATA-2 8MB buffer ST160812AS-RK $39.99*2 
Ultra mATX case $59.99 
--------------------------------------------------------------- 
Total: $69.99+59.99+31.99+79.98+59.99 = $328.07 

I think that’s reasonable price: Gigabit Ethernet, nVidia GeForce 6150 onboard, Firewire, RAID 0, 1, 5 (which I cannot use because of only 2 harddrives I have & not any available place for another one) However, if you have your old computer, you might have to buy only any Ethernet NIC (no matter it’s 10/100 or gigabit) and hard disk drive that is big enough. Then you will have to spend less than a hundred to get 400GB NAS. Sound good, right?

Step 2: Installing an OS and setting sharing folder

How we set up the Ubuntu server. The reason why I choose Ubuntu server edition is it’s light and Ubuntu community claims that this version performs better in server hardware (ha ha maybe they tweak for Opteron, I hope). Other might prefer desktop version which included GUI, honestly so do I but it doesn’t matter how beautiful it is when using as server. I went through this following step for installation:- - go get Ubuntu Server Installation CD at http://ubuntu.com (now it should be Feisty Fawn - 7.04) choose CPU architecture you have to get the best result - burn into disc - boot with that CD, it will start menu and select install Ubuntu server. - follow the instructions, you have to build a partition for it at least 2 partition: 1 ext3, 1 swap (about 2 time of RAM) (actually, there is an automatic option as well) - after finished installation, then install samba server by login and type the following commands:-

sudo apt-get install samba 
sudo apt-get install smbfs

This is all set for installing samba. Next, you have to config your share directory and decide what directory to share (mostly in /home/), you could create new directory by command below.

mkdir /home/xxx
chmod 0777 /home/xxx
cd /etc/samba 
sudo nano smb.conf

change the line

;security = user

to

security = share  ## without ';' 

and change user to share, then go to the end of file and add this

[share] ## name for sharing 
path = /home/share ## whatever directory you want 
available= yes 
browseable= yes  
public =yes 
writable= yes 
create mask = 0777 
directory mask = 0777 
force user = nobody 
force group = nogroup

This is for non-security sharing which is the fastest one. So, if you want others, go for it. However, in order to show how good the OS handle the data, this is the best way to find a distinction.

Step 3: Testing

I choose to test with iozone, let’s see what happens.

what I have so far is all based on 100Mbps:-

lacie – LaCie Ethernet Disk mini 250GB, Linux Embedded - 2.4.25-lacie6, 266MHz CPU, 32MB RAM, 250GB 7200rpm 8MB cache ubuntu – Ubuntu 6.06 LTS server, my system above, No RAID because Ubuntu doesn’t support my fake RAID winxp64 – Windows XP x64 Profession, RAID 0 (nVRAID - onboard)

for limited time, this is all I have tested. When I get more stuffs, we might see more details.

   

   As you know from the review, Lacie Ethernet disk mini is low-end product, so the performance is not that good. But comparing to how convenient & green–low power consumption–it is, it’s still great.

   

   Ubuntu has so impressive result. Larger record size, the faster transfer rate you will get. By the way, the common record size that transfers through network is 64kB. So we might use 64kB result as a reference. About reading rate, you will see the effect of larger record size but not that much. I think it’s quite good in 100Mbps environment.

   

   Windows XP x64 is a choice that doesn’t come to my mind at first. I just want to find a reference for comparison with others. However, Windows XP 64bit performs so fantastic on writing test. You will see the missing data in some points; that mean that transfer rate is over 200kB. I have no idea why this happens. As soon as I found the answer. I let you know. About reaing rate, it’s about the same as Ubuntu. Just OS of you choice. Free or not is all up to you :-)

This is the first part of NAS testing, you will get more idea what is NAS. Next time, we will see how to tweak and get the best performance.

Step 4: Conclusion

There is no question that Windows XP x64 is far superior than others, especially in writing test. It doesn’t have large record size effect on reading test as well. I have tested several times to make sure if the rate is right; all I get is about the same. That make me wonder how write speed is that high, some are much over the 100Mbps limit. But it costs $140 more, so it’s up to you what platform are on your way. For me, I won’t select yet. I have to test on FreeBSD which supports this RAID and see what’s going on.

However, write and read rate of Ubuntu w/o RAID 0 are acceptable, especially read rate that’s better than WinXP64 for unknown reason (at least for me). It should be enough for NAS for sure. As soon as you upgrade the system to gigabit ethernet, it will show its potential underneath :-P Have fun to work on your NAS.