SOFTWARE RAID WITH MDADM
MIGRATION FROM RAID 5 TO RAID 10
PRECAUTIONS:
Disk/RAID setup changes are coupled with great risk of data loss
- BACKUP before you make any chages to your disks / Raid
arrays!
The commands are suitable for my system, you have to change
them according to yours - DEVICE NAMES (/dev/sdXY as it appears on your
system)
I have used RAID 5 built with 3x 500 GB (about 1 TB real capacity).
Due
to security / safety considerations (strong utilised system with 7
Virtual Machines => Risk of "two disk failure") I have changed to
RAID 10 built with 4 drives, which is capable to survive even in case
of 2 disk crash...
1) BACKUP
!!! (it can not be said often enough - the more important the
data for your business is -> backup is essential. RAID Arrays
are not replacement for well planned and performed backup)
2) Install the additional disk
3) Stop previous RAID (Level 5)
a) unmount:
sudo umount /dev/md0
b) stop
sudo mdadm --stop
3) GPARTED
a) create empty (unformated) partitions on all RAID drives
b) set the RAID label
4) CREATE RAID 10
mdadm --create /dev/md0 --verbose --raid-devices=4 --chunk=512 --level=raid10 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
(this can take up to 2-3 Hours...; Chunk size between 256K &
1024 KB as recommended for newer drives, from 2008 on )
see what happens with:
cat /proc/mdstat
5) CHANGE / RECREATE mdadm.conf
sudo mdadm --detail --scan
get the output and paste it in the DEVICE PARTITIONS section of /etc/mdadm/mdadm.conf
6) FORMAT
sudo mke2fs -j /dev/md0
or (if you are ReiserFS fan...)
sudo mkreiserfs -j /dev/md0
7) REMOUNT (/etc/fstab)
a) update /etc/fstab (Optional)
/dev/md0 /MountPath auto defaults 0 3
b) mount
mount /dev/md0