I am following this link. I missed the "During the install of Ubuntu for the partitioning method choose guided - use the entire disk and setup LVM...". And reached upto lvcreate command(Manually installing an HVM Guest VM) which gives the error, "Volume group "vgubuntu" has insufficient free space (6 extents): 1024 required."(The OS is Ubuntu, I had already tried in the Ubuntu StackExchange site)
Now is there a way(without ending up on needing to format the entire hard disc or requiring a live cd or pendrive etc.) to assign enough memory[I have 1 SSD with around ~250GB, only ~60GB free space(no files etc.)]?
Certain Background info:
sudo vgdisplay
--- Volume group ---
VG Name vgubuntu
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 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 237.97 GiB
PE Size 4.00 MiB
Total PE 60921
Alloc PE / Size 60915 / <237.95 GiB
Free PE / Size 6 / 24.00 MiB
sudo vgs
VG #PV #LV #SN Attr VSize VFree
vgubuntu 1 2 0 wz--n- 237.97g 24.00m
sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vgubuntu lvm2 a-- 237.97g 24.00m
sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root vgubuntu -wi-ao---- <237.00g
swap_1 vgubuntu -wi-ao---- 976.00m
I am using ext4.
Questions:
Isn't this the right thing to do:
lvreduce --resizefs -L 212G vgubuntu/root
[Tries to shrink the filesystem first(--resizefs is a lifesaver!) and if successful reduce the size of existing root to 212GB, so that "Alloc PE / Size 60915 / <237.95 GiB" becomes "Alloc PE / Size (a New PE) / <212 GiB(approx.)"]lvcreate -L 8G -n ubuntu-hvm /dev/vgubuntu
[Creates a Logical Volume with 8GB for the VolumeGroup vgubuntu]Is there any other way which I could do it without unmounting(probably not!)?
lvreduce
+lvcreate
? Those commands look good. Your main question then seems to be whether you can do that without unmounting the logical volume. Is this correct? – fra-san May 26 '21 at 10:13