[linux-lvm] shrink pv without pvresize (FC3 LVM)

Alasdair G Kergon agk at redhat.com
Sun Dec 12 17:24:29 UTC 2004

On Fri, Dec 10, 2004 at 05:55:09PM -0500, Ilya Goldin wrote:
> # pvresize
> Is there a workaround (short of writing pvresize)?
Yes - vgcfgbackup, edit backup file, vgcfgrestore.

The field you need to edit to change the size is pe_count
according to:

  pe_start + pe_count * extent_size <= dev_size

  pe_count <= (dev_size - pe_start) / extent_size

You can find out the current device size with:
  pvs -o +dev_size --units s

[The units used in the file are sectors of 512 bytes]

Only change pe_count for the PV you're resizing and nothing else!

agk at redhat.com

More information about the linux-lvm mailing list