Okay I tried figuring this out on my own but it didn't work well. But I now have an error which makes Googling for the right answer easier:
[root@fedora lb]# mdadm --manage /dev/md127 --add /dev/sdf2
mdadm: /dev/sdf2 not large enough to join array
[root@fedora lb]# sudo blockdev --report /dev/md127
RO RA SSZ BSZ StartSec Size Device
rw 256 512 4096 0 3000456642560 /dev/md127
[root@fedora lb]# sudo blockdev --report /dev/sdf2
RO RA SSZ BSZ StartSec Size Device
rw 256 512 512 21484494848 3000458264064 /dev/sdf2
[root@fedora lb]# blockdev --getsz /dev/sdf2
5860270047
[root@fedora lb]# blockdev --getsz /dev/md127
5860266880
although it seems like the space I allocated is larger I'm assuming the error message is the same--it just means there is a size mismatch
edit: okay so it turns out that you can't use the size of the created RAID device. You have to use the size of the partition or disk that was used in the RAID device. So one would need to use either sde1
or sdc1
in this case. After learning how to use blockdev
and fdisk -l
I should have done this:
blockdev --getsz /dev/sde1
# not this! blockdev --getsz /dev/md127
This is the full list of operations that I had to do:
gdisk /dev/sdf # create new partition; fd00 format
# swap disks from different manufacturer
mdadm --manage /dev/md127 --add /dev/sdf2
mdadm --manage /dev/md127 --fail /dev/sde1
mdadm --manage /dev/md127 --remove /dev/sde1
cat /proc/mdstat
mdadm --detail /dev/md127
mdadm --create --level=1 --raid-devices=2 /dev/md2 /dev/sdg2 /dev/sde1
sudo btrfs device add -f /dev/sdc /mnt/d
sudo btrfs balance start -dconvert=raid0 -mconvert=raid1 /mnt/d
mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf