LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-11-2017, 01:22 PM   #1
snatale1
Member
 
Registered: Aug 2003
Location: Richmond, Virginia, US
Distribution: Ubuntu 20.04 / Manjaro
Posts: 439

Rep: Reputation: 48
Question on LVM and creating LV's and later resizing


Hey guys, stupid question. My current scheme is traditional partitions on a RAID1 consisting of the old school layout of

/boot
/swap
/
/home

This is on my home video / backup server and I want to do a Nextcloud and that thing REALLY doesn't want it's data dir outside of the main / which doesn't have a ton of room in it so I was gonna backup and repartition using LVM this time. Question is, assuming I more or less copy what I've got now just using LVM and LV's this time does it make any difference when possibly resizing later (this time I'm going to be leaving unallocated space at the end) where or when these are set up? Meaning say I had at 20GB / and then a 100GB /home after it then some unallocated space at the end of the drive. It means nothing that /home is after / right? same question really goes for any of them. My understanding is that with the LV's they can just pick up space and add them to the LV assuming you have it to give at that later date regardless of where it was on the drive right? I know this sounds backwards just having trouble getting around thinking about this in a new way. Would also be keeping my drives on a RAID1 if that changes anything.
 
Old 11-11-2017, 01:59 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Yes, you can just take any available space and add it to an LV and enlarge its filesystem. It's similar to a process requesting more memory, which the kernel can pick up from anywhere and add it to the process's VM space. The difference is that a rotating disk may have to seek over a large distance if a filesystem gets split, for example, on opposite sides of your 100GB /home partition. Fortunately, LVM has a powerful pvmove utility that can rearrange the placement of LVs on disk drives if you do find the need to optimize performance, and it can do that rearrangement while the system remains up and running. The down side is that in order to acomplish that you need to learn more about LVM than you probably wanted to know. AFAIK, there is no simple "defragment" tool for LVM.
 
1 members found this post helpful.
Old 11-11-2017, 03:49 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Be sure not confuse partitions on top of a LVM manager scheme. They have to be considered differently I'd suggest. Generally the LVM management makes adding space seamless if you configure it correctly at start.

Your choices tend to be using a partition management scheme like LVM or you can consider using something like ZFS or BtRFS. I assume you mean a local nextcloud instance instead of wan based storage. ??
 
Old 11-11-2017, 03:55 PM   #4
snatale1
Member
 
Registered: Aug 2003
Location: Richmond, Virginia, US
Distribution: Ubuntu 20.04 / Manjaro
Posts: 439

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by rknichols View Post
Yes, you can just take any available space and add it to an LV and enlarge its filesystem. It's similar to a process requesting more memory, which the kernel can pick up from anywhere and add it to the process's VM space. The difference is that a rotating disk may have to seek over a large distance if a filesystem gets split, for example, on opposite sides of your 100GB /home partition. Fortunately, LVM has a powerful pvmove utility that can rearrange the placement of LVs on disk drives if you do find the need to optimize performance, and it can do that rearrangement while the system remains up and running. The down side is that in order to acomplish that you need to learn more about LVM than you probably wanted to know. AFAIK, there is no simple "defragment" tool for LVM.
Thanks, thats what I though just got in my own head about it.
 
Old 11-11-2017, 03:57 PM   #5
snatale1
Member
 
Registered: Aug 2003
Location: Richmond, Virginia, US
Distribution: Ubuntu 20.04 / Manjaro
Posts: 439

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by jefro View Post
Be sure not confuse partitions on top of a LVM manager scheme. They have to be considered differently I'd suggest. Generally the LVM management makes adding space seamless if you configure it correctly at start.

Your choices tend to be using a partition management scheme like LVM or you can consider using something like ZFS or BtRFS. I assume you mean a local nextcloud instance instead of wan based storage. ??
Ya, local setup. I've been trying to get info on ZFS lately I like what I hear about snapshots and it's flexibility but other than hearing good things I've never dealt with it.
 
Old 11-11-2017, 05:39 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
All of these advanced ways will require you to brush up on the use. LVM may have more documentation I'd guess.
 
Old 11-11-2017, 06:08 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
LVM is the way to go - if you have a current version, it will even do RAID1 without requiring you to mess with mdadm. Very handy when you want to expand the physical space. Also has failure policies so you can have spares and allow it to rebuild automagically on a failure.
Much lower learning curve than zfs or btrfs, and can be added easily to the current setup. Check out the RHEL LVM guide.
 
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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing LVM prasanta.82 Linux - Server 1 06-15-2011 11:56 PM
resizing PV does not work (lvm) after resizing partition deadeyes Red Hat 5 03-11-2011 11:19 AM
LVM resizing question - pvdisplay shows that drive is 70G smaller than it is blueduck Linux - Software 1 06-29-2010 09:07 AM
Question on creating a striped lvm lstamm Slackware 4 12-18-2007 06:20 PM
Resizing / with LVM zivota Red Hat 2 07-12-2006 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:20 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