How can i increae my disk space lvm

General support questions
Post Reply
linux_guy
Posts: 27
Joined: 2016/09/25 17:56:44

How can i increae my disk space lvm

Post by linux_guy » 2017/07/30 23:42:19

I am confused and i am lost, I need some help, It is a centos7 virtual machine

I need more hard disk space, as my current hard drive space is 6.2gb,
I want to increase it to 50gb, which i successfully did on the virtual machine, and it shows 50gb,
but inside it shows as 50gb the total size, but the sda size is still 6.2

and i am unsure on how to make it use the rest of the space
3.png
3.png (99.85 KiB) Viewed 1573 times
2.png
2.png (99.14 KiB) Viewed 1573 times
1.png
1.png (40.67 KiB) Viewed 1573 times

advice?

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: How can i increae my disk space lvm

Post by hunter86_bg » 2017/07/31 05:48:21

It seems that /dev/sda2 is larger but you are not utilizing it.
Could you post the output /as text,there is no need of screenshots/ of the following just for verification.

Code: Select all

pvs && vgs && lvs

linux_guy
Posts: 27
Joined: 2016/09/25 17:56:44

Re: How can i increae my disk space lvm

Post by linux_guy » 2017/08/01 00:02:25

Here is the output:

Code: Select all

PV            VG Fmt  Attr  PSize  PFree
/dev/sda2  cl   lvm2  a--  49.00g  42.00g
VG #PV #LV #SN Attr    VSize   VFree
cl      1     2     0   wz--n- 49.00g  42.00g
LV    VG  Attr           LSize     Pool   Origin  Data%  Meta%  Move Log Cpy%Sync Convert
root    cl  -wi-ao----  6.20g
swap  cl -wi-ao---- 820.00m



hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: How can i increae my disk space lvm

Post by hunter86_bg » 2017/08/01 03:48:10

WARNING:CREATE A BACKUP OF IMPORTANT DATA BEFORE PROCEEDING

As the partition is encreased, we need to inform the LVM that we changed the size.
1.Run the following

Code: Select all

pvresize /dev/sda2
2.Verify the size of the volume group:

Code: Select all

vgdisplay cl
3.Grow the root partition:

Code: Select all

lvextend -r -L +42GB /dev/cl/root

or you can use the following:

Code: Select all

lvextend -r -l 100%FREE /dev/cl/root
4.Check the available space:

Code: Select all

df -h

linux_guy
Posts: 27
Joined: 2016/09/25 17:56:44

Re: How can i increae my disk space lvm

Post by linux_guy » 2017/08/20 00:18:40

I used options 1, 2 & 3

and it worked! simple as that


it's a shame i was not able to do it alone,

i need to read more linux books,


thanks for the help

Post Reply