博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Build a Cheap and Fast RAID 5 NAS(1)
阅读量:2455 次
发布时间:2019-05-10

本文共 13058 字,大约阅读时间需要 43 分钟。

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

Introduction

RAID ("Redundant Arrays of Independent Disks"), especially RAID level 5, is particularly compelling to geeks, even wannabe geeks like me. What's not to love? You lose one disk, throw in another and your data rocks on! This is the RAID 5 dream. RAID 5 reality, however, is not so compelling. In fact, many people who know they should be using RAID 5 systems do not or cannot use the technology.

The purpose of this article is to build an inexpensive RAID 5 Network Attached Storage (NAS) system. I'll then compare the home-built system to off-the-shelf products to see how they compare in terms of performance. If we cut enough cost and produce enough value, we might convert some of the RAID 5 procrastinating masses into RAID 5 users.

For this project, I chose a RAID card from LSI Logic's MegaRAID family of RAID 5 adapters. I found the MegaRAID family based on a Tom's Hardware review () of the SATA 4 port adapter; I have been using these adapters since late 2004. After building my first RAID 5 system on the MegaRAID SATA 4, I noticed on the 'net that the older IDE/ATA generation of MegaRAID cards was available on eBay at a fraction of the price of the SATA card. (At the time of this writing, I can buy an ATA card for $80 on eBay, while the LSI MegaRAID SATA card on froogle.google.com is $260.)

Those of you who are very frugal may wonder why I'm not using a software RAID 5 solution. Well, I tried to use software RAID 5 and even bought the O'Reilly book Managing RAID on Linux in order to learn how. Recovery is the single most important aspect of RAID 5 to be sure you understand before implementing RAID 5. But even with the O'Reilly book, I could not figure out how I would recover from a drive failure, step by step. So instead, it's a hardware RAID 5 solution for me.

After using hardware-based RAID for two years, I've successfully recovered from drive failures, but just as importantly, I've learned that hardware RAID gives you a degree of freedom in designing your NAS. A hardware RAID card insulates you from operating systems and their issues. Since I use a well-supported hardware RAID card, I have installed Windows 2003, freenas, Ubuntu, ClarkConnect, and SUSE, on the same hardware, without having to learn each operating system's setup for RAID and how to perform RAID recovery.

 

The LSI Logic MegaRAID Card

The LSI Logic MegaRAID adapters are ROM-based. So the usage model is to boot the computer and then start the controller's software with a control-key sequence. The controller's software is a BIOS-style menu-driven interface that allows you to set up, upgrade, or repair your RAID 5 array. When your computer boots up, you will see the LSI Logic adapter's control instructions flash on your monitor, as shown in Figure 1.

Figure 1: Splash screen

Figure 1: Splash screen

When you press <Ctrl>+M in response, the LSI Logic MegaRAID will start its software from ROM to allow you to manage your RAID 5 array. Figure 2 shows the main menu of the MegaRAID software.

 Figure 2: MegaRAID main menu

Figure 2: MegaRAID main menu

Figure 3 shows how menus pop up in the MegaRAID software.

Figure 3: MegaRAID menu pop-ups

Figure 3: MegaRAID menu pop-ups

Note that in Figure 3 I have moved the cursor to "Configure" and then pressed the <Enter> key, to pop up the "Configure" menu. I then moved the cursor to "New Configuration" to initialize the RAID 5 array of drives. The MegaRAID software has then popped open a third menu that says "Proceed?". To finish configuring a new array I would then move the cursor to "YES" and hit <Enter>. While the interface is a flashback to the days of MS-DOS, it is functional and reliable.

The MegaRAID cards allow what I call the "sane" RAID 5 repair procedure:

Step 0: Hear the shrill wailing of the MegaRAID card

Step 1: Identify which hard drive has failed
Step 2: Shut down the RAID NAS
Step 3: Remove the failed hard drive
Step 4: Get in your car
Step 5: Drive to your local computer retailer and buy a replacement hard drive
Step 6: Return home
Step 7: Install the new hard drive
Step 8: Kick off the RAID controller's recovery procedure
Step 9: When the recovery is complete, reboot the server and carry on

I named this the "sane" procedure after looking at software RAID and concluding that recovering a drive under software RAID was (for me) insane.

Parts List

The hardware for this do-it-yourself project is shown in Table 1. To keep this project simple, there are only two hardware options: the default configuration with the motherboard's built-in 10/100 Ethernet, and a secondary configuration with gigabit Ethernet. If you're a good shopper, you may be able to beat my cost, especially if you use a retired computer that's just gathering dust in your closet.

By way of comparison, is selling on the web for around $650 and the "Pro" version is about $230 more.

  Component Cost
