# Resizing single volume group and logical volume after disk expansion

<span style="color: rgb(0, 0, 0);">This guide is used after cloning to a increased size disk such as 500GB to 1TB, or by having some space left over from installing the OS, such as the rest of the disk but only 50GB allocated to the / partition.</span>

<span style="color: rgb(0, 0, 0);">Firstly run **vgdisplay** to get the volume group information.</span>

<span style="color: rgb(0, 0, 0);">![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2024-07/scaled-1680-/MILmvwCKugkmEAa6-image.png)</span>

<span style="color: rgb(0, 0, 0);">Run **lsblk** and notice that the size of the partition on the disk **and** the volume group is 424G, not the 931.5G. </span>

<span style="color: rgb(0, 0, 0);">**Note:** *After resizing, it will be a bit smaller than the disk as the other partitions take it up, so around 926G at the end*</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/C38l0R.png)</span>

<span style="color: rgb(0, 0, 0);">Let's add the rest of the free space to the partition first. Run **cfdisk /dev/nvme#n1**, replacing hashtag with drive number. No need for a partition here as we need to do changes on the disk itself.</span>

<span style="color: rgb(0, 0, 0);">*I should have an image here of CF Disk at some point when I have a free size again.*</span>

<span style="color: rgb(0, 0, 0);">Go down to partition 3 (Or where your logical volumes are stored for expansion) and chose "Resize". Just put in the amount you wish to add to that partition (which is presumably max), then write it.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/kelbgd.png) ![](https://jasmeow.pics/mvA8FT.png)</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/uomXUb.png)</span>

<span style="color: rgb(0, 0, 0);">Once you've done this, run **pvresize /dev/nvme#n1p#**, replacing both the hashtags respectively.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/qCQU31.png)</span>

<span style="color: rgb(0, 0, 0);">Next run **lvextend -l +100%FREE /dev/vg#/LOCATION**, replacing the hashtag with the volume group number, normally vg0, and location with the mountpoint name, normally "root". An example:</span>

<span style="color: rgb(0, 0, 0);">*This will say resized. I don't have an image currently of this.*</span>

<span style="color: rgb(0, 0, 0);">![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2024-07/scaled-1680-/1HrlYsBJKkXEBJNv-image.png)</span>

<span style="color: rgb(0, 0, 0);">Once done, run **resize2fs /dev/vg#/LOCATION**, replacing the values again with the relevant fields.</span>

<span style="color: rgb(0, 0, 0);">*This will say "online sizing required" and resize.*</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/OKYkSg.png)</span>

<span style="color: rgb(0, 0, 0);">Run **df -h** and **lsblk** to confirm resizing.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/1EOJw9.png)![](https://jasmeow.pics/iGUZHt.png)</span>