I am new to LVM so please excuse any silly questions. I created a VM on VMWare and edited the settings to extend the disk space from 40 to 80GB. Later i realized that i need to use LVM to actually extend the disk space. Since my output of df -h
still shows 40GB.
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 396M 5.7M 390M 2% /run
/dev/mapper/ubuntu--prod--vg-root 38G 2.5G 34G 7% /
tmpfs 2.0G 68K 2.0G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda1 720M 109M 575M 16% /boot
tmpfs 396M 0 396M 0% /run/user/1001
So, currently when i run fdisk -l
, this is my output :-
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 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: 0x34a96e3a
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1499135 1497088 731M 83 Linux
/dev/sda2 1501182 83884031 82382850 39.3G 5 Extended
/dev/sda5 1501184 83884031 82382848 39.3G 8e Linux LVM
Disk /dev/mapper/ubuntu--prod--vg-root: 38.3 GiB, 41150316544 bytes, 80371712 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
Disk /dev/mapper/ubuntu--prod--vg-swap_1: 980 MiB, 1027604480 bytes, 2007040 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
and sudo pvdisplay
shows the following option :-
--- Physical volume ---
PV Name /dev/sda5
VG Name ubuntu-prod-vg
PV Size 39.28 GiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 10056
Free PE 0
Allocated PE 10056
PV UUID lUfzd9-1BVL-0XGA-YJPI-Roxe-Vb7p-Wdstfb
So i have a couple of questions.
- Am i understanding it right that /dev/sda5 is currently part of the volume group that is in use?
- If /dev/sda5 in infact in use, the does it mean i would need to add /dev/sda2 to the volume group to get the desired disk space?
- When i try to run
sudo pvcreate /dev/sda2
i am running intoDevice /dev/sda2 not found (or ignored by filtering).
So how can i extend the disk space? what am i doing wrong and what would be the right approach? Thank you for the assistance.