RAID Controller LSI Logic MegaRAID i4 (ATA) $80 to $160 on www.ebay.com
CPU Sempron 2200+ $59 (for 2600+; 2200+ is no longer available)
Motherboard ECS 741GX-M $110
RAM 512 MB DDR 400 SDRAM
Running at 266 MHz
$40
Power Supply CoolerMaster RS-450-ACLX 450W $80
Ethernet 1 100 MB on ECS 741GX-M - (included in motherboard)
Ethernet 2 32 bit 10/100/1000
Trendnet TEG-PCITXR
$19
Hard Drives 4 300 Gigabyte 7200 ATA IDE 4 x $105 = $420
Case Cheapest @ CompUSA $30
CD ROM to Boot ASUS 52x $10
OS Ubuntu 6.06 Desktop $0
Total System Cost $829 - 928
Table 1

For this project, the most important thing to be sure of is that the motherboard does not mask interrupt 19. Masking interrupt 19 prevents the <Ctrl>+M keystroke from starting the MegaRAID firmware. If you have a motherboard that blocks interrupt 19, you have to boot the computer to an OS close enough to MS-DOS to allow LSI Logic's megaraid.exe program to run. (The megaraid.exe program starts the firmware in the MegaRAID card, which then allows you to manage your disk array.) This is annoying to do when you are working on a machine for several hours, so a motherboard that does not block interrupt 19 is highly recommended.

The RAM for this system is 512 MB of DDR400 SDRAM running at 266 MHz. The ECS motherboard theoretically supports 333 MHz, but I've never been able to get memory to run that fast on this board. The power supply is a 450 watt CoolerMaster model. A power level of 450 W is more than is needed - each of my drives draws about 9 watts of power - but because you are building a RAID 5 array, you will need a lot of power connectors. A 450 W supply usually has the two extra power connectors cables needed for a 4 drive array.

I used because it installs beautifully. My favorite build of Linux is , but it would not install on the LSI Logic MegaRAID i4 controller. This is because ClarkConnect is based on Fedora 4, which pulled support for the MegaRAID i4 cards last year.

Assembly

You need a case that will allow four hard drives with a full hard drive's worth of space between them. Figure 4 shows the #1 feature I look for in a case: a drive tower that runs from the floor of the case all the way up to the underside of the externally mountable devices (i.e., the floppy and optical drives). I have found that trying to squeeze hard drives into a case that does not have extra space is a sure way to cook them.

Figure 4: Case detail

Figure 4: Case detail

Next, lay out the RAID 5 components. To make the NAS you need to basically start with a standard desktop computer without a hard drive. In Figure 5 I've already installed the motherboard, RAM, CPU, optical drive and power supply, to make a standard desktop computer that is ready to go except for the hard drives.

Figure 5: Ready for assembly

Figure 5: Ready for assembly

Then, install the hard drives one at a time and hold them in place with one screw. I leave a full drive's worth of space vertically between drives in the case, for better cooling.

Install the power cables to each drive, then install the ribbon cables on the MegaRAID i4 card and insert the card into the PCI slot. Figure 6 shows the four drives installed and powered, and the MegaRAID card with 4 IDE/ATA ribbon cables hanging off, ready to be attached to the 4 drives.

Figure 6: Drives installed waiting for RAID cable connection

Figure 6: Drives installed waiting for RAID cable connection
TIP: I advise installing the cables before you put the MegaRAID card into the computer. The connectors on the MegaRAID card can crack if you wiggle the ribbon cable towards and away from the face of the card. Installing the cables while the card is outside of the case greatly lowers this risk.

After the MegaRAID i4 card and cables are installed, connect the ribbon cables from the MegaRAID i4 to the hard drives (see Figure 7).

 Figure 7: Drives cabled up

Figure 7: Drives cabled up

At this point you can add the second screw to each hard drive and button up the case. I've never set a jumper on a hard drive when using a MegaRAID card. I simply take the hard drives out of the box, put them into the computer case and don't even look at how the jumpers are set.

RAID Array Configuration

With hardware assembly out of the way, we now can create the drive array. To do this you need to connect a keyboard, monitor, and power to the computer. Boot up the computer, and when you see the message shown in Figure 8 appear on the screen, hold down <Ctrl>+M to kick off the MegaRAID's ROM software.

Figure 8: MegaRAID splash screen

Figure 8: MegaRAID splash screen

I'm going to go through the RAID set up step by step because I found that the biggest stressor in building your own NAS is figuring out the MegaRAID user interface. I stumbled around for several days before getting my first disk array up and running because I could not find any step-by-step instructions. So now there are!

Step 1: Figure 9 shows the MegaRAID Management Menu that will pop up on your screen after you hold down <Ctrl>+M while your computer boots. Move the cursor to "Configure" on this menu, and press <Enter>.

