2

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.

2

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:

  1. display physical extents (PE) allocation among your PVs and VGs with pvdisplay
  2. (optional) reduce the size of the filesystem(s) on the first VG with e.g. resize2fs,
  3. (optional) reduce the size of the logical volume(s) containing the filesystem(s) above with lvresize,
  4. disable allocation of new PEs on one or some of the PVs on your first VG with pvchange,
  5. 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).
  6. remove these PVs from your first VG with vgreduce.
  7. add these PVs to your other VG with vgextend.

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.

| improve this answer | |
  • The "All about LVM on one page" is an incredible eye opener. Thanks for your guidance recommended reading! – hsatterwhite Feb 22 '11 at 16:44
  • The "All about LVM on one page" link seems to be unavailable. You might try using the Internet Archive at web.archive.org/web/20150917045014/http://… – Thomas N May 12 '17 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.