ComTech: IT Support Stirling

How to set up RAID 1 on an existing Linux system

ComTech: IT Support Stirling

Recently I did a tutorial on how to set up RAID 1 on a new Linux system.  Today I will show you how to set up RAID 1 on an existing system.  Why I hear you ask on an existing system? It is true that, if possible, you should set up RAID on a server during installation however there are times that you can’t (only one hard disk present or the person installing didn’t know the correct procedure so chose not too instead).

The method I am going to show you involves using a piece of software called Clonezilla, which is opensource cloning software, so you will need to get your hands on it. You can download it from the Clonezilla website.

For the purpose of this tutorial I will be using Ubuntu 12.04 installed on a 500 Gb hard drive.  I will clone the installation using Clonezilla and then set up a RAID 1 array on two new 1 Tb hard drives.  Once the RAID 1 array has been set up I will then copy the Ubuntu image onto it.

Lets get started.  First thing to do is to BACKUP ALL YOUR DATA.  Even though you are effectively backing up your data when you image it I always recommend you backup your data using a different method just incase something happens.

Now onto imaging your system.  I have already written a tutorial which covers the required steps so rather than repeat myself please refer to the Clonezilla Tutorial for the method.

Once you have imaged your system connect your two new 1 Tb hard drives and disconnect the old 500 Gb one and again reboot the system using the Clonezilla Live CD.  Go through the menus the same as before until you get to the screenshot below.



This time instead of choosing Start_Clonezilla choose Enter_Shell.  Once at the shell we need to check our two new disks so type:

sudo fdisk -l

Write down the designations of the two disks (e.g /dev/sda) as we are going to need these later.

Now we need to create partitions and filesystems on the two disks and we do this by using fdisk.  The steps required to accomplish this are covered in How to format a hard drive on Ubuntu 12.04 using fdisk.

Now we need to install a package called mdadm which we shall use to set up the RAID 1 array so type:

sudo apt-get install mdadm

Once installed we can go about setting up the array.  In your terminal type the following:

sudo mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/sda /dev/sdb

NOTE: There are two dashes infront of create, verbose, level and raid

In the above command:

level=1 is the raid level (in this case Mirror)

raid-devices=2 is the number of hard disks in the array

/dev/sda and /dev/sdb are the disks to be used (obtained earlier using fdisk)

If successful then you should get mdadm: array /dev/md0 started

Now we just to check the array so in your terminal type:

mdadm –detail –scan (again using two dashes)

This command should return details of the array we have just set up.

All that is left to do is to exit the shell and resume Clonezilla so in your terminal type:


which should return you to the screenshot we had earlier.  This time choose Start_Clonezilla.

Follow the wizard to install your saved image onto the new RAID 1 array.

About the Author

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.

For a list of what I can offer you why not visit my website where you will find a list of my services, testimonials, blog and much more.





One thought on “How to set up RAID 1 on an existing Linux system

  1. Hello

    Thank you for this post!
    I have the following issue:
    I have a raid-1 array of 2 x 500gb disks with linux raid (mdadm) where a Ubuntu 12.04Lts
    installation resists.
    I want to backup this array on an external hdd by using Clonezilla and restore it to a new array of 2 x 1tb hdds.
    So I booted on Clonezilla cd and started Shell, configured networking, did apt-get update, apt-get install mdadm (it was already installed).Did “cat /proc/mdstat” and I could see the assembled raid-1 array as /dev/md127.So far so good.
    Now what I am trying to do is to make and image of this /dev/md127 array but for some reason it does not appear on Clonezilla wizzard (neither savepart or savedisk option).
    What does appear are the individual disks/partitions (/dev/sda1 and /dev/sdb1).
    On Clonezilla site I see that it does not support officially mdadm raid.
    So how did you manage to make /dev/md127 to appear as an option on Clonezilla wizzard?

    Thank you in advance

Leave a comment

Your email address will not be published.


Get every new post delivered to your Inbox

Join other followers

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
WP Like Button Plugin by Free WordPress Templates