[SOLVED] A few questions about LVM volume group configuration using 2+ drives
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.
A few questions about LVM volume group configuration using 2+ drives
I'm installing Debian on a new computer with 2 different drives, a 1tb nVME and a 4tb HDD, and my use case is as a single user at home. I want to set the drives up using LVM. I know the basics of what I should be doing and made sure I'm leaving both physical volumes with one partition (free space) each except for the EFI boot partition in my nVME, and I plan on making a /, /home, and /swap partition and leaving 64gb in logical partition for snapshot backups.
What I don't understand is how to navigate volume groups. I want to dedicate my nVME to my main OS and leave my HDD for a Windows VM for gaming, with room to use whatever space I'm not using in Windows on /home or on whatever partition I need to resize. One volume group seems like the standard, but I don't have anything I can backup to except for a single 64gb USB stick and I don't want to lose all of my data if the HDD ever fails. I can't find much information about using 2 separate volume groups, specifically about what restrictions it would have. Would it be better for me to use one volume group or two in this scenario? Is there anything specific I should be preparing for ease of use later? I have zero experience in bash so I'm not sure what I'm looking at with the commands yet, which option with volume groups would be easier to work with?
Also, just to be sure, but is manual setup LVM and then encryption the same thing as what you'd get when setting up guided encrypted LVM? Do both use the same encryption system? Would I be able to encrypt certain partitions (not /, I know that's important to do during install) later on outside of the install? I'm brand new to linux and coding, so I don't want to mess things up for myself in the future by encrypting everything since I read resizing encrypted partitions is difficult, but I don't want to leave my computer open to attacks either.
Also also, this isn't very important but I'm putting it out there just to cover everything, would it be good to allocate 100gb to / (would I need more if I wanted to do a lot of ricing?) and 16gb to /swap? Should I add more to / to future proof it since you can't resize an encrypted root partition?
I'm sorry if the answers to these are somewhere obvious, I made sure to look around every site I could first before asking here and haven't found it, and thank you in advance.
The LVM config is relatively simple once it is understood. The VG can consist of one or more partitions or drives (PVs) and can contain one or more logical volumes (LVs) that use some or all the space in the VG.
Depending on what your final plan is, you can use one or more VGs on one or both drives.
My approach would be to install the OS on the nvme, using an efi partition as /boot/efi, an ext4 partition for /boot, and the rest of the nvme as LVM. The LV used as / only needs to be large enough for the OS and whatever apps you decide to install. Generally 100G is large enough for most. Since you want to do gaming on a VM I think it should be on the nvme for speed and this means / might need more space to include the VM drive space. I personally would use another LV that I mounted at /var/lib/libvirt/images and thus the VM would not interfere with the space required for /.
Depending on your access requirements for /home, I use a separate LV for /home on an HDD since I seldom need rapid access to the data there.
Both drives can be in the same VG, or in separate VGs, with the understanding that if both are in the same VG then it takes a little more management to keep each LV on a single physical device. You definitely do not want / to span both the HDD and the nvme. Same for the VM drive space. Doing so would seriously impact access times. I use one VG for my SSD with the OS and another VG and LV for /home on my HDD raid array.
I also suggest that you allocate minimal space initially to each LV since expanding them is very easy.
Caveat: I have never used Debian or it's installer.
Given your lack of Linux, I would suggest using the installer. That way you get a system that should boot - initrd and fstab being primary concerns. I would hope the installer allows you to select from multiple disks - then again Debian has done some crazy things in the past.
I agree that using separate vg for each disk would be preferable for overall performance and data separation. Your understanding of what can (and can't) be resized is at best misplaced - I would say plain wrong.
This is a very deep rabbit hole for a new user - I would suggest you keep things as simple as possible, and learn along the way.
Thank you both, this is really insightful! I'll probably be using 2 VGs since I'm too new to this to be confident in managing a single one without making any mistakes.
Quote:
Originally Posted by computersavvy
I think it should be on the nvme for speed and this means / might need more space to include the VM drive space. I personally would use another LV that I mounted at /var/lib/libvirt/images and thus the VM would not interfere with the space required for /. Depending on your access requirements for /home, I use a separate LV for /home on an HDD since I seldom need rapid access to the data there.
Just to be sure, would the VM be able to work similarly to the main OS where one LV from the nVME could be used for the base OS with another LV from the HDD being used for a separate parition to house the files the games would be on? If it does work, is it safe?
Quote:
Originally Posted by syg00
Your understanding of what can (and can't) be resized is at best misplaced - I would say plain wrong.
This is a very deep rabbit hole for a new user - I would suggest you keep things as simple as possible, and learn along the way.
I thought so. Is there anywhere I should look for information on understanding what can/can't be resized? Especially regarding encryption? I want to set up something basic for now for sure, but I don't really understand what's necessary for what I want to do later and what isn't during install. I read that / has to be encrypted at install because it's difficult to encrypt later, and that encrypted / can't be resized without a reinstall, but I'm not too sure since different sources seem like they're saying different things.
If it were me I'd do it all at install - if you screw it up, then you can just start again till you get it right. Great learning experience.
A lot of info on the net has been out there a long time - getting current pages can be an effort. Not all the old stuff is wrong, but it may no longer be completely correct any more. Here is a debian page that seems to cover increasing am encrypted on LVM filesystem. If ever there is a possibility of needing to reclaim space from a filesystem to use elsewhere, be vigilant to not allow the installer to use XFS - been there done that. Use ext4 everywhere for peace of mind - except the EFI of course ...
Shrinking a root filesystem can be an exercise in concentration - do it from a liveCD that has LVM and LUKS support built in; I doubt Debian has, but you can use Fedora to do that in need.
Last edited by syg00; 08-17-2021 at 06:19 AM.
Reason: except ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.