6.16 Renaming an LVM Volume

NSSMU does not provide a way to modify the name of an LVM volume. You can use the Linux lvrename command to rename an existing LVM logical volume in a volume group from the old volume name to the new volume name. The command does not change the volume group name. You should gracefully dismount the volume before attempting to rename it.

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

  2. Launch NSSMU and dismount the logical volume:

    1. At the command prompt, enter

      nssmu
      
    2. Select Linux Volumes and press Enter.

    3. Select the LVM volume, then press F7 Dismount.

    4. Select the volume, then view its details to verify that the Mounted state changes from Yes to No.

    5. Press Esc twice to exit NSSMU.

  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. (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 Section 6.14, Renaming the Mount Point Path for a Linux Volume.

  5. In a text editor, modify the /etc/fstab file with the new logical volume name. You should also specify the new mount point if you renamed it.

  6. Launch NSSMU and mount the renamed LVM logical volume:

    1. At the command prompt, enter

      nssmu
      
    2. Select Linux Volumes and press Enter.

    3. Select the LVM volume, then press F7 Mount.

    4. Select the volume, then view its details to verify that the Mounted state changes from No to Yes.

    5. Press Esc twice to exit NSSMU.