Can you help me fix the problem add more GB to vg?
Please look. I explain my problem:
[root@jdk ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 900G 0 disk
├─vda1 252:1 0 512M 0 part /boot
└─vda2 252:2 0 899,5G 0 part
├─vg-root 253:0 0 697,5G 0 lvm /
└─vg-swap 253:1 0 2G 0 lvm [SWAP]
loop0 7:0 0 4G 0 loop /var/tmp
[root@jdk ~]# vgextend vg /dev/vda2
Physical volume '/dev/vda2' is already in volume group 'vg'
Unable to add physical volume '/dev/vda2' to volume group 'vg'
/dev/vda2: physical volume not initialized.
[root@jdk ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg 1 2 0 wz--n- <699,50g 0
@JatinMehrotra I added pvdisplay: Please check
[root@jdk ~]# pvdisplay
--- Physical volume ---
PV Name /dev/vda2
VG Name vg
PV Size <699,50 GiB / not usable 2,00 MiB
Allocatable yes (but full)
PE Size 4,00 MiB
Total PE 179071
Free PE 0
Allocated PE 179071
PV UUID EfPZuZ-gQ0R-nFLD-pnwm-DS16-IAXf-ikO5RM
Accodring to LVM, /dev/vda2 is already in volume group vg and all of its space is already being used for volume group. However, the physical volume is only ~700 GB in size while the partition /dev/vda2 is ~900 GB, so it looks as if ~200 GB of partition is not being used for physical volume.
This could happen for example if you created physical volume with explicit size parameter, or if you enlarged your partition after PV has already been created on it.
In such case, pvresize should be able to add the missing space. After that, you should see a higher Total PE and also some Free PE in the output of pvdisplay. Then you can use this space to extend existing logical volumes with lvextend, or to create new logical volumes with lvcreate.
And just to mention, if you will enlarge vg-root or vg-swap, you will also need to resize the filesystem it contains.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With