Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You are misunderstanding a few things. DF reports file system spaces, but nothing directly about LVM.
You need to read your man pages related to physical volumes and volume groups first. Once you have the idea, look for a HOW-TO page about adding a new physical device.
In short, and totally from ancient and possibly faulty memory: you define the device and prep it as a LVM device, define it as a physical volume, add that physical volume to the volume group, then you can grow the existing file systems to use the new space in the volume group.
LVM entirely separates the so-called logical picture, “as seen by Linux file-systems,” from the physical one. Each one is now manipulated separately, and each one has no idea of the other.
“File systems” live in “logical volumes,” which are endlessly expandable and seamless. Supporting these are “storage pools,” which might be provisioned by one device (partition), or many.
File systems therefore neither know nor care where any piece of information physically is. (And, LVM can move it, if need be.) The two viewpoints are entirely(!) and cleanly separated.
“It’s quite the amazing [-ly useful] magic trick!”
Last edited by sundialsvcs; 04-09-2024 at 12:38 PM.
Very simple answer
Within a single VG it is possible to have multiple PVs and LVs. The LVs can be resized to whatever is needed (they act as a file system partition).
With multiple VGs, each can only manage the space assigned to that VG and LVs cannot be spanned across VG boundaries.
The proper way to do what you wanted to do would have been to create the PV (which you did properly), then add that PV to the existing VG.
Once that was done then the existing LV could have been expanded to use the additional space or relocated onto the new PV.
Now you can only create a new LV in the new VG and use it as a discrete file system partition (which is what you have done).
If you back up and remove the new LV and the new VG, then add that PV to the original VG you should be able to get back to what was originally suggested above.
Last edited by computersavvy; 04-11-2024 at 07:17 AM.
Very simple answer
Within a single VG it is possible to have multiple PVs and LVs. The LVs can be resized to whatever is needed (they act as a file system partition).
With multiple VGs, each can only manage the space assigned to that VG and LVs cannot be spanned across VG boundaries.
The proper way to do what you wanted to do would have been to create the PV (which you did properly), then add that PV to the existing VG.
Once that was done then the existing LV could have been expanded to use the additional space or relocated onto the new PV.
Now you can only create a new LV in the new VG and use it as a discrete file system partition (which is what you have done).
If you back up and remove the new LV and the new VG, then add that PV to the original VG you should be able to get back to what was originally suggested above.
Hello,
Thank you so much for your reply.
Do you mean I can use the previous VG to add the new partition?
The vgextend command allows adding a new PV to an existing VG.
Once that is done then the various lv commands can be used to manage existing LVs or to create new LVs as needed.
Look at the various commands on the system for LVM management and use the related man pages to see what each command does.
Those commands can be easily identified with
Code:
ls /usr/sbin/lv*
ls /usr/sbin/pv*
ls /usr/sbin/vg*
Example man page excerpt
Code:
VGEXTEND(8) System Manager's Manual VGEXTEND(8)
NAME
vgextend — Add physical volumes to a volume group
SYNOPSIS
vgextend position_args
[ option_args ]
DESCRIPTION
vgextend adds one or more PVs to a VG. This increases the space available for LVs in the VG.
The main commands of interest to you would now be 'lvremove', and 'vgremove' (to remove the new LV and VG) then 'vgextend' (to add the new PV to the old VG)
Last edited by computersavvy; 04-13-2024 at 12:52 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.