Skip to main content

Change a clustered LVM volume group to non-clustered. RedHat

Originally solution 3618 on access.redhat.com

 Issue

  • How do I change a volume group to clustered or non-clustered?
  • We need to mount the Clone LUN's onto another RHEL server so that we can write the data to tape from that server. While mounting the VG's on the RHEL server, I am getting the below error:
# vgimport /dev/mapper/mpath0 
  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 vgname
  • How to convert a volume group from clustered to non-clustered and vice-versa?

Environment

  • Red Hat Enterprise Linux (RHEL) including
    • Red Hat Enterprise Linux 4
    • Red Hat Enterprise Linux 5
    • Red Hat Enterprise Linux 6
  • May or may not require Red Hat High Availability Cluster
  • LVM2 volume management
    • The volume group is clustered:
      • There are 2 ways to determine; firstly using vgdisplay:
      # vgdisplay vgtest --config 'global {locking_type = 0}' | grep Clustered
        WARNING: Locking disabled. Be careful! This could corrupt your metadata.
        Clustered             yes
      
      • Also, vgs will display the 'c' attribute for clustered volume groups:
      # vgs --config 'global {locking_type = 0}'
        WARNING: Locking disabled. Be careful! This could corrupt your metadata.
        VG     #PV #LV #SN Attr   VSize  VFree 
        vgname   1   1   0 wz--nc 96.00M 76.00M       <----- Attr includes the 'c' flag meaning clustered.
      
    • It is undesirable that the volume group is clustered. Possible reasons include:
      • The volume group is being converted to non-clustered permanently.
      • The command vgchange -cy was accidentally run on the volume group or the volume group was accidentally made clusrered.
        • The cluster cannot form quorum, or clvmd cannot start and the volume group needs to be temporarily un-clustered to restore service.

Resolution

1. If the cluster can become quorate and the clvmd service can be started, the volume group can be changed back to non-clustered by running:
# vgchange -cn vgname
   Volume group "vgname" successfully changed
2. If the cluster cannot achieve quorum, or clvmd is unable to function for whatever reason, clustered locking can temporarily be disabled with the following command, allowing us to convert the volume group from clustered to non-clustered:
# vgchange -cn vgname --config 'global {locking_type = 0}'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  Volume group "vgname" successfully changed
  • Then, if required, the non-clustered volume group can be activated on a single node with the following command:
# vgchange -ay <volume_group_name>
  • 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).
3. To temporarily activate the volume group, but leave it clustered, use the following command:
# vgchange -ay vgname --config 'global { locking_type = 0 }'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  1 logical volume(s) in volume group "vgname" 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.

Root Cause

  • If the volume group is set to clustered (vgchange -cy vgname) then the volume group can only be activated if your Red Hat High Availability cluster is quorate, and Clustered LVM Daemon (CLVMD) is active.
  • It is not possible to change a clustered volume group back using vgchange -cn vgname if CLVMD is not running because it needs to acquire a clustered lock in order to change the attribute.
  • Executing LVM commands with the parameters --config 'global { locking_type = 0 }' allow that command to temporarily change the LVM configuration. This particular command sets locking_type to 0, which means basically "ignore locking".

Comments

Popular posts from this blog

Solaris. remove unusable scsi lun

Solaris remove unusable or failing scsi lun 1. The removed devices show up as drive not available in the output of the format command: # format Searching for disks...done ................      255. c1t50000974082CCD5Cd249 <drive not available>           /pci@3,700000/SUNW,qlc@0/fp@0,0/ssd@w50000974082ccd5c,f9 ................      529. c3t50000974082CCD58d249 <drive not available>           /pci@7,700000/SUNW,qlc@0/fp@0,0/ssd@w50000974082ccd58,f9 2. After the LUNs are unmapped Solaris displays the devices as either unusable or failing. # cfgadm -al -o show_SCSI_LUN | grep -i unusable # # cfgadm -al -o show_SCSI_LUN | grep -i failing c1::50000974082ccd5c,249       disk         connected    configured   failing c3::50000974082ccd58,249 ...

memory error detect XSCF uboot

If you see something like this when you poweron you server: memory error detect 80000008, address 000002d0 data 55555555 -> fbefaaaa capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d0 memory error detect 80000008, address 000002d4 data aaaaaaaa -> deadbeef capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d4 memXSCF uboot  01070000  (Feb  8 2008 - 11:12:19) XSCF uboot  01070000  (Feb  8 2008 - 11:12:19) SCF board boot factor = 7180     DDR Real size: 256 MB     DDR: 224 MB Than your XSCF card is broked. Replace it with new one. After that it will ask you for enter chassis number - located at front of the server XSCF promt to enter your chasses number ( is a S/N of your server ): Please input the chassis serial number : XXXXXXX 1:PANEL Please select the number : 1 Restoring data from PANEL to XSCF#0. Please wait for se...

SPARC OBP cheatsheet

Boot PROM Basics Boot PROM(programmable read only memory): It is a firmware (also known as the monitor program) provides: 1. basic hardware testing & initialization before booting. 2. contains a user interface that provide access to many important functions. 3. enables the system to boot from wide range of devices. It controls the system operation before the kernel becomes available. It provides a user interface and firmware utility commands known as FORTH command set. These commands include the boot commands, the diagnostic commands & the commands for modifying the default configuration. Command to determine the version of the Open Boot PROM on the system: # /usr/platform/'uname -m'/sbin/prtdiag -v (output omitted) System PROM revisions: ---------------------- OBP 4.16.4 2004/12/18 05:21 Sun Blade 1500 (Silver) OBDIAG 4.16.4.2004/12/18 05:21 # prtconf -v OBP 4.16.4 2004/12/18 05:21 Open Boot Architectures Standards: It is based on IEEE standard #1275, accord...