Is it possible to convert RAID1 to RAID0 without system reinstalation?
Solution 1:
As far as I know that does not look possible. I'd suggest you to backup all data, then rebuild the RAID to the stripe RAID.
However, you can try to backup the data before growing RAID from 1 to 0 using this command:
mdadm /dev/md2 --grow --level=0
OR
Remove mirror, extend to raid 0 and resize fs.
In any case DO the backup before for your data safety.
Solution 2:
Building on Strepsils's clues, for a RAID1 md volume named /dev/md2, and two partitions named /dev/nvme0n1p2 and /dev/nvme1n1p2:
-
Remove the mirror:
sudo mdadm /dev/md2 --fail /dev/nvme1n1p2
, thensudo mdadm /dev/md2 --remove /dev/nvme1n1p2
(from https://www.thegeekdiary.com/centos-rhel-how-to-remove-a-mirror-with-mdadm/) -
Extend to raid0:
sudo mdadm /dev/md2 --grow --level=0
-
Add the second disk back:
sudo mdadm --grow /dev/md2 --level=0 --raid-devices=2 --add /dev/nvme1n1p2
(Note that this will change md2 to raid4?! and automatically start reshaping. From https://serverfault.com/a/1077269/167906) -
Wait for reshape to finish (watch /proc/mdstat) (~90 minutes for an md volume that began life as a 1TB raid1 on 2 fast SSDs)
-
/dev/md2 will automatically become raid0 after reshape is finished.
-
Grow file system:
sudo resize2fs /dev/md2