Monday, October 28, 2013

System All Green

I have fixed up the hardware (less harddisk), seems to be working fine. This is the screenshot of my system.

Click to enlarge

Here is the hardware:

Click to enlarge

I am really happy with the casing, it is really spacious inside, there are plenty of space below the HDD rack (>1 inch), between the PSU and the CPU fan (~2 inch). I am sure that there will be no problem putting another 3.5" HDD under the rack if I want to, and making it into a 7-bay NAS, after all the MB and PSU is capable of handling 7 HDD.

There is a little problem that I noticed immediately, the CPU fan seems to be running at full speed for the whole time. I touched the heat sink after I power down the system, it is cool cold. Probably because I connect the CPU fan power to the wrong port, will look into it.

For my initial test, I attached an old 160GB HDD, everything seems to be fine. Next step, purchase a 3TB HDD for testing.

BTW, I would like to talk a little about the underclocking/undervolting before ending this post. Basically underclocking and undervolting is similar to overclocking, except we are doing it in the "opposite direction". It is a well-known fact that there is a positive correlation between voltage, clock speed and power consumption. The processor is running at 3.6 GHz so there is plenty of room for underclocking and undervolting to reduce power consumption. Because this is an unlocked processor, we can adjust the processor clock without changing the clock speed of other component.

To do:
  1. Investigate the problem with the CPU fan
  2. Test a 3TB HDD
  3. Underclocking/Undervolting (have to install an OS for this)
  4. Measure the system's power consumption (before and after underclocking/undervolting)

Sunday, October 27, 2013

Getting the hardware.

Things to get:
  1. AMD A8-5600K
  2. ASRock FM2A85X-ITX
  3. Fractal Design Array R2
  4. 8 GB RAM
After asking the prices from the stores, there is a little changed in my plan. Apparently the older 5400K processor is still available, and there is at least one store selling it. It is rated at 65W TDP, lower than the 5600K, and is still an overkill for a NAS, and moreover it is cheaper. I decided not to purchase the RAM because the price is just too high, I will just get the RAM from my current desktop.

Things gotten:
  1. AMD A6-5400K - $83
  2. ASRock FM2A85X-ITX - $165
  3. Fractal Design Array R2 - $199
  4. 4 GB RAM (from my desktop) - $0

Total Cost: $447. I managed to keep within budget by dropping the RAM. Well, I got the 4GB RAM a year ago at $27, so adding it in, total cost is $474, busting the budget. :(

At this point of time, I still think the decision to choose 5400K rather than 5600K is a good decision. It helps keep project barely within budget, and also gives our "green"criteria a better prospect (I hope.. haha).

A word in advance, project like this always have some risk involved. For my case, my processor may end up consuming so much power that I end up building something else with it rather than a NAS. FreeNAS might not work with my hardware, or in fact none of the OS works, and I end up falling back to Windows. Let me quote what Thomas Edison said, "I did not failed a hundred times, I merely found out a hundreds way that will not work". We just have to learn from our failure and do it better the next time. :)

Disappointment..

The earlier 2 post were prepared few months back but was written out and published here, the real work starts now.

