Build a Cheap and Fast RAID 5 NAS(2)

URL:http://www.tomsnetworking.com/2006/08/01/cheap_fast_diy_raid_5_nas/page7.html

RAID Configuration, Continued

Step 6: Your screen should now appear similar to Figure 16. This is a confusing screen, because the hard drives you identified as your disk array in the previous step, are invisible. The array is not yet shown.

Figure 16: Select Configurable Array screen

Figure 16: Select Configurable Array screen

Again, don't panic! The cursor is actually on the array in dialog box "A-00" of the figure, but it isn't displayed. Can you guess what to do to select the array? Hint: read the bottom row of the screen. That's right! Hit the "Space" key, and you will see the array in the A-00 box in the upper left hand corner of Figure 17. After you hit the space bar, you will see "Span-1" appear in the A-00 dialog box (Figure 17). This is your RAID array. Next we need to make it into a RAID 5 array.

Figure 17: Screen after hitting space bar

Figure 17: Screen after hitting space bar

Hit <F10> to configure the array, which means telling the controller what kind of RAID you want the array to use. A dialog will open, as shown in Figure 18. The default is RAID 5, which is what we want. Move the cursor down 3 rows to "Accept", and hit <Enter>.

Figure 18: RAID array configuration dialog

Figure 18: RAID array configuration dialog

Another dialog will now open, which asks you if you want to "Save Configuration" (see Figure 19). Choose "Yes" and hit <Enter>. The last thing to do in this step is to push the <Esc> key repeatedly to bring the cursor back to the main menu.

Figure 19: RAID Configuration confirmation

Figure 19: RAID Configuration confirmation
 
RAID Configuration, Continued

