Linux can build nice workstations but protecting local disks with RAID is difficult. Here is my current preferred configuration.
My favourite workstation cases are quiet and cool and unobtrusive. The larger one has space for four disks and three DVD drives. The smaller case fits two disk and two DVD drives. This article uses RAID 1 for speed and RAID 1 works with two disks. The smaller case uses two disks as one RAID 1 array. The larger case could have two RAID 1 arrays using two disks each or use a different RAID.
RAID 1 on four disks
For four disks, I combine two disks as one RAID 1 array then combine the other two disks as a second RAID 1 array. You can use one array as a system disk and the other array as a storage disk. You can then backup the system disk to the storage disk and backup the storage disk to the system disk.
You could take the two RAID 1 arrays and combine them into one big disk using RAID 0 and equivalents.
You could also start by combining two disks into one Logical volume
, combine the other two disks into a second logical volume then apply RAID 1 across the two logical volumes. When one disk breaks, you lose the whole logical volume and have to rebuild the whole logical volume before you can rebuild the RAID array.
RAID partitions
To prepare a RAID partition for use as a file system partition, you create the RAID partition on each disk then you connect the partitions into one array then you define the file system level partition within the array. You use RAID 1 for two disks. You can use RAID 5 for 3 or more disks. You can use combinations of RAID 1 and RAID 5 for 5 or more disks. There are other RAID types that could work but give you no advantage, may reduce reliability, and complicate recovery.
RAID 0
RAID 0 is not RAID. The R in RAID means redundant and there is nothing redundant in RAID 0. Never use RAID 0. It is not safe. It is not faster. It limits backup options. It complicates recover from disk failure. It makes recovery slowwwww.
There are also lots of different ways to implement RAID 0. No matter which one you use, one break on one disk breaks the whole lot. Everything is lost.
RAID 5
RAID 5 uses two or more disks to store data and adds a spare disk for redundancy. When a single disk breaks, you can replace the broken disk and recover the broken disk from the data on the other disks. Our four disk case could use RAID 5 with three data disks and one spare. The three data disks, at 500 gigabytes each would produce 1500 gigabytes or 1.5 terabytes.
RAID 6
RAID 6 is RAID 5 with an extra data disk. RAID 6 can survive two disks breaking at the same time. Our four disk case could use RAID 6 with two data disks and two spare disks. The two data disks, at 500 gigabytes each would produce 1000 gigabytes, 1 terabyte, which is exactly the same as using two RAID 1 arrays.
RAID 10
RAID 10 is RAID 1 plus RAID 0 (which is not RAID!) in a combination that is difficult to recover. There is almost always a better combination than RAID 10.
Logical volume
Logical volume
is another way to achieve something similar to RAID 0 but the term logical volume is also used to describe other arrangements for connecting multiple physical drives or multiple partitions into one big disk or one big partition.
Some logical volume software works only when the new disks are identical to the old disks. Avoid logical volumes unless you have a lot of spare time and spare machinery to test in detail all the things that can go wrong with logical volumes and, more importantly, test recovery from a failure.
Disk drive size
Both cases are fitted with 500 gigabyte drives because they were purchased when 750GB drives were the new premium drives and 500GB gave the best space per dollar. When you use larger disks, there are some partitions that stay the same size and some that expand to fill the disk.
Partitions
We want to create three partitions on our RAID array(s) and will look at them first then look back to the RAID arrays used for the partitions. We want a boot partition, a swap space, and to allocate the rest of the disk for our system partition.
All operating systems need a place to store their boot sequence settings and software. Linux uses a partition and the partition can use the Ext3 or Ext2 file system with some old fashion Linux distributions forcing the use of Ext2. The boot partition can be on RAID although many Linux distributions will not create the boot partition on RAID because they cannot then configure the partitions to work after a disk failure.
This page shows the boot partition I usually set up. It is small and on RAID in the hope that one day Linux installation programs will be able to construct boot sequences to boot after a single disk failure. Currently you end up with a second book partition that will not work.
Ubuntu 9.*

The workstation example was created using Ubuntu 9.04 then updated to Ubuntu 9.10. The screenshots are from Ubuntu 9.10. Your Linux may vary.
Disk utility
Select System, Administration, Disk utility. The following image shows the disk utility. Select disk drives and partitions in the left side column.

Notice the link SMART status: Disk is healthy - More information
. SMART is a disk error indicator and is described in SMART disk with screen shots from the More information link.
Boot
The following image shows the RAID partition defined on the first disk for the boot partition. Mark the RAID partition as Bootable.

The following image shows the file system installed in the RAID boot partition. Turn off access time recording for the boot system to remove the overhead.

Swap
Swap files are an obsolete idea from a time when computers had little memory. You can run Linux without swapping but not without a swap file. Linux places the swap data in a specially formatted partition named a swap space. You can have as many as you like. The swap spaces can be trivial in size because you can install enough memory to keep your computer going without swapping.
We are using two disks so create two swap spaces. On the rare occasions there is swapping, the swapping can spread out over the two drives. If you actually allow swapping, a small solid state disk would be a better place for a swap file but solid state disks are more expensive than adding more memory, bringing you back to installing maximum RAM when you buy your computer.
You do not want to recover swap space after a disk failure, removing the main reason for using RAID. Linux automatically spreads swap activity over swap partitions removing the need to use RAID for performance. The swap spaces are defined direct on disk without sing RAID.

System
Allocate the rest of the disk to the system partition. Everything will go in this partition. This will be the partition you backup.
On each disk you create a RAID 1 partition. The following screenshot shows the partition, called a component, on the first disk.

You join the partitions, components, together into an array. You join two equal size partitions to make RAID 1. The next screenshot shows the components assembled into an array, called a drive.

You then define your file system partition on the drive. The following screenshot shows the information for the system partition.

Conclusion
RAID 1 provides a huge increase in reliability, a noticeable increase in performance, and is easy to implement in a workstation using a recent Linux distribution. Recovery is tricky and needs practice before you depend on the RAID array.









- Facebook Like
- Google Plus One
- Log in or register to post comments