grow_md_raid1
Grow MD RAID-1 Array
You can grow a RAID1… if you replace both disks. I just did, it worked like this:
- Started with 2x4T drives (sda1 and sdb1) in a working RAID1 array (md0)
- Bought two new 16T drives and plugged them in (sdc and sdd)
- Partition them with full drive partitions (sdc1 and sdd1)
- parted –script /dev/sdc “mklabel gpt”
- parted –script /dev/sdc “mkpart primary 0% 100%”
- parted –script /dev/sdc “set 1 raid on”
- # Repeat for /dev/sdd
- Add them both to the RAID1:
- mdadm /dev/md0 –add /dev/sdc1 /dev/sdd1
- Fail one of the old drives:
- mdadm /dev/md0 -f /dev/sda1
- Wait for sync to finish:
- watch -n 60 cat /proc/mdstat
- Fail the other old drive:
- mdadm /dev/md0 -f /dev/sdb1
- Wait for sync to finish:
- watch -n 60 cat /proc/mdstat
- Remove the old drives from the array:
- mdadm /dev/md0 -r /dev/sda1 /dev/sdb1
- Grow the array:
- mdadm –grow /dev/md0 –size max
- Grow the filesystem:
- resize2fs /dev/md0
- # Or xfs_growfs, resize2fs, etc…
..and now I have a 14TB RAID1 instead of the initial 4TB.
Originally from; StackExchange
grow_md_raid1.txt · Last modified: by steve