Figure 9: MegaRAID Management menu

Figure 9: MegaRAID Management menu

Step 2: Your screen will now appear as in Figure 10. Move the cursor to "New Configuration" and press <Enter>.

Figure 10: Select New Configuration

Figure 10: Select New Configuration

Step 3: When the "Proceed?" menu pops up (see Figure 11) move the cursor to "Yes" and then hit <Enter> again. The MegaRAID card will then begin to scan all the hard drives attached to it. After a moment, the screen will go from looking like Figure 11, back to looking like Figure 10. If you try to move the cursor, it will seem like your system is locked up. Don't panic.

Figure 11: Select Yes or No to proceed

Figure 11: Select Yes or No to proceed

The trick is to watch the bottom row of characters on your computer screen. Figure 12 shows the messages that flash by on the bottom row. What is happening here is that your MegaRAID card is scanning the hard drives attached to it.

Figure 12: Status messages

Figure 12: Status messages

RAID Configuration, Continued

Step 4: After the MegaRAID software is finished scanning, your screen will look like Figure 13.

Figure 13: Array selection menu screen

Figure 13: Array selection menu screen

You'll now select the drives for your array. In Figure 13, you can see three of the four hard drives attached to this computer. The first row, with "M" underneath each Channel column, shows "Master" hard drives. The second row is "S" for "slave" hard drives. Because the MegaRAID i4 is an IDE/ATA device, you can have up to 8 drives per card in a 4 master, 4 slave configuration. The missing hard drive in Figure 13 is Channel-3 (i.e., the fourth hard drive) which is not shown because an 80-column character-based screen is not wide enough to show four drives.

Now that we see all the drives that are going into our disk array, we need to tell the MegaRAID software which of these hard drives to use. Not all hard drives have to be used in the RAID 5 array. If you have four drives, you can put three drives into a RAID 5 array, and use the fourth drive as a hot-spinning spare for recovery.

To select all the drives for our array, we use the arrow keys in Figure 13 to move the cursor to a hard drive that says Ready, and then we hit the "Space" bar to toggle the drive's status from "Ready" to "Onlin" (yes, the "e" is missing!).

Figure 14 shows what the screen looks like after I've scrolled through each of the hard drives and hit "Space" to select each hard drive for the array. It actually is the same as Figure 13, except that the drives have changed from "Ready" to "Onlin".

Figure 14: Drives selected for the RAID array

Figure 14: Drives selected for the RAID array

To select the hard drive on Channel-3 (not shown off to the right of the screen) just use the right arrow to scroll to the right to find it, and then hit space bar.

As you can see, the MegaRAID user interface is clunky, but it's not too bad once you get the hang of the implicit rule of this interface: "when in doubt, look at the bottom row of the screen." The black magic around RAID 5 then disappears, and you can become comfortable with the MegaRAID.

Once you have all the disks showing a status of "Onlin"(as in Figure 14) look at the bottom row of the screen (see Figure 15).

Figure 15: Status line after drives are selected

Figure 15: Status line after drives are selected

Step 5: Then convert the selected drives into an array. Hit "Enter" to tell the MegaRAID software you are done selecting drives. After this, the screen will remain unchanged. Next, hit <F10> to configure the RAID 5 array.

转载地址:http://pijhb.baihongyu.com/

你可能感兴趣的文章
Java Dictionary put()方法与示例
查看>>
strictmath_Java StrictMath pow()方法与示例
查看>>
java treemap_Java TreeMap values()方法与示例
查看>>
avr446是什么_什么是AVR(高级虚拟Risc)?
查看>>
贪婪算法 python_在Python中使用贪婪算法进行优化
查看>>
scala不可变和可变_在Scala中将不可变地图转换为可变地图
查看>>
pcy 算法_大数据分析中的PCY算法
查看>>
stl vector 函数_vector :: begin()函数以及C ++ STL中的示例
查看>>
Java BigInteger类| max()方法与示例
查看>>
Java BigInteger类| gcd()方法与示例
查看>>
Java类class isEnum()方法及示例
查看>>
Java PriorityQueue peek()方法与示例
查看>>
stringreader_Java StringReader ready()方法与示例
查看>>
removerange_Java Vector removeRange()方法与示例
查看>>
如何在Ubuntu中安装OpenGL。 的Linux
查看>>
python set交集_Python Set交集()方法与示例
查看>>
ruby array_Array.shuffle! Ruby中的示例方法
查看>>
c#中将整数转化为字符串_在C#中将char数组转换为字符串
查看>>
Java BigDecimal setScale()方法与示例
查看>>
Java Collections shuffle()方法和示例
查看>>