Question on LVM and creating LV's and later resizing
Linux - GeneralThis 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
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.
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.
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.
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. ??
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.