Resize raid array and create second array

From Wiki

Jump to: navigation, search

Misc commands to resize raid array and create a second array

parted /dev/sda
#resize 3
#gave out an error saying unsupported features. It showed what features were supported with resize. I needed to see what features were been used on the partition:
dumpe2fs /dev/sda3
debugfs -w /dev/sda3 -R "features ^ext_attr"
debugfs -w /dev/sda3 -R "features ^resize_inode"
parted was then able to resize the partitions.
mdadm --create /dev/md3 --level 1 --raid-devices=2 /dev/sda3 /dev/sdb3
#I tried to assemble the md2 array using mdadm --assemble /dev/md2 /dev/sda3 /dev/sdb3 but it said that there was no superblock found. 
#mdadm examine and detail of md2 and the individual partitions showed no superblock either. 
#As a result the array had to be created with the above command. It also resynced itself ok.
mdadm --create /dev/md3 --level 1 --raid-devices=2 /dev/sda4 /dev/sdb4
pvcreate /dev/md3
vgcreate mainvol /dev/md3

Make sure to update /etc/mdadm/mdadm.conf with the correct UUID (mdadm --examine --scan) otherwise the mdadm wont auto assembly on boot.


Old / Not used

The following below didn't work. It is just here for reference.

e2fsck -f /dev/md2
resize2fs /dev/md2 300G
mdadm --grow /dev/md2 --size=335544320  (use 320GB to be save. 320 x 1024 x 1024)
resize2fs /dev/md2
e2fsck -f /dev/md2
Personal tools