LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-16-2021, 10:46 AM   #1
monkeystuff
LQ Newbie
 
Registered: Aug 2021
Posts: 8

Rep: Reputation: Disabled
Question 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.
 
Old 08-16-2021, 09:06 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.
 
2 members found this post helpful.
Old 08-17-2021, 01:53 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
1 members found this post helpful.
Old 08-17-2021, 04:06 AM   #4
monkeystuff
LQ Newbie
 
Registered: Aug 2021
Posts: 8

Original Poster
Rep: Reputation: Disabled
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 View Post
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 View Post
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.
 
Old 08-17-2021, 06:18 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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 ...
 
1 members found this post helpful.
Old 08-17-2021, 08:47 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Strongly agree with "computersavvy" here – do not mix types of drives within the same group, if the access-times are substantially different.
 
1 members found this post helpful.
  


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
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
[SOLVED] LVM, Expanded the size of my physical volume, how do I expand the volume group? pyr Linux - General 2 09-15-2013 05:28 AM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 09:37 AM
can't recover LVM volume: Please specify a *single* volume group to restore SoftDux Linux - General 1 08-04-2011 03:31 PM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 PM.

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