Software RAID5 with mdadm
- February 15th, 2010
- By mp
- Write comment
Short toturial on how to set up raid5 using mdadm bigger than 2TB
Creating:
mdadm --create /dev/md5 --chunk=64 --level=raid5 --raid-devices=4 /dev/sdg1 /dev/sdh1 /dev/sdd1 /dev/sdc1 --force
Checking the status on how the raid is build
cat /proc/mdstat
md5 : active raid5 sdg1[0] sdc1[3] sdd1[2] sdh1[1]
5860535808 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
unused devices:
For more details:
mdadm --detail /dev/md5
/dev/md5:
Version : 00.90
Creation Time : Sun Feb 14 11:46:13 2010
Raid Level : raid5
Array Size : 5860535808 (5589.04 GiB 6001.19 GB)
Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 5
Persistence : Superblock is persistent
Update Time : Mon Feb 15 11:58:41 2010
State : active
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 64K
UUID : 80766149:664cd4ae:b069a74e:50fc3f3c (local to host server.nsas.lan)
Events : 0.19
Number Major Minor RaidDevice State
0 8 97 0 active sync /dev/sdg1
1 8 113 1 active sync /dev/sdh1
2 8 49 2 active sync /dev/sdd1
3 8 33 3 active sync /dev/sdc1
After everything is build (took some time) you have to create a partion. Since fdisk cant handel more then 2TB, you have to use parted.
parted /dev/md5
Create a GPT label.
mklable gpt
Create a Partion. Using the max possible space
mkpart primary 0 -0
Exit
exit
Now format the new partion as you like.
mkfs.xfs -L RAID /dev/md5p1
Set you config straight
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Mount it.
mount LABEL=RAID /mnt
