Resize software raid 1 with xfs

Nacházíte se: / Linux / How to ...

There are 2x 320GB (/dev/sdc and /dev/sdd) hdd in software RAID1 (/dev/md1) in our situation and we want to replace them to 2x 500GB hdd.

1. Remove first drive from raid

mdadm --fail /dev/md1 /dev/sdc5
mdadm --remove /dev/md1 /dev/sdc5

2. Change hdd

New partition have to be same or bigger than previous. You can create partition table on new drive by fdisk.

3. Add partition back to raid

At this time is sdc5 bigger than before. 

mdadm --add /dev/md1 /dev/sdc5

And wait until synchronization is done.

4. Change the second drive by the same procedure

5. Grow size

mdadm --grow /dev/md1 --size=max
xfs_growfs /dev/md1