After looking at the parts available in my country, I was greatly disappointed. Most of the parts I listed (the list, previous post, was done a many months back, just before I decided to put the project on hold), has been phase out and no longer selling here. Of course, there is always the option of shipping from overseas, but the shipment fee quoted busted the budget. And more bad news, it seems that DDR3 RAM prices have nearly doubled since I last checked. :(

Luckily, the only thing I have to hunt is the Motherboard/CPU. Here are what I decided so far:
Casing: Fractal Design Array R2 (+300W PSU)
PSU: Nil
Memory: 8GB  DDR3 Kingston 1600MHz (cheapest)

This time round, I decided to change the approach a little. Instead of trying to lock on to the CPU then motherboard, I decided to search for any ITX motherboard with 4 or more SATA ports on the list of available parts from my area, then compare the prices.

After some searching and some comparison, my chosen motherboard is ASRock FM2A85X-ITX with AMD A8-5600k processor. The motherboard has 7 SATA III port, and is an unlocked processor. Some may wonder, the processor is rated at 100W TDP, that is not so green isn't it? Well, this is the cheapest CPU/MB combination that fits my requiremnt and is an "unlocked" processor, which I hoped to underclock/undervolt it to minimize the power usage. Online review suggested that at idle, the processor draws around 20 Watt, a little undervolting/unclocking could reduce the power usage. That is basically the rational behind why I bet on this CPU/MB combination. It could really turn out ugly on the "green" criteria on my list.

Backup plan? Turn it into a home server. Haha. It is a quad core processor after all. Or I could just sell it. Well, we will see how things go.

Hardware

I shall talk about all the hardware (minus HDD) in this post.

Before selecting or looking for hardware, we should list our requirements first. These are what I am looking forward to:
  1. Low cost (Budget $450)
  2. Low power consumption (less carbon footprint)
  3. 6 drive (in fact, the more the merrier)
  4. Compact (ITX form factor)
If you want a NAS with 3-4 disk and not particularly concern about power consumption, then probably the old PC you have that is lying around could be turned into your faithful NAS.

If you want a "big" NAS with 6-8 disk, low power consumption NAS and have an old 4 SATA port PC lying around, you could underclock and undervolt to reduce the power consumption, and purchase a SATA expansion card. Or you could sell it off, and build a new one.

All in all, it depends on what you have, and what you want. For me, I do not have an old PC lying around, so I have to start from scratch. After some research, here is what I think would be fit my requirements.

CPU/Motherboard
NAS does not need really powerful processor, in fact, if it is just use for storing and retrieving data, we do not really need anything beyond Intel Atom or AMD Fusion processor. Unless you are planning to use it for something more than just feeding data, possibly a mini server or some sort, then probably you need a more powerful processor.

Ideally the motherboard should have a lot of SATA port so there is no need for us to purchase SATA card. SATA II or SATA III port does not matter, since the RAID setup might not even hit the SATA II 3 Gbps limit, roughly 357MB/s. However, having SATA III and high internal data transfer throughput is beneficial in healing the RAID. I have listed some motherboard which would be ideal for me:

Asus C60M1-I
6 SATA port, an uber low power C60 APU. Perfect.

Asus E35M1-I
6 SATA port, another uber low power E350 APU. Perfect.

MSI E350IA-E45
4 SATA port, same E350 APU as before. Great.

ECS NM70-I2
4 SATA port, low power Celeron 847. Great

Memory
Judging on our motherboard selection, max memory is 16GB, so I guess getting a single 8GB ram wouldn't hurt. If there is a need, we can always purchase another 8GB ram for our system. At this point, some of you may be wondering how much memory does commercially available NAS has, well, usually 1-2GB. Why so little? I have no idea. But basically, it depends on the NAS's OS.

Power Supply
The first thing about power supply that we should know is that there is a certification to power supply called 80 plus. There are different rating of 80 plus, which from a normal 80 plus to 80 plus platinum. Basically, certified power supply are at least 80% efficient at converting AC from your wall to the DC that our computer uses. If you are really green, you may considering getting one that is certified.

As for the rating, lets use Seagate drive for calculation (see previous post, 8W). 6 Drive at 8 watt each is ~50 watt. Processor + Motherboard + RAM = ~100 watt. We need a power supply that is at least 150 watt to be on the safe side.

Casing
Casing is pretty much like our skeleton, a well-designed casing will not only keep our component cool, but also makes our maintenance and upgrading life easier. Hot-swap or no hot-swap? IMHO, if you build a 6 drive NAS, and decide to start with 3 drive, how many times do you need to open the casing for upgrading? 3 times, if the NAS is good and healthy throughout its life. So, my take is, it is not a necessity, but good to have. Bottom line, we should try to get something decent. Here are a few that caught my attention:

3.5" HDD Bay: 6
Hot-swap: No
Dimension: 250 x 210 x 374 mm

3.5" HDD Bay: 6
Hot-swap: 4 (Weird.. why only 4? No idea..)
Dimension: 411 x 271 x 323 mm

3.5" HDD Bay: 6
Hot-swap: No
Dimension: 250 x 200 x 350 mm
Bonus: comes with a 300w PSU (Great)

3.5" HDD Bay: 6
Hot-swap: 6
Dimension: 255 x 256 x 180 mm

U-NAS NSC looks really good.

A few things to address

Few months back, this project is put on hold mainly due to personal reason, but its time to resume the project.

In this post, I would like to briefly go through 3 technical issues before we go ahead.
1) Which OS to use?
2) How do we increase the storage pool?
3) Which hardware to use?

