I have Ubuntu 18.04 Server installed on a VMware platform and I have two established VGs: rootvg is 500GB and hosts the O/S on /dev/sda. The datavg was 2TB and contains our PostgreSQL database environment, stored on /dev/sdb.
Recently, our team decided they need more disk space and so through the virtual machine they added another 1TB to the server for use by the datavg. They did this by changing the size of the virtual disk that they have currently in use. The problem with this is that I am not able to see the new disk space.
If I look at the datavg using vgdisplay, I see the old 2TB size:
vgdisplay datavg
--- Volume group ---
VG Name datavg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 35
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 24
Open LV 24
Max PV 0
Cur PV 1
Act PV 1
VG Size <2.00 TiB
PE Size 4.00 MiB
Total PE 524287
Alloc PE / Size 521216 / <1.99 TiB
Free PE / Size 3071 / <12.00 GiB
VG UUID vMxLPX-M3RG-BIVR-MsiF-dWtF-xLOl-4VCTGW
But if I check the disk in fdisk, it reports the new 3TB size.
fdisk /dev/sdb
Command (m for help): F
Unpartitioned space /dev/sdb: 3 TiB, 3298533834752 bytes, 6442448896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Start End Sectors Size
2048 6442450943 6442448896 3T
I am not sure exactly what needs to be done to make the 2TB disk show up now as 3TB and give me access to the extra 1TB that was added. Originally, I thought I would need to add a new partition in fdisk, then use pvcreate and extendvg to add that as a new disk to the volume group. But I am now confused, because I expected datavg to already have at least one partition defined that is being used for the existing LVs on datavg. I cannot find any existing partitions on /dev/sdb.
Command (m for help): p
Disk /dev/sdb: 3 TiB, 3298534883328 bytes, 6442450944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb32bb8b8
Can anyone point me in the right direction here? Is there an easy way to alter the size of a VG after it was created and is in use, or do we have to back up VG contents, destroy VG, recreate VG larger, reload the backup? Is there an equivalent to resize2fs but for VGs?
Thanks,
Steve N.