LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Single Disk Not Partitioned at Ubuntu installation, Installed Xen, Unable to create LV, error: Size not enough (https://www.linuxquestions.org/questions/ubuntu-63/single-disk-not-partitioned-at-ubuntu-installation-installed-xen-unable-to-create-lv-error-size-not-enough-4175695084/)

TeachMeLin 05-13-2021 11:17 AM

Single Disk Not Partitioned at Ubuntu installation, Installed Xen, Unable to create LV, error: Size not enough
 
Am following https://help.ubuntu.com/community/Xen url and had covered upto "Manually installing an HVM Guest VM". But only late I realized that I had not done the "During the install of Ubuntu for the partitioning method choose 'Guided - use the entire disk and setup LVM'..." Now can I do anything about it? If possible I don't want to use live CD/USB etc.

syg00 05-13-2021 07:31 PM

Quote:

Originally Posted by TeachMeLin (Post 6250502)
Now can I do anything about it?

Probably.

Had you told us what you had done, rather than what you hadn't, we might be able to offer some suggestions. Also post relevant info - disk layout including sizes, pv/vg/lsv lists, that sort of thing.

TeachMeLin 05-14-2021 02:13 AM

I had successfully installed Xen. Then I installed bridge-utlis and disabled netfilter.


Results:

sudo vgs
VG #PV #LV #SN Attr VSize VFree
vgubuntu 1 2 0 wz--n- 237.97g 24.00m

sudo lvcreate -L 10G -n lv_vm_ubuntu /dev/vgubuntu
Volume group "vgubuntu" has insufficient free space (6 extents): 2560 required.

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

syg00 05-14-2021 04:54 AM

Do a lvresize before the lvcreate - you need to get unallocated space in the vg before you can add new lv's.
Make sure you add the "-r" to automatically resize the filesystem for you at the same time.

TeachMeLin 05-14-2021 06:41 AM

I have run 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

I don't know if I had understood it correctly, but does the line: Alloc PE / Size 60915 / <237.95 GiB means that most of the memory in vgubuntu is already allocated? I have only around 250 GB overall space(SSD). Am new to these things so please be patient with me.

syg00 05-14-2021 07:19 PM

LVM is a disk emulation layer that provides flexibility in managing space - somewhat analogous to dynamic disks in Windows. Somewhat.
But it also adds complexity and new concepts. I suggest you search for a "what is LVM" quick tutorial online. From this page download the "Configuring and managing logical volumes" for a very good manual that covers everything.

Essentially the vg is equivalent to a disk - you allocate lv's within that just like you would partitions, then format the lv as a filesystem for use. So you don't want (or need) to alter the size of the vg, you need to shrink the root lv to something more sensible, then you will have space you can use for other lv's. Later you can move space back and forth between the lv's if needed - much easier than real partitions.

TeachMeLin 05-14-2021 09:26 PM

Thanks, let me learn first! Is it ok if I keep this open so that I can come back and ask any doubts(until I accomplish)? This is a very responsive site!

TeachMeLin 05-16-2021 09:33 PM

What I plan to do is:
1. lvreduce --resizefs -L 212G vgubuntu/root
2. lvcreate -L 8G -n ubuntu-hvm /dev/vgubuntu
Is there any problem/risks with this strategy? Is it the correct way?

And its says it must unmount first!
what will happen when it gets unmounted, will I need live CD or USB on the way?

syg00 05-17-2021 01:10 AM

Go back and re-read that link you posted. There is no point in having the Dom0 root that big - I wouldn't go as small as they suggest, but 30 Gig might be a reasonable first guess, it will allow for things like logs and such as well as updates.
Then you have plenty of space for the guests and any data they will need.

Forgot to mention - I'm surprised you can't resize online; I hope you aren't using XFS. Lets'see these outputs.
Code:

df -hT
lsblk -f


TeachMeLin 05-17-2021 02:59 AM

df -hT

Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 787M 1.8M 785M 1% /run
/dev/mapper/vgubuntu-root ext4 233G 158G 63G 72% /
tmpfs tmpfs 3.9G 916K 3.9G 1% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 squashfs 100M 100M 0 100% /snap/core/10958
/dev/loop3 squashfs 99M 99M 0 100% /snap/core/11081
/dev/loop1 squashfs 163M 163M 0 100% /snap/gnome-3-28-1804/145
/dev/loop2 squashfs 55M 55M 0 100% /snap/core18/1223
/dev/loop4 squashfs 56M 56M 0 100% /snap/core18/1997
/dev/loop6 squashfs 231M 231M 0 100% /snap/obs-studio/1195
/dev/loop7 squashfs 139M 139M 0 100% /snap/inkscape/8746
/dev/loop5 squashfs 219M 219M 0 100% /snap/gnome-3-34-1804/66
/dev/loop8 squashfs 62M 62M 0 100% /snap/core20/975
/dev/loop9 squashfs 65M 65M 0 100% /snap/gtk-common-themes/1514
/dev/loop10 squashfs 66M 66M 0 100% /snap/gtk-common-themes/1515
/dev/sda1 vfat 511M 7.9M 504M 2% /boot/efi
tmpfs tmpfs 787M 36K 787M 1% /run/user/1000

lsblk -f

NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0 squashfs 0 100% /snap/core/10958
loop1 squashfs 0 100% /snap/gnome-3-28-
loop2 squashfs 0 100% /snap/core18/1223
loop3 squashfs 0 100% /snap/core/11081
loop4 squashfs 0 100% /snap/core18/1997
loop5 squashfs 0 100% /snap/gnome-3-34-
loop6 squashfs 0 100% /snap/obs-studio/
loop7 squashfs 0 100% /snap/inkscape/87
loop8 squashfs 0 100% /snap/core20/975
loop9 squashfs 0 100% /snap/gtk-common-
loop10 squashfs 0 100% /snap/gtk-common-
sda

Well actually I want to install 3 OS, 1 Main(this one Ubuntu) and 2 others just to test/explore/fun. I have currently only about +60GB free

syg00 05-17-2021 04:01 AM

Hmmm - I wan't expecting that for the root usage. I'll crawl back under my rock and let someone else respond that has some experience of Xen.

TeachMeLin 05-17-2021 04:17 AM

Ok. Thanks again.

TeachMeLin 05-28-2021 09:41 AM

I got a method(I have not personally tried it. Also I don't know if one can do it if he is low on memory):

https://unix.stackexchange.com/quest.../227318#227318


All times are GMT -5. The time now is 05:00 AM.