Monday, March 2, 2020

GROWING RAID+LVM


GROWING RAID+LVM


Step by step howto:




Add Drive
mdadm --add /dev/md0 /dev/sdb3


Tunning
echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 200000 > /proc/sys/dev/raid/speed_limit_max


Grow the Array
 mdadm --grow /dev/md0 --raid-devices=4


Resize PV
# pvresize /dev/md1
  Physical volume "/dev/md1" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized


Extend LV
# lvextend -L +400G -n /dev/XXXX00/LV-HOME
  Size of logical volume XXXX00/LV-HOME changed from 565.66 GiB (144809 extents) to 965.66 GiB (247209 extents).
  Logical volume XXXX00/LV-HOME successfully resized.


Grow filesystem
# resize2fs /dev/mapper/XXXX00-LV--HOME
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/mapper/XXXX00-LV--HOME is mounted on /home; on-line resizing required
old_desc_blocks = 71, new_desc_blocks = 121
The filesystem on /dev/mapper/XXXX00-LV--HOME is now 253142016 (4k) blocks long.


Check
# df -h /home
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/XXXX00-LV--HOME  950G  431G  477G  48% /home



No comments: