Setting Up Mirror Disks and RAID Arrays
If you have two or more hard
in your computer, one way to preserve files is to have one drive act as a mirror for another. This is the principle behind the RAID concept.
There are several levels of RAID arrays implemented in Linux.
RAID-0 (Stripe Mode)—Multiple disks combined to appear as a single device. Data is saved in small "
" on each disk. This can dramatically increase your system performance because large
of data are split up between the drives and read or written concurrently. Unfortunately, RAID-0 doesn't offer any form of data protection. If problems arise on one disk in the array, files on both drives can become corrupted.
RAID-1 (Mirror)—Data is saved redundantly to all disks in a mirrored array. Instead of splitting data between disks, an exact copy of data being written is saved on multiple drives in the array. Each drive contains a "mirror" of every other drive. Mirroring doesn't improve system performance. However, your
of retrieving a file stored in a mirrored array are
. With most RAID-1 controllers, a mirrored drive can be configured to instantly "take over" in the event that the main drive in the system fails, providing a high degree of data protection.
RAID-4—Has three or more striped disks included in the array, with one of them storing "parity information." The parity information makes it easier to reconstruct data if one disk in the array fails. In essence, it creates an array that provides the speed of a striped array along with the protection of a mirrored array.
RAID-5—Same as RAID-4, but parity information is distributed evenly among the disks. As with RAID-4, RAID-5 provides the benefits of both RAID-0 and RAID-1. RAID-5 is more commonly implemented than RAID-4. RAID-5 boards are usually much more expensive than RAID-0 or RAID-1
RAID-0+1—Although this is not an official RAID level, many
RAID controllers provide you with the option of creating a mirrored striped array using four hard disk drives. This provides the speed and redundancy benefits associated with RAID-5 at a much lower cost.
It's important to note here that RAID can be implemented in two ways:
Hardware—With hardware RAID, you install a special disk interface into an expansion slot in your system to which your hard drives are attached. All RAID configuration
are completed using the BIOS of the RAID board. The RAID board itself, then, represents the entire array to the operating system as a single hard disk drive. Using a RAID board is
to provide faster performance than a software RAID solution (although at a higher cost).
Software—With software RAID, your system's hard disk drives are connected using the standard, non-RAID interface in your system. The operating system, then, is used to create a RAID array using these disks. Software RAID is usually much less expensive than hardware RAID, but is also considered to provide slightly slower performance.
SUSE Linux will support either type of RAID implementation. In fact, setting up a software RAID array on SUSE Linux is quite simple with the YaST Expert Partitioner.
It is always best to set up a RAID array when first installing SUSE Linux so that nothing can happen to your existing data when you're working with the Expert Partitioner.
The steps outlined here apply when you have purchased a drive to serve as your mirror drive after your initial installation. Be sure to back up critical files before starting this process. You will be changing the partition table for your system as part of the setup.
Before installing the new drive, you should convert your Root partition to change the SystemID. Start Expert Partitioner by going to YaST, System, Partitioner. Select your Root partition (
Linux Native /) and click Edit. In the resulting dialog box, click Do Not Format. Use the drop-down menu to change the File System ID to 0xFD Linux RAID. Click OK to confirm. Click Apply to convert the File System ID.
When the conversion is complete, shut down the system and install the new drive. SUSE Linux should recognize the new hardware and ask how to format it. At this point, you want to create your RAID array (see Figure 20.7).
Figure 20.7. Define the RAID type in the first screen.
Although it's technically possible to create a software RAID array using two partitions on the same hard disk drive, you should
do this. The mirrored or striped partitions should always be located on different disks.
You will create a mirror. Click Next to continue.
The second screen (see Figure 20.8) allows you to define the drives you want to mirror. For this example, we created a
drive. In a real scenario, the mirror should be at least as large as the active drive. Select both partitions and click Add to create the mirror. Click Next to continue.
Figure 20.8. Add partitions to mirror each other in this screen.
The final screen in the RAID Wizard sets options for the mirror (see Figure 20.9). For a mirroring (RAID 1) operation, there's no reason to shift from the defaults. To confirm the settings and return to the main Expert Partitioner screen, click Finish.
Figure 20.9. Set options for the mirror drive in the final RAID screen.
When you have finished with the RAID Wizard, click Apply to create the RAID array.
If you chose to use a hardware-based RAID array, you won't have to complete any of these steps. The RAID board will present the array to SUSE Linux as a single hard disk drive. Simply partition and format the logical drive just as you would a physical hard disk drive.