Simple clear advice in plain English

Maximise your hard disk's potential in Ubuntu

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

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Security shield illustration

How to use the Command Prompt

Lurking under Windows is the little-known world of the command line. We explain how to use this to fix faults and make your PC much more secure

Inside a hard disk drive

Cost-effective ways to upgrade a PC

You don’t need to break the bank to improve the performance of your computer

jargon invaders illustration

What is mobile broadband?

Accessing the internet from a mobile device is an incredibly useful tool but trying to understand what all the various acronyms and words mean leads to confusion

Question & Answer

Q.How do I store musician and other information about...

> Read the answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Best deals on the web

img

THREE E585 Mi-Fi Take it Away Mobile Broadband - 5GB allowance

£44.97- Buy it now

img

T-MOBILE 3G Pay As You Go iPad Micro SIM

£0.10- Buy it now

img

THREE Huawei E353u Take It Away Mobile Broadband - One Month Rolling Contract

£4.99- Buy it now

Great benefits for subscribers!

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

GIF

Grahics Interchange Format. A type of image file often used on the web, but now largely superseded by...

Great shopping deals from Computeractive