Skip to main content

Resizing a logical group then volume within a parented RAID number

Taken from https://packetpushers.net/blog/ubuntu-extend-your-default-lvm-space/ 

Run cat /proc/mdstat - Get the RAID partition you want to update after doing all the resize commands to switch from Raid 1 to Raid 0.

Taken from https://serverfault.com/questions/915284/is-it-possible-to-convert-raid1-to-raid0-without-system-reinstalation 

image.png

Next, get the partition info which should look like this with lsblk:

image.png

Notice how vg0-root and vg0-swap are sitting on on both disks partition 3 parented under RAID mdadm md127? This is what we will be working on.

Run vgdisplay - Get Volume Group name and the path, in this case will be "/dev/vg0/xxx". Sometimes it is "/dev/mapper/ubuntu–vg-ubuntu–lv", different on how the OS was installed.

image.png

Increasing the size now comes in 3 steps

1. We now need to physically resize the volume of the mdadm RAID by doing pvresize /dev/RAID# as shown below:

image.png

2. Expand the Logical Volume by running lvextend -l +100%FREE /dev/VGNAME/LVNAME. We worked out the VGNAME was vg0 and we worked out the LVNAME is root from lsblk - this showed us vg0-root. It should be successful.

image.png

3. Your final stage is doing the typical resize2fs /dev/VGNAME/LVNAME. You do NOT do it on the mdadm RAID#, as this will just fail with not finding the superblock:

image.pngimage.png

Check with df -h, and you will see it has been resized successfully:

image.png