Sign in with
Sign up | Sign in
Your question
sticky Closed

RAID FAQ v1.3.2

Tags:
  • NAS / RAID
  • Performance
  • Data Security
  • Storage
June 30, 2010 12:06:10 AM

BASIC RAID FAQ
Rev 1.3.2, 26 November 2002


1. What is RAID?
RAID is an acronym for Redundant Array of Inexpensive Disks (as opposed to SLED - Single Large Expensive Disk). Today, most drives are relatively inexpensive and the meaning of the 'i' is changing into 'independent'. The purpose of RAID is to use 2 or more drives together in order to obtain increased performance and/or data security.


2. What types of RAID exists? and how do they differ?
The different types of RAID is typically referred to as 'levels'. This FAQ will focus on level 0, 1 and 0+1 since these are what is most often supported by embedded RAID controllers.

Level 0 : Striping.
Level 0 provides increased performance by writing alternating blocks of data (referred to as the stripesize) to 2 or more drives simultaneously. Read performance is also improved since data is read from all drives at the same time. No redundant information is stored and failure of a SINGLE drive will cause all data to be lost. The number of drives in a level 0 array is sometimes also referred to as the stripe width.

Level 1 : Mirroring.
Level 1 provides redundancy by writing all data to 2 or more drives. Level 1 provides no increase in write performance (it may even be a bit slower). Read performance tend to be faster than a single drive, but not as fast as level 0. Level 1 provides excellent data security since ALL drives has to fail before any data is lost.

Level 2 : Bit interleaving with Hamming error correction code.
Data is striped across multiple disks at the BIT level. Dedicated drives are used for Hamming error correction. Hamming error correction is a forward error correction code capable of correcting any single bit error or detecting any double bit error within the code word.

Level 3 : Striping with parity.
Data is striped across 2 or more disks and parity is written to a dedicated drive. Level 3 is typically implemented at the BYTE level.

Level 4 : Striping with parity.
Data is striped across 2 or more disks and parity is written to a dedicated drive. Level 4 is typically implemented at the block (stripesize) level.

Level 5 : Striping with distributed parity.
Data and parity is striped across 3 or more drives. Parity is distributed to each drive. Level 5 is the most widely used RAID for servers and other highperformance storage solutions. Any single drive can fail without data loss, ie. at least two drives must fail before any data is lost.

Level 6 : Striping with dual distributed parity.
Essentially the same as level 5, but two sets of parity is calculated in order to improve data security.

Level X+Y
It is possible to combine various RAID levels to optimise data security and/or performance. E.g. Level 0+1 and 1+0 as explained below.

Level 0+1 : Striping and Mirroring.
Level 0+1 combines level 0 and level 1 by mirroring a striped volume. Level 0+1 provides read and write performance very close (or equal) to level 0. Level 0+1 should not be confused with level 1+0. If there is 1 mirror set, a single drive failure will cause the whole array to become, in essence, a level 0 array. Level 0+1 requires an even number of drives and minimum 4.

Level 1+0 : Striping and Mirroring.
Level 1+0 (sometimes referred to as level 10) combines level 0 and level 1 by striping a mirrored volume. Level 1+0 has better data security than level 0+1. The reason for this is that the level 1+0 controller can take advantage of a partial mirror set, but the level 0+1 controller cannot take advantage of a partial stripe set.

JBOD : Just a Bunch Of Drives.
Not actually RAID, but some RAID controllers support this. In JBOD, 2 or more drives, which can be of any size, are put together so it appear as a single drive whose capacity is the sum of the individual drives. Since JBOD provides no performance increase and reduced data security, it is seldomly used.


3. Can I use different sized/typed disks for my array?
Yes, but for all levels (except JBOD) you will lose some capacity on the largest drives.
For level 0, total capacity is equal to the stripe width times the smallest drive.
For level 1, total capacity is equal to the smallest drive.
For level 0+1, total capacity is equal to the stripe width times the smallest drive.
For level 5, total capacity is equal to the number of drives minus 1 times the smallest drive.


