Need to grow an LV on LVM2 on KVM instance using storage on an array via iSCSI +LVM
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Need to grow an LV on LVM2 on KVM instance using storage on an array via iSCSI +LVM
Hi all
OK, head is slowly getting around to working out what the right question is!
I have a KVM instance using LVM and has a small LV of 16GB that I want to grow.
The LV itself is in a VG that is built from a partition on a 20GB disk that has a 255MB boot, 19GB extended partition holding 19GB logical partition. The 19GB partition (sda5) is what makes the VG that is then split into a 2GB+ swap and the 16GB+LV that I want to grow.
Now, the 20GB disk in the KVM instance is in fact an LV on a much larger storage array. I have increased this LV to 170GB and on the KVM host lvdisplay shows the LV as 170GB with LE 43522.
First issue: The VM is not seeing this size increase even after a reboot.
Is the LV and therefore VMs disk actually 170GB? How would I check further? As this is a raw block device expanding the FS doesnt really make sense, so have I missed something?
It may be that I am approaching this all wrong and I should simply add another virtual disk and add it to the VG and then resize the LV to fit it? As a thought experiment I thought it might be useful to help me understand LVM more if I did it the 'harder' route as it would force some more knowledge in!
Any LVM2 gurus out there to give me a pointer?
Second issue: Once I get that down, the next thing I want to try is the same but with a LUKS encrypted partition on the VM from the option on a std Ubuntu install and then grow the LUKS partition in a similar way to this issue. Adding drives to such a VG and trying to grow the LV and LUKS partition dont seem to work for me, even when I simplify it by using a bigger physical drive after DDing to it.
Thanks for reading through this! all help gratefully received :-)
When you increase space in a Physical Volume (PV) you've put in a Volume Group (VG) you can use "pvresize" to tell the PV to see the new underlying space.
The wrinkle here is that the PV in your case is a "partition" as you've described. You may need to use fdisk or parted to first increase the size of the partition to see the new space (even though the "disk" being "partitioned" is actually an LV itself).
The following link was useful to us back in February when we were doing something similar with our MS Hyper-V cluster. (Don't ask why we're doing Hyper-V instead of KVM - not my decision). Although it talks about multipath and SAN you can ignore that as the other concepts are the same:
I have now got the VM seeing the new size vda at 170GB+ and got parted to increase the extended partition to 170GB+ but the logical partition stays stubbornly at 20GB and therefore I cant resize the VG or therefore the LV.
Are there any tools to resize a VG based on an extended partition?, in that as partitions can be PVs and the PV is a logical partition that now sits on a larger extended partition how do I get it to grow the logical partition across that and the VG to see that?
Trying hard to keep the partitions, LVs logical partitions and volume groups accurate!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.