Saturday, 9 August 2014

change a clustered LVM volume group to non-clustered.

GOAL


How to change clustered volume group to non-clustered and vise versa.

ERROR example:
# vgimport /dev/mapper/mpath-c0t5000CCA027C3225Cd0
  connect() failed on local socket: Connection refused 
  WARNING: Falling back to local file-based locking. 
  Volume Groups with the clustered attribute will be inaccessible. 
  Skipping clustered volume group vgclu1


SOLUTION


Check that volume group has clusterd attribute
   # vgs --config 'global {locking_type = 0}'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  VG     #PV #LV #SN Attr   VSize  VFree 
  vgclu1  1   1   0 wz--nc 96.00M 76.00M       <----- Attr includes the 'c' flag meaning clustered.
 
Make sure that this volume group not using cluster software, for e.x. Redhat Cluster Suite.



Force take over clusger volume group
 # vgchange -cn vgclu1 --config 'global {locking_type = 0}'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  Volume group "vgname" successfully changed
# vgchange -ay vgclu1 
  WARNING: After making this change, you must not activate the volume group on more than one server at a time or LVM metadata corruption can occur (even if no changes are made).
 

To temporarily activate the volume group, but leave it clustered, use the following command:
 # vgchange -ay vgclu1 --config 'global { locking_type = 0 }'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  1 logical volume(s) in volume group "vgclu1" now active
WARNING You must not execute this command on more than one server at a time or LVM metadata corruption can occur (even if no changes are made).

WARNING The vgchange using --config 'global {locking_type = 0}' will not work on a mirrored Logical Volume. The user must restore the VG from a valid LVM backup file using vgcfgrestore. Optionally the user can run lvconvert -m0 on the mirrored LV and run the commands outlined in steps 1-3 above then remirror using lvconvert. Please note that the re-mirroring process can take a while depending on the size of the LV being re-mirrored.

No comments:

Post a Comment