In my current Ubuntu server, I have 2x 2TB Western Digital RED hard drives in a RAID 1, using mdadm. I would like to add 2 more 2TB RED drives, and convert it to a RAID 10. I realize I would have to wipe the data most likely, but is there any way that I wouldn't need to? I have the 2TB volume almost completely filled up

  • I believe the level option of mdadm --grow will allow this. I have used it to go from raid5 to raid6 but not from raid1 to raid10 so I have not tested that. – drescherjm Jun 21 '13 at 18:32
  • BTW before you would grow you would add the 2 other drives as spares. – drescherjm Jun 21 '13 at 19:32
  • Similar question:… – Kevin Panko Feb 6 '14 at 17:29
  • @KevinPanko Exact duplicate! Oh well, he got my upvote – Canadian Luke Feb 6 '14 at 17:35
up vote 6 down vote accepted

This took some strategy, and unfortunately, was a little while ago, so bear with me; I'm going by memory.

Essentially, I shut down the server, and installed the two new drives. I did a backup beforehand to an External 4TB HDD (much faster since it had USB3!), just in case. I didn't need to use it thankfully, but I'm happy I at least had it. I took note of what the partition sizes were on the disk (by block size), and what each disk was. At the time, sda and sdb were the drives with the current array loaded. sdc and sdd were the new drives. I copied the partition layout to the two new disks, using fdisk as root. I then created a new array, with two missing members:

mdadm -v --create /dev/md1 --level=raid10 --raid-devices=4 /dev/sdc1 missing /dev/sdd2 missing

This command creates the array, called /dev/md1, sets the RAID type to 10, and says that there should be 4 devices, in a perfect world. The devices I added were /dev/sdc1 and /dev/sdd1 for the first partition. Once it was up, I mounted the array (as /mnt/raid), and did an rsync -avP /mnt/data/ /mnt/raid/, and waited a day for everything to copy.

Once it was copied over, you need to fail the hard drives in the array, and remove them: mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1. You can then add that hard drive to the new array, and wait for it to rebuild. Then, remove the last drive from the array (using /deb/sdb instead), and add it back (mdadm /dev/md1 --add /dev/sda1).

Finally, to remove the old array from starting up or giving warnings, run mdadm --stop /dev/md0. At this point, the old array is gone! I would suggest double-checking that the boot loader is installed correctly on the array (or, depending on your scheme, the boot sector of the hard drives). Give it a test reboot; if everything comes up, great! If not, that's why we have a backup!

As a bonus, I learned a new useful command: watch cat /proc/mdstat to automatically update the screen every 2 seconds with the rebuilding status of your drives.

  • ServerFault has a very similar procedure, with one notable suggestion: try to boot your new array before destroying the old one (it's okay to fail one of the drives in the old array beforehand, but not both). – Jonathan Y. Oct 3 '15 at 20:06
  • @Jonathan already posted as a comment to the question – Canadian Luke Oct 3 '15 at 21:31
  • Oh, right. Although, I believe it bears mentioning that specific difference explicitly. – Jonathan Y. Oct 3 '15 at 21:40
  • Simulated this with loopback devices using /dev/loop0, /dev/loop1, /dev/loop2, /dev/loop3 , with each pointing to files disk0.img, disk1.img, disk2.img, disk3.img . It worked and I managed to write it fully with text file and managed to read it back without any corruption. One thing I couldn't figure out, with mdadm --details /dev/mdX, Used Dev Size was half of Array Size, I repeated it while changing order of missing, it didn't matter. I have 3 other RAID arrays, 2 of them RAID 1, one of them RAID10 with 2 disks using f2 layout,for all both sizes equal.Any guesses? – sdkks Oct 19 '16 at 1:20
  • @CanadianLuke When you mdadm --detail /dev/mdX , what is Array Size and what is Used Dev Size ? – sdkks Oct 19 '16 at 1:21

If the RAID controller supports restructuring RAID 1 -> RAID 10, yes, possible loss of data.

Software RAID ...

Add the empty net RAID 1 on two new HDD. Will Raid c similar reliability and without the risk of losing data.

  • Uhhh... What? 15 character minimum – Canadian Luke Jun 21 '13 at 18:52
  • @Luke Software RAID to me about it ...… – STTR Jun 21 '13 at 19:34

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.