Resize underlying partitions in mdadm RAID1
Posted
by
kyork
on Super User
See other posts from Super User
or by kyork
Published on 2012-09-02T01:37:11Z
Indexed on
2012/09/02
3:40 UTC
Read the original article
Hit count: 527
I have a home built NAS, and I need to slightly reconfigure some of my drive usage.
I have an mdadm RAID1 composed of two 3TB drives. Each drive has one ext3 partition that uses the entire drive. I need to shrink the ext3 partition on both drives, and add a second 8GB or so ext3 partition to one, and swap partition of equal size to the other. I think I have the steps figured out, but wanted some confirmation.
- Resize the mdadm RAID
resize2fs /dev/md0 [size]
where size is a little larger than the currently used space on the drive - Remove one of the drives from the RAID
mdadm /dev/md0 --fail /dev/sda1
- Resize the removed drive with parted
- Add the new partition to the drive with parted
- Restore the drive to the RAID
mdadm -a /dev/md0 /dev/sda1
- Repeat 2-5 for the other device
- Resize the RAID to use the full partition
mdadm --grow /dev/md0 -z max
Is there anything I've missed, or haven't considered?
© Super User or respective owner