Setting up RAID 1 on 14.04 with an existing drive

I have a currently installed Seagate ST3000DM001 (about 90% full) and a new Seagate ST3000DM001 (blank). I would like to setup RAID 1 without losing the data on my currently installed drive.

If I use the mdadm process outlined in this tutorial:, will my data be preserved?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

It is possible, but know that it will take a bit of time for the mirror to finish since we are talking about 3 TB. What I would do is:

  1. First prepare the disk with gdisk since fdisk can not do a partition larger than 2TB. Let us assume that the partition created was sdb1

  2. Run sudo mdadm --create --verbose /dev/md0 --force --level=1 --raid-devices=1 /dev/sdb1. The important part here is to tell mdadm that you are using --raid-devices=1 one disk right now for the RAID Level 1.

  3. Format the newly created RAID partition and copy everything from the original disk to this partition.

  4. Now prepare the other drive to be included to the RAID by issuing the following command (Assuming the original drive is sda1:

     sudo mdadm --grow /dev/md0 --raid-devices=2 --add /dev/sda1

This will grow the RAID Array (md0), set the amount of devices on it to 2 (sdb1, sda1) and add the original sda1 to it.

You can check the process of it with sudo mdadm --detail /dev/md0 it should show something like this at the end:

Number   Major   Minor   RaidDevice State
   0       8       49        0      active sync   /dev/sdb1
   1       8       65        1      spare rebuilding   /dev/sda1

And after it is finished:

Number   Major   Minor   RaidDevice State
   0       8       49        0      active sync   /dev/sdb1
   1       8       65        1      active sync   /dev/sda1

I recommend a reboot after this to make Nautilus see the RAID correctly. You can verify this is working but literally removing one of the drives while having the unit mounted and still being able to execute or view a video in it. Of course the output of --detail above would be something like:

Number   Major   Minor   RaidDevice State
   0       0        0        0      removed
   1       8       65        1      active sync   /dev/sda1

In this case I disconnected the drive sdb and still could work on the information.

UPDATE: Since util-linux 2.24, fdisk now has support for partitions larger than 2 TB and has support for GPT schemes. This support has landed in Ubuntu 14.10. Apart from this, the interface has gotten much friendlier and it supports better human readable sizes. The overall changes can be found in:

util-linux 2.24Release Notes
util-linux 2.25Release Notes

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply