Operating System - HP-UX
1838143 Members
3832 Online
110124 Solutions
New Discussion

rename vg , lv and mount point

 
SOLVED
Go to solution
ITSD-ACCS
Frequent Advisor

rename vg , lv and mount point

Hello,

I need to rename mount point, logical volume and volume group. I know renaming mount point is easy, but what about the others ? How do I do it if I know it is empty ?

The system is running on cluster, so I believe I need to change the vginfo of /etc/cmcluster, any other things that I have missed out ?


Example :
From
/dev/dvlp01/lvol1 /dvlp01
To
/dev/vg01/lv0l4 /prod04

Thanks
5 REPLIES 5
Donald Kok
Respected Contributor
Solution

Re: rename vg , lv and mount point

vgchange -an dvlp01
vgexport -v -m /etc/lvmconf/dvlp01.map /dev/dvlp01
vi /etc/lvmconf/dvlp01.map # and adjust like you want
mkdir /dev/vg01
mknod /dev/vg01/group c 64 01010000
vgimport -v /dev/vg01 -m /etc/lvmconf/dvlp01.map
vgchange -ay vg01

My systems are 100% Murphy Compliant. Guaranteed!!!
Trond Haugen
Honored Contributor

Re: rename vg , lv and mount point

If by empry you mean there is no data on the lvols, you can just lvremove and vgremove them and create them anew.
It this VG is part of a ServiceGuard package you will need to remove the "old" lvols/vg on the other nodes and import the new.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Frederic Sevestre
Honored Contributor

Re: rename vg , lv and mount point

Hi,

If the filesystem is not mounted :

# mv dvlp01 prod04
# vgexport -v -s -m vg01.mapfile dvlp01
# vi vg01.mapfile --> replace lvol1 with lv0l4
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgimport -v -s -m vg01.mapfile vg01

If the filesystem is used by a SG package :
- edit the cluster configuration file and replace /dev/dvlp01 with /dev/vg01
- edit the package configuration file to change the vg info : VG[0]=... LV[]...FS[]...
- report the odifications to all the nodes.

I the filesystem is not used by SG then edit the fstab andmodify it.

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
ITSD-ACCS
Frequent Advisor

Re: rename vg , lv and mount point

Thanks a lot ! But what if vg of dvlp01 has been partitioned into lvol2...lvol3, would vgexport /dev/dvlp01 affect other lv ?
Frederic Sevestre
Honored Contributor

Re: rename vg , lv and mount point

Yes, all the dvp01's lv will now belongs to vg01. You can change their names editing the mapfile before the vgimport.

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?