8.8 Renaming a Clustered LVM Logical Volume

For a clustered LVM logical volume, there is no easy tool for renaming the volume. You can rename the LVM logical volume by using the lvrename command, then modify the volume name in the cluster load, unload, and monitor scripts. The command does not change the volume group name. The LVM cluster resource must be offline while you rename the logical volume and modify the scripts.

Using the lvrename command to rename the LVM logical volume does not modify other related parameters that are used by the LVM cluster resource. You can optionally also modify the following:

  • Mount point path

  • Resource name

  • If NCP is enabled for the LVM logical volume:

    • NCP virtual server name

    • NCP volume name

    • Volume object for the NCP volume on the virtual server

Take the resource offline, modify the related parameters, modify the resource scripts with the new values, then bring the resource online.

  1. Log in to the server as the root user, then open a terminal console.

  2. Bring the LVM cluster resource offline.

    cluster offline <lvm_resource_name>
    

    For example, to offline the vol44_resource, enter

    cluster offline vol44_resource
    

    Wait until the resource is offline before continuing.

  3. At the command prompt, enter

    lvrename </dev/vg_name/old_lv_name> </dev/vg_name/new_lv_name>
    

    Replace vg_name with the name of the volume group. If you created the LVM logical volume in NSSMU, the volume group name is the same as the logical volume name. If you created the LVM logical volume with NLVM or with LVM commands, you might have used a different name for the volume group.

    Replace old_lv_name with the current name of the LVM logical volume.

    Replace new_lv_name with the new name of the LVM logical volume.

    For example, to change the name of the logical volume on volume group vghome from lv_users to lv_home, enter

    lvrename /dev/vghome/lv_users /dev/vghome/lv_home
    
  4. Modify the load, unload, and monitor scripts for the LVM cluster resource to use the new LVM logical volume name in the value for the MOUNT_DEV parameter.

    1. Open iManager in a web browser, then log in as a cluster administrator user.

    2. In Roles and Tasks, select Clusters > My Clusters, then select the cluster where you created the LVM cluster resource.

    3. On the Cluster Manager page, select the check box next to the resource, then click Offline.

      Wait for the status to report that it is offline, then continue.

    4. Modify the MOUNT_DEV value in the load, unload, and monitor scripts for the LVM volume group cluster resource:

      1. On the Cluster Manager page, select the resource’s name link to open its Cluster Properties page, then click the Scripts tab.

        The Scripts tab automatically displays the load script.

      2. Modify the load script:

        In the load script, type the new value for the logical volume in the MOUNT_DEV variable, then click Apply.

        # define the device
        MOUNT_DEV=/dev/$VOLGROUP_NAME/lv_home
        
      3. Click the Unload Script link, type the new value for the logical volume in the MOUNT_DEV variable, then click Apply.

        # define the device
        MOUNT_DEV=/dev/$VOLGROUP_NAME/lv_home
        
      4. Click the Monitor Script link, type the new value for the logical volume in the MOUNT_DEV variable, then click Apply.

        # define the device
        MOUNT_DEV=/dev/$VOLGROUP_NAME/lv_home
        
      5. At the bottom of the page, click OK to close the Properties page and save your changes.

        The changes do not take effect until the resource is brought online.

  5. (Optional) Rename the mount point path that you use for the logical volume. The mount point should still be unmounted when you perform this task.

    For information, see Renaming the Mount Point Path for a Clustered LVM Volume in the OES 11 SP3: Novell Cluster Services for Linux Administration Guide.

  6. (Optional) Rename the resource.

    Ensure that the resource is offline, then enter

    cluster rename <old_resource_name> <new_resource_name>
    
  7. (Optional) If you created an NCP virtual server for the resource, rename the NCP virtual server name.

    Use the Directory Administration > Delete Object task in iManager to delete the old NCP virtual server (the NCS:NCP Server object) for the resource, then use /opt/novell/ncs/bin/ncs_ncpserv.py to create a new virtual server for the resource. For information, see Creating a Virtual Server Object for an LVM Volume Group Cluster Resource in the OES 11 SP3: Novell Cluster Services for Linux Administration Guide. Ensure that you update the load, unload, and monitor scripts.

  8. (Optional) If NCP file access is enabled for the LVM logical volume, rename the NCP volume and its Volume object.

    1. Modify the NCP volume name for the NCP_VOLUME parameter in the load, unload, and monitor scripts for the LVM cluster resource. For information, see Adding NCP Volume Commands to the Resource Scripts in the OES 11 SP3: Novell Cluster Services for Linux Administration Guide. Bring the resource online, but do not allow users to access the volume until the Volume object is re-created.

    2. Use the Directory Administration > Delete Object task in iManager to delete the old Volume object, then create a new Volume object that uses the newly created NCP virtual server name and new NCP volume name. For information, see Creating a Shared NCP Volume Object in the OES 11 SP3: Novell Cluster Services for Linux Administration Guide.

  9. Bring the resource online. At the command prompt, enter

    cluster online <resource_name>