0
 --- Volume group ---
  VG Name               BKMASTWS01-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               24.52 GiB
  PE Size               4.00 MiB
  Total PE              6277
  Alloc PE / Size       6269 / 24.49 GiB
  Free  PE / Size       8 / 32.00 MiB
  VG UUID               vyqubz-yMyj-pNO0-4xqX-1taG-wRMI-rntXZQ

  --- Logical volume ---
  LV Path                /dev/BKMASTWS01-vg/root
  LV Name                root
  VG Name                BKMASTWS01-vg
  LV UUID                odl7T5-LMR6-UA8K-vHyY-na5K-qQhX-MzW7sQ
  LV Write Access        read/write
  LV Creation host, time BKMASTWS01, 2018-02-20 18:12:47 +0530
  LV Status              available
  # open                 1
  LV Size                16.49 GiB
  Current LE             4222
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/BKMASTWS01-vg/swap_1
  LV Name                swap_1
  VG Name                BKMASTWS01-vg
  LV UUID                bX7HIJ-5dWd-S8UT-3NCA-Hcr7-HLuW-5Utg4B
  LV Write Access        read/write
  LV Creation host, time BKMASTWS01, 2018-02-20 18:12:47 +0530
  LV Status              available
  # open                 0
  LV Size                8.00 GiB
  Current LE             2047
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Physical volumes ---
  PV Name               /dev/sda5
  PV UUID               vGnKwB-Xlox-gM7n-QfuW-EWkD-1hre-iSOviD
  PV Status             allocatable
  Total PE / Free PE    6277 / 8

I have this Ubuntu server running on VMWare ESXi. I increased its 25GB HDD to 50GB. This resulted in the new partition (/dev/sda5) appearing on the system as expected. This PV was already considered part of the VG BKMASTWS01-vg as it was on the same HDD.

fdisk -l shows 


Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048   999423   997376  487M 83 Linux
/dev/sda2       1001470 52426751 51425282 24.5G  5 Extended
/dev/sda5       1001472 52426751 51425280 24.5G 8e Linux LVM

So in theory all I was to do to add it to the Logical Volume and resize the file system to increase the available space from 16 GB to 41 GB (8GB swap) approximately. This is however just not happening.

root@BKMASTWS01:~# lvextend -t  /dev/BKMASTWS01-vg/root /dev/sda5
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Size of logical volume BKMASTWS01-vg/root changed from 16.49 GiB (4222 extents) to 16.52 GiB (4230 extents).
  Logical volume root successfully resized.

Instead of adding 25GB, it only adds the 'free extents'. This PV is brand new and I cant understand how to 'free up the used extents' in the PV.

Can anyone figure out how this problem can be solved? The whole of the 25GB of the /dev/sda5 needs to get added to /dev/BKMASTWS01-vg/root LV and the file system needs to be resized.

  • 1
    Are you sure /dev/sda5 is new? First off a partition doesn't automatically become a part of a VG because its on the same HDD as another partition that is. I think you never increased the partition size of the EXISTING /dev/sda5. Adding additional space to the drive in no way changed the partition table automatically. You skipped that. –  May 13 '20 at 13:35
  • To follow what yoonix said, your VG is still showing a size of 24.52GB (`VG Size 24.52 GiB`). You *probably* want to add /dev/sda5 to that volume group. – Brandon Xavier May 13 '20 at 13:45
  • It is new in the sense that I created it on VMWare and since then it has never been usable. Pretty much in the same state. I am not sure how it got added to the VG. I have tried to run so many commands that it is possible that I might have added it accidentally but not intentionally. – Mohammed Lokhandwala May 13 '20 at 13:47
  • @BrandonXavier, I have tried that but it says it is already in the volume group. ```root@BKMASTWS01:~# vgextend -tf BKMASTWS01-vg /dev/sda5 TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. Physical volume '/dev/sda5' is already in volume group 'BKMASTWS01-vg' Unable to add physical volume '/dev/sda5' to volume group 'BKMASTWS01-vg'.``` – Mohammed Lokhandwala May 13 '20 at 13:48
  • Perhaps you are confusing sda2 and sda5? Possibly sda2 is the new partition? In any case, and with no disrespect intended, since you seem to be in unfamiliar territory, please make sure you have a backup available before doing anything else (even if it's just VM snapshots) – Brandon Xavier May 13 '20 at 13:52
  • 1
    BTW, increasing the size of a VMware volume will not cause a new partition to be created. It only makes additional space available to fdisk (or whatever partition utility you are using) – Brandon Xavier May 13 '20 at 13:56
  • @BrandonXavier, Thanks, you are right that partition was not created by VMWare, so /sda2 and /sda5 were not not eligible! Trying now from scratch! – Mohammed Lokhandwala May 13 '20 at 14:14

0 Answers0