I have been using my HDD as part of software RAID 1 array with the second device missing. I configured it this way to be able to add another disk when I have a chance. Now I've bought the second disk and tried running this command:
mdadm --add /dev/md0 /dev/sdb1
But I'm getting this error:
mdadm: /dev/sdb1 not large enough to join array
The output of gparted is:
Disk /dev/sda: 3907029167s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 3907029133s 3907027086s ext4
Disk /dev/sdb: 3907029167s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 2048s 3907028991s 3907026944s primary ext4
Is there a way to add the second disk to the array without losing data on the first one?
Should the first one be resized to match the new disk?