System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

disks moved to different host without vgexporting first

 
SOLVED
Go to solution
paul_xedos
Frequent Advisor

disks moved to different host without vgexporting first

Hi, 

I'm not sure if this is terminal but disks from an hpvm were moved from one physical host to another without vgexport

 

One disk has made it across  from volgroup vg00 and so the machine boots

 

The remaning 2 disks have come across with what appears to be different target addresses and so is not mountable and I can not activate the volume group

 

Here's the disks I now see

 

 

bash-4.0# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 1 0/0/0/0.0.0 sdisk CLAIMED DEVICE HP Virtual Disk
/dev/dsk/c0t0d0 /dev/dsk/c0t0d0s2 /dev/rdsk/c0t0d0 /dev/rdsk/c0t0d0s2
/dev/dsk/c0t0d0s1 /dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s1 /dev/rdsk/c0t0d0s3
disk 0 0/0/0/0.1.0 sdisk CLAIMED DEVICE HP Virtual Disk
/dev/dsk/c0t1d0 /dev/dsk/c0t1d0s2 /dev/rdsk/c0t1d0 /dev/rdsk/c0t1d0s2
/dev/dsk/c0t1d0s1 /dev/dsk/c0t1d0s3 /dev/rdsk/c0t1d0s1 /dev/rdsk/c0t1d0s3
disk 4 0/0/0/0.2.0 sdisk CLAIMED DEVICE HP Virtual Disk
/dev/dsk/c0t2d0 /dev/dsk/c0t2d0s2 /dev/rdsk/c0t2d0 /dev/rdsk/c0t2d0s2
/dev/dsk/c0t2d0s1 /dev/dsk/c0t2d0s3 /dev/rdsk/c0t2d0s1 /dev/rdsk/c0t2d0s3

 

Here's what lvm expects to see

 

bash-4.0# strings /etc/lvmtab
/dev/vg00
/dev/disk/disk3_p2
/dev/vg01
/dev/dsk/c0t2d0
/dev/dsk/c0t3d0

 

Here's what happens if I try to activate the volume group

 

bash-4.0# vgchange -a y vg01
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c0t2d0":
The path of the physical volume refers to a device that does not
exist, or is not configured into the kernel.
vgchange: The path of the physical volume refers to a device that does not
exist, or is not configured into the kernel.
vgchange: Couldn't activate volume group "vg01":
Quorum not present, or some physical volume(s) are missing.

vgchange: Warning: couldn't query physical volume "/dev/dsk/c0t2d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query physical volume "/dev/dsk/c0t3d0":
The volume group is not activated
vgchange: Warning: couldn't query all of the physical volumes.

 

 

I've tried moving lvmtab out of the way and re-running vgscan -a in the hope that it recreates /etc/lvmtab to the new disk arrangement but no good

 

Any pointers would be appreciated

 

Regards

Paul

10 REPLIES
Ralf Seefeldt
Valued Contributor

Re: disks moved to different host without vgexporting first

Hi,

 

you could rename /etc/lvmtab and than rum vgscan.

 

Do you already have the devicefiles for the disks? (#ioscan -funCdisk)

 

I hope, this helps.

paul_xedos
Frequent Advisor

Re: disks moved to different host without vgexporting first

Hi Ralf,
Thanks for the suggestion but I tried moving lvmtab and re-running vgscan. Device files exist for the disks ( c0t1d0 and c0t2d0)
Cheers
Paul
Patrick Wallek
Honored Contributor
Solution

Re: disks moved to different host without vgexporting first

What you probably need to do is to go ahead and export VG01 to get rid of it.  The recreate the /dev/vg01 directory and group file and use vgimport to import the disks necessary.

 

For example:

 

# vgexport /dev/vg01

# mkdir /dev/vg01

# mknod /dev/vg01/group c 64 0x010000

# vgimport /dev/vg01 /dev/dsk/c?t?d? /dev/dsk/c?t?d?

# vgchange -a y /dev/vg01

 

Make sure you use the /dev/dsk files as appropriate for the VG.

paul_xedos
Frequent Advisor

Re: disks moved to different host without vgexporting first

Hi Patrick,

Superb - thanks very much for the reply.

 

Can I just check - do I need to flip the disks back to the original box or is it safe to do these commands on the box where they have now been imported?

 

Thanks

Paul

Patrick Wallek
Honored Contributor

Re: disks moved to different host without vgexporting first

You can do this on the server that the disks now reside in.

Steven E. Protter
Exalted Contributor

Re: disks moved to different host without vgexporting first

Shalom,

 

No its not a game ending issue. You just don't have a map file with which to import the disks to the new host.

 

If you have an old SysInfo report or other documenation you can still manually import the disks to the new host.

 

We are only talking about 4 disks or so here.

 

vgimport with no -m mapfile directive and indicating the name of the volume group and the physical volumes to be imported should work. There may be some trial and error involved.

 

Note that customized naming of logical volumes in the old vg01 volume group will be lost. If for example you had a logical volume named shmuelbagel it will be imported as lvol0 if its the first logcal volume you import.

 

http://nixdoc.net/man-pages/hp-ux/man1/vgimport.1m.html

Specifically

 

vgimport -v /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c0t3d0
Regards,

SEP


Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
paul_xedos
Frequent Advisor

Re: disks moved to different host without vgexporting first

Thanks for the help with this one. Things have progressed. I'm almost there but ...

 

bash-4.0# vgimport /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c0t2d0
Physical Volume "/dev/dsk/c0t2d0" contains no LVM information

 

bash-4.0# vgimport /dev/vg01 /dev/dsk/c0t1d0
vgimport: Warning: Volume Group belongs to different CPU ID.
Can not determine if Volume Group is in use on another system. Continuing.
vgimport: Warning: Volume Group contains "2" PVs, "1" specified. Continuing.
vgimport: Volume group "/dev/vg01" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

 

I was wary of activating the volume group so decided to export the volume group again until I can understand what is going on
bash-4.0# vgexport /dev/vg01

paul_xedos
Frequent Advisor

Re: disks moved to different host without vgexporting first

Sorry chaps, I'll try and make this the last question

If I import with just the one disk and activate the group is this situation reversible without too much damage. ie vgchange -a n vg01 and then vgexport again. For some reason it does not allow an import of 2 disks but can handle 1 with a warning that there should be 2
Patrick Wallek
Honored Contributor

Re: disks moved to different host without vgexporting first

Both of the disks you mention have had 3 slices carved out of them.  This usually indicates that they are boot disks.

 

Typically slice 2 (s2) is the slice that contains the LVM data.  I would try:

 

# vgimport /dev/vg01 /dev/dsk/c0t1d0s2 /dev/dsk/c0t2d0s2

paul_xedos
Frequent Advisor

Re: disks moved to different host without vgexporting first

Thanks for all the help on this.

 

Nothing I tried would get the volume group with both disks to come on line so I ended up rebuilding and restoring from backups