Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Expanding volume group onto part of a PV

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
FeedMeAStrayCat
Posts: 79
Joined: 2014-09-05 15:28

Expanding volume group onto part of a PV

#1 Post by FeedMeAStrayCat »

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!

CwF
Global Moderator
Global Moderator
Posts: 2709
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 201 times

Re: Expanding volume group onto part of a PV

#2 Post by CwF »

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'.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Expanding volume group onto part of a PV

#3 Post by p.H »

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.

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

Re: Expanding volume group onto part of a PV

#4 Post by FeedMeAStrayCat »

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.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Expanding volume group onto part of a PV

#5 Post by p.H »

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.

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

Re: Expanding volume group onto part of a PV

#6 Post by FeedMeAStrayCat »

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!

Post Reply