How can you re-allocate space from one Volume Group to another Volume Group in Linux? Both volume groups exist on the same physical drive and are split evenly, let say 50G each. I'd like to shrink one down to 20G and re-assign the 30G to the other VG, extending it to 80G.
Volume Groups (VG) don't deal with raw space directly, they group Physical Volumes (PV), hence their names.
Depending on your actual VG configuration you have to do the following:
- display physical extents (PE) allocation among your PVs and VGs with
- (optional) reduce the size of the filesystem(s) on the first VG with e.g.
- (optional) reduce the size of the logical volume(s) containing the filesystem(s) above with
- disable allocation of new PEs on one or some of the PVs on your first VG with
- move used PEs from these "allocation disabled" PVs on your first VG to another PV with free PEs using
pvmove(ie "compact" your first VG to a subset of PVs).
- remove these PVs from your first VG with
- add these PVs to your other VG with
This is assuming that your first VG consists of multiple PVs and that you can reduce the size of the LVs so that you free up enough PEs.
All about LVM on one page is a good resource about LVM with description of similar use cases.