Operating System - HP-UX
1752577 Members
3917 Online
108788 Solutions
New Discussion юеВ

Re: Renaming Volume groups

 
SOLVED
Go to solution
Phil Storer
Advisor

Renaming Volume groups

Looking to renaming a volume group. Have the following scenario - Volume group vdsk01 with 6 logical volumes shown below. OS is HP-UX 11.11

/dev/vdsk01/lvol1
.
.
/dev/vdsk01/lvol6

My guess is to do the following steps - correct me if I'm wrong which I think I am

==> vgexport -s -p -m vdsk.map vdsk01
==> mkdir /dev/vg02
==> mknod /dev/vg02/group c 64 0x020000
==> vgchange -a y vg02
==> vgimport -s -m vdsk.map vg02
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: Renaming Volume groups

Yes, that should do nicely.

Remember that before you vgexport vdsk01, you must unmount all LVs, and deactivate the VG (vgchange -a n vdsk01).

Then after you re-import it as VG02, don't forget to change your /etc/fstab file so that it mounts using /dev/vg02/lvol? rather than /dev/vdsk01/lvol?.

Good luck.
Stuart Abramson_2
Honored Contributor

Re: Renaming Volume groups

Here are my notes from when I did this last:

A. Outline

record minor number (if you want to reuse)
unmount file systems
make map file
vgexport vg
vgimport vg with new name
make new mount points
update /etc/fstab
mount new LVs
extend orabin
create oradata04

B. Steps:

1. Unmount all file systems:

umount /ci_clp_dvd/oradata01
umount /ci_clp_dvd/oradata02
umount /ci_clp_dvd/oradata03
umount /ci_clp_dvd/orabin
umount /ci_clp_dvd/oraadmin

2. Make map file:

cd /root/doc
vgexport -s -p -v -m mapfile.clp vgci_clp_dvd

Verify:

cat mapfile.clp


3. Vgexport the VG:

a. Note the minor number:

ll /dev/vgci*/group
11

vgchange -a n vgci_clp_dvd
vgexport vgci_clp_dvd

4. vgimport the VG with new name, same minor number:

mkdir /dev/vgaa_gen_dvd
mknod /dev/vgaa_gen_dvd/group c 64 0x110000
vgimport -s -v -m mapfile.clp vgaa_gen_dvd
vgchange -a y

vgreduce alternate links (we don't use them)

vgdisplay vgaa_gen_dvd


5. Make new mount points:

mkdir -p /aa_gen_dvd/orabin
mkdir -p /aa_gen_dvd/oraadmin
mkdir -p /aa_gen_dvd/oradata01
mkdir -p /aa_gen_dvd/oradata02
mkdir -p /aa_gen_dvd/oradata03
mkdir -p /aa_gen_dvd/oradata04

6. Edit /etc/fstab

vi /etc/fstab
change:
ci_clp_dvd -> aa_gen_dvd

7. Mount:

mount -a

bdf
Rajeev  Shukla
Honored Contributor

Re: Renaming Volume groups

Yes you can rename the VG by exporting it and then importing it back.
vgexport -s -v -p -m vdsk.map vdsk01
vgexport /dev/vdsk01
mkdir /dev/vg02
mknod /dev/vg02/group c 64 0x0...(sama number sa vdsk)
vgimport -s -v -m vdsk.map /dev/vg02
vgchange -a y /dev/vg02
Phil Storer
Advisor

Re: Renaming Volume groups

Thanks for all the replies. It reassures me that I'll be doing the right steps. Of course I could have removed the volume group completely including the logical volumes and filesystems. Then start from scratch and restore from backup.