Expanding volume group onto part of a PV

If none of the more specific forums is the right place to ask

Expanding volume group onto part of a PV

Postby FeedMeAStrayCat » 2019-09-03 16:08

Hi Everyone,

Quick summary: Can I extend a volume group to only use part of a physical volume.

I am currently using LVM with two VG's. One is the "system" group. This group is on an SSD, which is the physical volume.
The next group is the "fileserver" group. This one is using a HDD as the physical volume.

I am running out of space on the "system" group and would like to expand it. I have an additional HDD with 4TB that I'd like to use as the physical volume.

My question is, is there a way to add the physical volume, but only use part of it to expand the "system" volume group? 4TB is quite a bit more then I want to dedicate to "system" volume group. From what I've researched, I could simply partition the physical volume to only use a certain amount of space while leaving the rest unallocated.
Is this correct? I know that LVM has that flexibility. Are there any downsides to using this method?

Also, I'm assuming I would take a performance hit since some of the volume group would be on a SSD, and the other on a HDD.

Thanks!
FeedMeAStrayCat
 
Posts: 79
Joined: 2014-09-05 15:28

Re: Expanding volume group onto part of a PV

Postby CwF » 2019-09-03 17:00

FeedMeAStrayCat wrote:Are there any downsides to using this method?

needless complexity and dependency. Why make a jenga box? Bad idea IMO. Clean the 'system'.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Expanding volume group onto part of a PV

Postby p.H » 2019-09-03 18:36

FeedMeAStrayCat wrote:Can I extend a volume group to only use part of a physical volume.

No, a PV can belong to one VG only. But you do not have to allocate all the disk space to the PV, you can partition the disk and use a partition as the new PV.

The downside of spanning an LV across multiple disks is that if a disk fails, any LV using extents on this disk is lost.

Instead of extending the system VG it may be better to move some parts to another VG.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Expanding volume group onto part of a PV

Postby FeedMeAStrayCat » 2019-09-03 21:55

No, a PV can belong to one VG only. But you do not have to allocate all the disk space to the PV, you can partition the disk and use a partition as the new PV.


That's great! I found some info that discussed just partitioning part of a disk (the PV) to use for the a VG and then leave the rest unallocated for future expansion of any other volume groups.

The downside of spanning an LV across multiple disks is that if a disk fails, any LV using extents on this disk is lost.


Very true. This maybe an issue in the future. I have a disk dedicated to the fileserver VG and most definitely at some point I am going to have to expand that VG to another disk.

Instead of extending the system VG it may be better to move some parts to another VG.


This is a great idea! There maybe a tricky part. So I am running samba, so all the users home directories are on the SSD (woo hoo, fast!). Users have access to their home directories, no one else's (which is standard). So as you said it would be best to NOT extend the VG onto another disk. So I'm thinking, create a partition with how ever much space. Take that space and add it as a PV. Add that PV to a VG and create a LV, called "homes2" or something like that. Now the question is, how do I go about linking the original homes to the "homes2" that I created? Perhaps a symlink will do it? In samba, you can share the home directory of the user, and only that specific user can access that home directory (at least I think). So how can I link the two, and keep the same permissions? More so make sure that each user can only see their home directory? If I have read correctly there maybe an option in the samba config file.
FeedMeAStrayCat
 
Posts: 79
Joined: 2014-09-05 15:28

Re: Expanding volume group onto part of a PV

Postby p.H » 2019-09-03 22:34

I don't understand what samba has to do with home directories and disk allocation
You create a new LV, move the data from some directory (/home, /var... whatever) to the LV (using a temporary mount point) and mount the LV on that directory.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Expanding volume group onto part of a PV

Postby FeedMeAStrayCat » 2019-09-05 15:32

You create a new LV, move the data from some directory (/home, /var... whatever) to the LV (using a temporary mount point) and mount the LV on that directory.


OK I got it. It seems like the same procedure to move /home onto another partition. Except LVM is more flexible.

Thanks again for your help!
FeedMeAStrayCat
 
Posts: 79
Joined: 2014-09-05 15:28


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable