Sunday, October 27, 2013

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. :)

No comments:

Post a Comment