# apt-get install mdadm
# apt-get install lvm2
Check existing arrays:
# cat /proc/mdstat
Create RAID 5 array:
# mdadm –create –verbose /dev/md0 –level=5 –raid-devices=3 /dev/sdb /dev/sdc /dev/sde
Check the array exists:
# cat /proc/mdstat
# mdadm –detail /dev/md0
⇒ there is an initial phase of reconstruction when an array is created. It is supposedly functional during this time.
Make the array a LVM Physical Volume (so it can be used by LVM):
# pvcreate /dev/md0
⇒ That takes time!
Check result:
# pvs
# pvdisplay
Define a LVM Volume Group consisting of the array (usually on several disks, but we already packed them with RAID so it's just one 'drive'):
# vgcreate vg_data /dev/md0
=⇒ takes time as well!
Check result:
# vgdisplay vg_data
Create LVM Volumes on the Volume Group:
# lvcreate -n vol_perso_data -L 350G vg_data
⇒ use -l instead to give % of available space
Check result:
# lvs
# lvdisplay
We can now use the new Volumes as we would use normal disks!
Access is done through /dev/vg_data/vol_*
For example, to create ext4 partitions:
# mkfs.ext4 /dev/vg_data/vol_music