Use software Raid to make the most of your disk space
Most desktop computers now come with two hard disks and, with the price of hard disks being so low, it is inexpensive to add extra storage to a PC. Quite often, the extra space will not be used efficiently; a Windows system may simply have the extra disk as an unused D: drive.
One way to make good use of two drives is with software-based Raid. Linux has an excellent implementation of this and it is possible to install a distribution fully onto a Raid system. Here, we are going to look at installing Ubuntu in this way.
But why use Raid? There are two reasons: performance or reliability. In the case of the former, the PC uses more than one drive at once to access files; in the latter, the files are duplicated across more than one drive, so that if one disk should fail, the filesystem is still accessible.
With two disks available, the choice is striping or mirroring. Three or more disks allow for more complex arrangements that take advantage of performance and reliability.
Software Raid
In normal circumstances, the operating system detects the hard disks and assigns
a device name to each of them. These are the familiar /dev/sda, /dev/sdb, and so
on.
These disks are partitioned in the usual way, and the partitions directly mounted onto the filesystem. But with software Raid there is an additional layer that comes in the middle.
A Raid device is created and configured by adding regular hard disk partitions and setting the type (known as the level, such as striping). This Raid device is then mounted, just as if it were a normal partition, and everything else is managed by the operating system.
As an example, take two 500GB hard disks, which Linux refers to as sda and sdb. Each has an empty 100GB partition sda2 on the first drive and sdb1 on the second.
A new Raid device, known to the system as /dev/md0, can now be set up to use these two partitions. If the level is set to 0 (striping), the /dev/md0 device will now provide a 200GB disk; if set to 1 (mirroring), a 100GB disk is available instead.
Notice that partitions are used for Raid devices, not whole disks. This is very flexible, as it allows you to use only part of the drive in a Raid configuration.
Booting Raid
The PC Bios and the ‘Grub’ bootloader are responsible for locating the partition
the operating is installed on. Unfortunately, since the Raid array is fully
managed by the operating system, we reach a difficult situation: the operating
system needs to be running in order to access it.
There is of course a way around this - it is the kernel that sets up all the devices, and the kernel is found under the /boot directory.
The solution, therefore, is to create a separate and normal partition (such as /dev/sda1) for /boot to go into.
The Grub bootloader can access all normal partitions and so find and start the kernel, and then the rest of the operating system is started without a problem.
Article tags
Related articles
Q.How do I store musician and other information about...
Q.Why can't my browser find the website address I typed...
Q.All updates have been downloaded, so why won't Windows...
Grahics Interchange Format. A type of image file often used on the web, but now largely superseded by...
|
|
|
|
|
Nikon Coolpix S570 BlackPrice: £66.99 |
Computeractive Ultimate Guide - Storage, Sharing & BackupPrice: £5.99 |
Back Issue CD-Rom 13 (2010)Price: £9.99 |
Hallmark Card Studio DeluxePrice: £15.31 |
Marine AquariumPrice: £15.41 |