mdadm
Usage⚑
Add RAID device to initramfs⚑
- Add the currently active RAID devices to mdadm.conf:
mdadm --detail --scan > /etc/mdadm/mdadm.conf
- Update the initramfs:
update-initramfs -u
Check the RAID devices status⚑
cat /proc/mdstat
RAID0⚑
Create RAID0 from one disk⚑
If you have a regular disk without RAID, and you want to convert it to a RAID0 device so you can add more disks later, you can't do it directly. Instead you'll have to:
- Install the new disk to the machine and create a RAID0 array with only that drive.
- Setup the partitions on it and copy the data from the original drive.
- Change
/etc/crypttab
and/etc/fstab
if needed to use the partition(s) of the RAID0 array. - Extend the RAID0 adding the original disk as instructed in the next section.
Extend RAID0⚑
- Format the disk to be added generating a new partition table and a new partition. You can use
fdisk
. - Extend the existing RAID0 array with
mdadm --grow /dev/mdX --raid-devices=2 --add /dev/sdXN
This will convert the array to RAID4 temporarily since RAID0 can't be extended directly. You can check the reshape status with cat /proc/mdadm
. 1. Resize the partitions, and everything needed.