4. Can I change my array after I have put data on it?
The stripesize or stripewidth of a level 0 or level 0+1 array can not be changed without rebuilding the array. This will cause all data to be lost. For level 1 and level 0+1 additional mirror drives can added to provide additional data security. This will not cause any data to be lost.


5. Software RAID vs. hardware RAID. Which is better ?
For the most part deffinitely hardware RAID. However, software RAID has some few advantages, but its beyond the scope of this FAQ to discuss this further. For further details on advantages/disadvantages of software RAID, check PCGuide.


6. I want to setup a level 0 RAID. Which stripe and clustersize should I use?
It depends on what the array is going to be used for. In general if the array is used for very large files (Video streaming etc.) a larger stripesize is better. For mainstream usage (office, gaming etc.) a stripe and clustersize in the 8-32 kB range is a common choice. To some extent the optimum stripe and clustersize combination also depends on the RAID controller and drives.


7. How do I setup/partition a level 0 RAID array, and install my OS on it?
The easy way:

1) Attach the drives to the RAID controller. Each drive should be master on its own channel (separate cable) for maximum performance.
2) Enter the RAID controller bios (usually you press CTRL+H after powering on the PC). Setup the RAID0 array with your preferred stripesize. The exact way of doing this depends on the controller. Note: Some controllers (e.g. the Promise-lite) does not allow you to change the stripesize.
3) Make sure you have a floppy with the RAID drivers. Boot from the OS installation CD, and when prompted press 'F6' to install third party RAID or SCSI drivers. Insert the floppy.
4) Using the installation program partition and format the drive.
5) Proceed with installing the OS on the boot partition.

The problem with the above method is that you can not specify the wanted clustersize when formatting (For NTFS the default clustersize is 4kB). If you choose to use NTFS it is not possible to change the clustersize without reformatting the drive. For FAT32, the clustersize can be changed at a later time with programs like Partition Magic.
Update: Partition Magic V8.0 is able to change the clustersize of an NTFS partition. I haven't tested this yet, but I expect it to be a slow procedure. So if you wan't to test different clustersizes, the method below should be used.

If you want to use NTFS, or do some benchmarks with different stripe and clustersize combinations the recommended method requires a third temporary drive:

1) Attach the drives to the RAID controller. Each drive should be master on its own channel (separate cable) for maximum performance.
2) Attach the temporary drive to the normal IDE controller.
3) Enter the RAID controller bios. Setup the RAID0 array with your preferred stripesize.
4) Install the OS on the temporary drive.
5) Boot on the temporary drive. When the OS is up and running, install the RAID drivers.
6) Partition and format the RAID array with the preferred clustersize. In Windows XP, Disk Management provides the means to partition drives and formatting with a custom clustersize.
7) Optionally perform benchmarks on the array. Reformat the drive with a different clustersize or rebuild the array with a different stripesize. When the array is partitioned and formatted, the temporary drive can be removed.
8) Make sure you have a floppy with the RAID drivers. Boot from the OS installation CD, and when prompted press 'F6' to install third party RAID or SCSI drivers. Insert the floppy.
9) Install the OS on the boot partition of the RAID array. Make sure you do not format the array during installation, since this will reset the clustersize to the default value.


Additional Stuff
AC&NC on RAID
PCGuide on RAID
Hamming error correction

Acknowledgments
This FAQ would not be as good as it is without the kind help of the following individuals:
LHGPooBaa
FatBurger
Scotty35 - For pointing out the difference between RAID 0+1 and RAID 1+0
sjonnie - For convincing me about the difference between RAID 0+1 and RAID 1+0 :) 


FAQ History
Ver 1.0 - Initial draft, 28 October 2002
Ver 1.1 - Revised draft, 31 October 2002
Ver 1.2 - Added RAID 6 and 1+0, 11 November 2002
Ver 1.3 - Added comment about Partition magic V8.0 and NTFS clustersize.
Ver 1.3.1 - Fixed formatting because it has been broken ages. Removed non-working links. 27 April 2009 (Moderator edit)
Ver 1.3.2 - Recreated sticky and locked the thread. June 29th, 2010 (Moderator edit)

Engineering is the fine art of making what you want from things you can get

More about : raid faq

!