[linux-lvm] pvresize patch pending

Alasdair G Kergon agk at redhat.com
Fri Oct 28 19:27:52 UTC 2005

On Fri, Oct 28, 2005 at 12:55:52PM -0500, Zac Slade wrote:
> +    pv->size = size;

If the PV belongs to a VG (the only case that matters - pvcreate
is quite adequate otherwise), after the pv_write (equivalent
to 'pvcreate'), more fields need updating I think - see 
add_pv_to_vg() - incl. the various extent counters and
the segment lists.  

[If you only allow 'pvresize' with format_text this might be easier -
compatibility with LVM1 size calculations and restrictions is always 
tricky and needs careful testing - is it really worth the effort?]

> +       log_error("Currently limited to only One physical volume");

Try process_each_pv(), which also handles the locking for you.

For shrinking, you need to ensure that all the extents that are
about to be removed are unallocated - if they aren't, then the
metadata should be considered corrupt and it's best to refuse to change it.
[Separate recovery options needed.]

agk at redhat.com

More information about the linux-lvm mailing list