Operating System - HP-UX
1832276 Members
2345 Online
110041 Solutions
New Discussion

Identical LV names in different VGs

 
Shibu George P
Occasional Advisor

Identical LV names in different VGs

I am migrating some of the filesystems from /dev/vg00 (eg:- rlvol_sap) to /dev/vg01. Could you please let me know that can I have same LV names in different VGs (eg:- her can I create rlvol_sap in /dev/vg01)
3 REPLIES 3
Jeff Schussele
Honored Contributor

Re: Identical LV names in different VGs

Absolutely.
LV names are completely independent of each other *when* in different VGs.

Just reference vg00 in the vgexport command & vg01 in the vgimport command.

You'll actually have two copies of the lvol(s) until until you remove the vg00 LVs. BUT they *cannot* both be active at the same time.
So you'd essentially vgexport them on vg00. Then deactivate vg00 & import them on vg01 & activate it. You can't have them both active at the same time.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Identical LV names in different VGs

Well - let me walk that one back a little.
Since the two VGs will occupy different disks you could have them both active.

I think the way I'd do it would be to create the new VG, activate it & suppress all I/O to the vg00 LV/FS create a temp mountpoint for the vg01 LV/FS, activate & mount it & copy the vg00 LV/FS over to the vg01 LV/FS.

So you'd need to be very careful just which VG/LV/FS is being accessed after that. It could become problematic if they were both active at the same time.
But of course the mount points would *have* to be different so a healthy dose of user education would be indicated *if* they were both active. Although I wouldn't recommend that they both be active & mounted simultaneously for that reason.

What you could do is unmount the original vg00 LV/FS, deactivate vg00 & vg01 post-copy and edit /etc/fstab to remove the temp vg01 entry & have the old vg00 mount point now point to vg01. Then reactivate vg01 & run a mountall and the existing mount point should be then be using the new vg01 LV/FS.

It's too easy for users to mess up and read/write to the incorrect VG/LV/FS if they're both active & mounted simultaneously.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Avinash20
Honored Contributor

Re: Identical LV names in different VGs

"Could you please let me know that can I have same LV names in different VGs "

Yes, you can have in different VG's, but we need to mount it as a different name

eg: if /dev/vg00/lvol_sap is mounted as /lvol_sap, you could mount /dev/vg01/lvol_sap as /lvol_sap_backup and then start copying the data and restoring it
Once the restoration is sucessfull, stop the application, umount both the Filesystem, mount /dev/vg01/lvol_sap_backup as /lvol_sap, start your application and check if it works fine.

If yes, edit /etc/fstab with
/dev/vg01/lvol_sap on /lvol_sap
"Light travels faster than sound. That's why some people appear bright until you hear them speak."