Ubuntu – RAID 6 to RAID 1 with mdadm

mdadmraidraid1raid6Ubuntu

My home network is changing and I am moving my file storage solution away from my Ubuntu server and onto a Drobo FS.

I currently have 6 500GB hard drives in a RAID 6 array providing 2TB of capacity. All important data on the existing RAID 6 array has been copied to the Drobo and thus the array can be rebuilt without thought as to data loss.

Here is the description of the RAID setup:

marcus@vhost:~$ cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid6 sda1[0] sdf1[5] sde1[4] sdd1[3] sdc1[2] sdb1[1]
      1953535744 blocks level 6, 64k chunk, algorithm 2 [6/6] [UUUUUU]

unused devices: <none>

The End Result

I wish to end up with 2 500GB drives left in a RAID 1 array providing 500GB capacity, and as a result 4 free 500GB hard drives (some of which will be added to the Drobo).

What is the best way to achieve this, does it involve shrinking the array and then changing the RAID level?

Thanks for any help,

Marcus.

Best Answer

Since you don't care about any data now on the disks, just destroy the array and create another one. Let's see: stop the array, remove all the disks (I'm not sure this step is necessary), zero out the superblocks to avoid any warning down the line, and create a RAID1 array. This should look like (obviously I'm not going to test this...):

mdadm /dev/md0 --stop
mdadm /dev/md0 --fail /dev/sd{a,b,c,d,e,f}1
mdadm /dev/md0 --remove failed
mdadm --zero-superblock /dev/sd{a,b,c,d,e,f}1
mdadm --create /dev/md0 --level=1 -n 2
mdadm /dev/md0 --add /dev/sd{a,b}1