Step 7: From the MegaRAID Management menu, hit the down arrow one time to the second option, "Initialize". Hit <Enter> next hit the space bar to select "Logical Drive 0" (see (Figure 20). Next, hit <F10> to initialize the drive.

Figure 20: Initializing the array

Figure 20: Initializing the array

A dialog will pop up that says "Initialize?" as shown in Figure 21. Move the cursor to "Yes" and hit <Enter>.

Figure 21: Confirm array initialization

Figure 21: Confirm array initialization

Initialization takes about 5 seconds on my system. During the process, it pops up an initialization meter that goes from 0 to 100 (see Figure 22).

Figure 22: RAID initialization progress

Figure 22: RAID initialization progress

After the drive is initialized, go back out to the main menu and reboot your system (see Figure 23).

Figure 23: RAID array initialization completed

Figure 23: RAID array initialization completed

We've now taken the four hard drives and turned them into a RAID 5 array that operating systems will see as a single hard drive. The next step in building your DIY RAID 5 NAS is to install the operating system you will use.

Install The OS

As mentioned earlier, I used Ubuntu 6.06 desktop for the main operating system for my NAS. I'm not going to provide step-by-step instructions on how to install Ubuntu 6.06, but I will provide a few tips:

  • Let Ubuntu format the RAID 5 partition, since it sees the MegaRAID card and drives as a simple hard drive. It takes Ubuntu an hour to format a 1.2 TB partition on the hardware configuration I've described.
  • You also should be aware that Ubuntu 6.06 desktop does not have its SAMBA server installed in its default configuration. This means that the NAS won't be visible to Windows or other operating systems that support SMB / CIFS. So here's how to install SAMBA after you have Ubuntu 6.06 installed.

Step 1: Click on the "System" menu at the top of the screen, to the left of the globe icon.

Step 2: Select "Administration", which is second from the top.

Step 3: Click on "Shared Folders", which is about halfway down the menu.

Step 4: The "Shared Folders Settings" dialog will open up, and then a "Sharing services are not installed" dialog will pop up. Click on "Samba to share folders with Windows/Linux systems". Then, click "Apply" and Ubuntu will install the Samba server for you.

Step 5: Now click the "+Add" button on the "Shared folders settings" dialog.

Step 6: A "Share folder" dialog pops up. Type the name of the share you want to create, next to the "Name" field. Check "Allow browsing folder. Then, click on the "General Windows Sharing" button.

Step 7: A dialog named "Windows sharing settings" will open. In this window, set your domain/workgroup to whatever your workgroup is (the default is MSHOME). Then click OK.

Step 8: Open the terminal window and go to the home directory by typing cd /home. Then type:
chmod 0777 name
where name = your login name in Ubuntu. For example, my login name is bill so I typed:
chmod 0777 bill

Now You Have It, So Share It

I think the best way to define shares for a home network depends on two factors: the operating systems on your PCs, and how people really use the shares.


Click here for Mio Technology Limited

If you are a Windows person, you can define many shares and not suffer too much by doing so. Windows sets up a share and reattaches it by default every time you reboot the client machine. Mac OS X, however, does not automatically restore SAMBA shares. So, if you have OS X machines, you probably want to define fewer shares and then put sub-folders into these shares so you have less network drive attaching to do. If you are a both Windows and OS X person (as I am) fewer shares still wins, because the Mac's shortcomings still dictate the optimal system settings.

As far as how people use shares, a typical teenager or wife will give you at most one byte of in-the-brain memory regarding how your beautiful RAID 5 NAS works. If you keep your network shares simple enough, your family will use them. If you define your shares by a business-process or using complex logic, the shares will require more than one byte of memory to explain and your family will ignore them.

I have three teenaged boys and one wife in my house. When I first put a NAS box in, I had shares for accounting, downloads, pictures, kid1, kid2, kid3, wife, etc. What I've found over two years of using the NAS is that we use about three shares: "pictures", "everythingelse", and (update and open source) software downloads. So over the past two years, I've evolved to a "fewer shares that we really use" mentality, with zero security in setting up NAS shares.

My zero security approach has the downside of letting kids create folders within shares for projects, but it has worked well so far. The nightmare scenario here is having a teenager in a fit of rage erase everything in a share or two. Although RAID 5 is cool, it won't protect against that, so it is not sufficient as a stand-alone backup strategy...even if you don't have teenagers! I would recommend setting up a simple share structure; say, pictures, accounting and downloads. Then your NAS is ready to use (famous last words!)

Mount The Shares From Clients

I've found that mounting shares from client computers is the last 20% of the process, but can be 80% of the work. After creating a share on your DIY RAID 5 NAS with Ubuntu, go to a client PC on your network and try to log in. You'll find that the log-in won't work. This is because every NAS has a trick to allowing clients to mount shares. This sick torture, inflicted while we wannabe geeks are at the finish line, is the price we pay for using open source products.

The trick to making your RAID 5 NAS share mountable on other computers is the /etc/samba folder. One great resource for getting little things going on your Ubuntu installation is Ubuntu dapper. The SAMBA tricks are located in the Samba Server section.

First open a terminal window and check to see whether Samba is in fact, installed when you used the administrative menu click-to-install process I described previously. The acid test is to type:

sudo /etc/init.d/samba restart

If you get a “samba not found” message you’ll need to install Samba manually. To do this, make sure you can reach the Internet from the Ubuntu machine (open a web browser), then type:

sudo apt-get install samba

Ubuntu will then prompt you for password. Just give it the password you set up when you installed Ubuntu.

Next type sudo apt-get install smbfs then sudo /etc/init.d/samba restart again and you should see the services stop and then start.

Now you can enter cd /etc/samba and then ls to verify you can see smb.conf. If you can, type sudo nano smb.conf and enter your password when prompted and hit return. Then type <Ctrl>+<w> to search for a text string and type in security = user.

The search will bring you to the part of smb.conf that looks like this:

####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user


take out the ; at the beginning of the security = user line and then change user to share, i.e. security = share

Then, scroll down to the very bottom of your smb.conf file where you should find the following:

[test]
path = /home/bill
available = yes
browseable = yes
public = yes
writable = yes

Note that the last part of the path name, i.e. /bill, will probably be different, as noted earlier. Now add these lines:

create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup

The final product will look like this:

[test]
path = /home/bill
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup

Type <Ctrl>+<x> to exit the Nano editor, then hit Y to save the changes. Finally, restart SAMBA by typing:

sudo /etc/init.d/samba restart

To log on to my RAID 5 NAS I needed to authenticate with no username and no password. This is not a very secure Linux SAMBA configuration by any means, but it will get you started. If you still can't mount your NAS share after following all of this, you'll need to consult the Ubuntu dapper links above. Also be sure that you run chmod 0777 [sharename] on the directory you are trying to share.

RAID 5 NAS Performance

Updated 8/1/2006

So, how good is the DIY RAID 5 NAS? Figures 24 through 27 compare the performance of the DIY RAID 5 NAS to Buffalo Technology's 1 TB TeraStation NAS. The same iozone procedure was used to take all of the data shown, but I ran iozone on a Windows XP Pro, 2.4 GHz Celeron P4, 1 GB RAM machine. So while the results aren't exactly apples-to-apples, the test machines used are close enough in configuration to allow a reasonably accurate comparison.


Figure 24: Write Performance w/ 100 Mbps LAN

Figure 24: Write Performance w/ 100 Mbps LAN


Figure 25: Read Performance w/ 100 Mbps LAN

Figure 25: Read Performance w/ 100 Mbps LAN


Figure 26: Write Performance w/ 1000 Mbps LAN

Figure 26: Write Performance w/ 1000 Mbps LAN


From the benchmark results, it is clear that if you are going to build your own NAS, you want to build it with a gigabit Ethernet card. On smaller file sizes, the gigabit-equipped DIY RAID 5 NAS is clearly superior on both writes and reads. But on very large files, it is slower than the TeraStation.

Figure 27: Read Performance w/ 1000 Mbps LAN

Figure 27: Read Performance w/ 1000 Mbps LAN

This behavior holds up regardless of operating system used on the DIY NAS. Just for fun, I installed Free NAS .671 to compare with the Ubuntu results. Averages tend to hide things, but I've computed the average read and write speeds for the TeraStation and the DIY RAID 5 NAS using Ubuntu and FreeNAS .671 and summarized the results in Table 2. The read and write results represent the average of 32, 64, 128, 256, 512 and 1024 MB file size runs using 64 KB record size.

The averaged results show that the DIY server using Ubuntu comes out a little faster with a 100 Mbps connection, but blows away the Terastation with a gigabit Ethernet connection—even without using Jumbo frames! Since a gigabit Ethernet NIC costs less than $20, its inclusion in any DIY NAS is a no-brainer.

Test
Configuration
TeraStation NAS 1.0 TBDIY RAID 5 NAS
Ubuntu 6.06 DTFreeNAS .671
Avg Write
1000 Mbps
7,03623,9404,479
Avg Read
1000 Mbps
11,90027,56620,152
Avg Write
100Mbps
4,8975,059Not Tested
Avg Read
100Mbps
8,2999,136Not Tested
Table 2: Average Performance Summary- DIY NAS vs. Buffalo Terastation

Conclusions

A RAID 5 NAS can provide everyone in your home with a simple way to back up and move large amounts of data. My household's NAS is a critical piece of infrastructure to support the evolution of self-expression in schools. Where I wrote papers by hand for middle school and high school classes, my sons cut CDs, use desktop publishing, and create movies—using the NAS to move iMovie and iDVD projects from computer to computer. And, because the kids forget about the projects and leave them on the server, an archive of their creativity is automatically made. (I also secretly horde my kids' art projects in paper form!)

So should you buy or build a RAID 5 NAS? The better question is, "why should I put off moving my data to RAID 5?" As we acquire gigabytes (and in some cases Terabytes) of valuable content in digital form, the robustness of that data becomes an increasingly important issue. Anyone who has had his or her iTunes library wiped out due to a hard drive failure already has felt the sting of relying on a single drive for data storage.


Weekly Competetion

Storage and / or backup on a RAID 5 NAS can provide a step up in keeping your data safe from hard drive failure, but can't protect against fire or theft or an angry teenager out to teach the folks a lesson. So it can be an important part of a data security plan, but not a complete substitute for a comprehensive backup strategy.

The make versus buy decision is likely to be shaped by the size of your pile of old equipment. Many people already own all the hardware needed except the hardware RAID card. Any old "too good to throw out, but not good enough to use" PC is a candidate for becoming a RAID 5 NAS. With an $80 MegaRAID card (and maybe a cheap gigabit NIC) you can turn "ol' dusty" into a very good RAID 5 NAS for a very low price.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值