pvchange Command Examples in Linux

pvchange command changes allocation permissions on a physical volume. You might disallow new allocations if you’re making changes on other volumes and intend to delete one immediately thereafter. The UUID of PV can be re-generated with the command pvchange. For example:

# pvchange --uuid [pv-name]

Please make sure to deactivate the VG in question vgchange -an vg-name before changing the UUID. For this we need to unmount the LVs on the VG and logical volumes too will be deactivated. Once the UUID is changed, you could activate the VG with vgchange -ay vg-name.

pvchange Command Examples

1. To ignore or un-ignore metadata areas on this physical volume:

# pvchange --metadataignore 
# pvchange --metadataignore 

2. To enable or disable allocation of physical extents on this physical volume:

# pvchange -x y /dev/sda2
# pvchange --allocatable y /dev/sda2 

3. To generate new random UUID for specified physical volumes:

# pvchange -u /dev/sda2
# pvchange --uuid /dev/sda2 

4. To do the change for all the pvchanges:

# pvchange -a x y
# pvchange --all u 

For more information on pvchange command, refere to its man page:

# man vgchange
Related Post