LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 05-13-2021, 11:17 AM   #1
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Rep: Reputation: Disabled
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.
 
Old 05-13-2021, 07:31 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by TeachMeLin View Post
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.
 
Old 05-14-2021, 02:13 AM   #3
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-14-2021, 04:54 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.

Last edited by syg00; 05-14-2021 at 04:56 AM. Reason: resize
 
Old 05-14-2021, 06:41 AM   #5
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-14-2021, 07:19 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.

Last edited by syg00; 05-14-2021 at 07:20 PM. Reason: typo
 
Old 05-14-2021, 09:26 PM   #7
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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!
 
Old 05-16-2021, 09:33 PM   #8
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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?
 
Old 05-17-2021, 01:10 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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

Last edited by syg00; 05-17-2021 at 01:12 AM. Reason: forgot ...
 
Old 05-17-2021, 02:59 AM   #10
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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

Last edited by TeachMeLin; 05-17-2021 at 03:01 AM. Reason: Free space
 
Old 05-17-2021, 04:01 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
Old 05-17-2021, 04:17 AM   #12
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
Ok. Thanks again.
 
Old 05-28-2021, 09:41 AM   #13
TeachMeLin
LQ Newbie
 
Registered: May 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Learning Xen: Converting Existing Non-Xen Hypervisor Images for Use in Xen LXer Syndicated Linux News 0 08-24-2013 10:00 AM
[SOLVED] How to create an image of a partitioned disk williepabon Ubuntu 3 01-25-2013 07:48 PM
Need to know the command which shows all non-partitioned & partitioned hard drive saidul Linux - Newbie 2 12-04-2007 04:02 PM
LXer: Managing Xen With Xen-Tools, Xen-Shell, And Argo LXer Syndicated Linux News 0 11-05-2006 12:21 PM
LXer: Managing Xen With Xen-Tools, Xen-Shell, And Argo LXer Syndicated Linux News 0 10-21-2006 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration