Operating System - HP-UX
1837035 Members
3483 Online
110111 Solutions
New Discussion

Re: Moving a PV from one server to another server.

 
P Arumugavel
Respected Contributor

Moving a PV from one server to another server.

Hi,

In my server, a VG was having only one PV and has 4 LV's. Now what happened that I removed the disk to connect into another server. Now how will retrive all LV's and data. But I dont have any details like VG map file, ID...etc. I am raising this for my understanding... pls post your replies.

Rgds \ Vel
8 REPLIES 8
Bijeesh
Respected Contributor

Re: Moving a PV from one server to another server.

Hi,
If you know the LV names,create a simple ASCII file which contains the LVnames.
#cat /tmp/vgXX.map
1 lvol1
2 lvol2
3 lvol3
4 lvol4

Create the unique group file for the vg and import the vg using the mapfile.

# ll /dev/*/group
# mkdir /dev/vgXX
# mknod /dev/vgXX/group c 64 0xXX0000
# vgimport -v vgXX -m /tmp/vgXX.map /dev/dsk/cXtXdX
vishnu.khandare
Respected Contributor

Re: Moving a PV from one server to another server.


Hi Vel,
U can move PV from one server to other, for that u have to take vg map file syntax for that is as below,
#vgexport -s -p -m v /tmp/vg0X.map /dev/vg0X

copy this vgmap file to other server for safer side.

Copy back the same file and export it to get the same lvols.


#vgimport -v vgXX -m /tmp/vgXX.map /dev/dsk/cXtXdX

Hope this solves ur query
Dont forget to assign points.

Regards
Vishnu Khandare
You should deserve before U desire!!!!
P Arumugavel
Respected Contributor

Re: Moving a PV from one server to another server.

Hi Bijeesh/Vishnu,

I dont know the LV names and dont have VG map file. But this disk was the only one PV in that VG. So can I go as follows...

#ioscan -funC disk
#mkdir /dev/vgname
#ll /dev/*/group
#mknod /dev/vgname/group c 64 0xYY0000
#vgimport -v /dev/vgname disk

Please let me know if i am right.

Thanks \ Vel
Bijeesh
Respected Contributor

Re: Moving a PV from one server to another server.

Hi,
Yes.!You can do it.But only the thing is that the LV names will be default,like lvol1,lvol2 etc.

Also you need to activate the vg after this.
#vgchange -a y vgXX

From man vgimport...
"vgimport creates logical volume device files under the vg_name directory using the naming convention given in mapfile or using the default naming convention used by the lvcreate command."

See man vgimport.




P Arumugavel
Respected Contributor

Re: Moving a PV from one server to another server.

Yes...
As we haven't given any VG mapfile here, vgimport wont create the LV's in original name what earlier VG carried. But vgimport creates LV's in default names how lvcreate does.
It doesn't matter of LV names but data.
Will try and comeback.
Anyhow thanks for being supportive.
Bill Hassell
Honored Contributor

Re: Moving a PV from one server to another server.

> vgimport creates LV's in default names

That's why it is very important to keep a vgdisplay -v records for all your systems as well as use vgexport -p to create mapfile.

However, the default names may be changed at any time after the VG has been imported. You can't rename the VG but you can rename the lvols. ALWAYS rename both device files:

mv /dev/vg03/lvol1 /dev/vg03/myNewLVOL
mv /dev/vg03/rlvol1 /dev/vg03/rmyNewLVOL

The raw devicefile must have "r" in front of the name.


Bill Hassell, sysadmin
Viktor Balogh
Honored Contributor

Re: Moving a PV from one server to another server.

>You can't rename the VG but you can rename the lvols. ALWAYS rename both device files:

mv /dev/vg03/lvol1 /dev/vg03/myNewLVOL
mv /dev/vg03/rlvol1 /dev/vg03/rmyNewLVOL

Bill has right. But I would do the renaming in a deactivated state...
****
Unix operates with beer.
P Arumugavel
Respected Contributor

Re: Moving a PV from one server to another server.

Thanks to all replies.