Which OS to use?
This is actually not that difficult to decide because the bottom line is, "If it works, it will work for me". There are actually many more OS which are available other than those I have listed which either comes with a small price or "free". The OS I picked for my testing is FreeNAS.

How do we increase the storage pool?
This question came to my mind after looking into FreeNAS. The problem is that FreeNAS does not have the feature that allows you to grow the pool size simply by adding a new disk to your existing pool. This feature exist in many, if not all, commercially available NAS or NAS OS. Basically, there are 2 things I would like to address here. Firstly, making a pool with different size of disk. Secondly, how to grow the pool.

The first problem of making a pool using different size of disk can be easily solved by partitioning the disk. For example, I would like to create a RAID 5 equivalent pool using 1x 500GB, 2x 1.5TB and 2x 2TB disk, how do I maximize my storage without compromising the safety of the data? Here is the solution for the example (for simplicity, I shall ignore the 1000/1024 conversion problem):
Disk 0:   500 GB - 1 partition of 500 GB
Disk 1: 1500 GB - 1 partition of 500 GB and 1 partition of 1000 GB
Disk 2: 1500 GB - 1 partition of 500 GB and 1 partition of 1000 GB
Disk 3: 2000 GB - 2 partition of 500 GB and 1 partition of 1000 GB
Disk 4: 2000 GB - 2 partition of 500 GB and 1 partition of 1000 GB 
RAID 5 Pool 0: 5x 500 GB partition (Disk 0 1 2 3 4)
RAID 5 Pool 1: 4x 1000 GB partition (Disk 1 2 3 4)
RAID 5 Pool 2: 2x 500 GB parition (Disk 3 4) 
Pool 0 yield: 2000 GB (5-1 * 500 GB)
Pool 1 yield: 3000 GB (4-1 * 1000 GB)
Pool 2 yield:   500 GB (2-1 * 500 GB) 
Total usable storage: 5500 GB (RAID 0 on all 3 pool)
In an ideal case, 7.5TB of storage should yield us 6TB of usable storage (using 5x 1.5TB disk), but by using partitioning, we can still achieve a 5.5TB usable storage. Cool. Now, is this 5.5TB of data safe? The answer is yes, because:
1) Every pool has at least 2 disk
2) No two partition from a pool came from the same disk
For example, if Disk 2 failed, Pool 0 and Pool 1 is affected, but the data in those pool are still safe. Great

Now, the second problem. Once a pool is created, we cannot adjust the pool size by changing the exiting pool, we can only add new pool. This gives us something similar to RAID 50 or 60 and we still have 1 disk protection for 50 (2 for 60). Note: I am not sure of ZFS's inner workings at this moment, it could be 50 or just 5 and 5, the difference is 50 allows only 1 disk to fail and 2x performance, while 5 and 5 allows a maximum of 2 disk to fail, 1 disk on each 5, and no performance gain.

The only possible negative effect is, say, we decide to make a 6-bay NAS with 3x 2TB drive first, and add in more drive in the future, then our upgrading options is only add in 3x 2TB drive, making a RAID 50 pool or "upgrade" the 3x 2TB drive to 3x 3TB drive. (swap in 3TB drive one at a time, wait for the system to heal itself (resilver) then swap in another 3TB drive, until all drive are 3TB, and we get a 3x 3TB pool)

For business, it is unlikely that they will be adding in 1 drive at a time, so do not expect that ZFS will have this feature anytime soon, or at all.

Well, is there any workaround? Yes, to a certain extend. The answer is also partitioning. Please refer to this link for more info: http://wiki.mattrude.com/Freenas/ZFS_and_FreeNAS_expansion

Which hardware to use?
Alright, this could be tricky. My goal is green, DIY and NAS, so I want to keep the power consumption down and also the cost down. If we can have both, GREAT!, if we cant, then we will have to do with some scarification.

This post is getting long, I shall continue this in the next post. :)