Operating System - HP-UX
1829571 Members
2957 Online
109992 Solutions
New Discussion

Re: moving PVs between systems

 
Marc Ahrendt
Super Advisor

moving PVs between systems

i have 2 L2000s. frog is a production system and toad is a new system. frog has vg00 using all 4 internal drives with A0 mirrored to B0 and A1 to B1. how can i remove B0 (also a boot drive) and B1 from frog and use it to build toad to be an exact copy.

1) i know about Ignite ...do not want to use it for the stake of learning something here about LVM and L2000s
2) i tried the following and it did not work
a) lvreduce mirrors off of B0 and B1 on frog
b) vgreduce the 2 disks and remove the drives physically from frog ...frog online whole time
c) added new drives from toad into frog and rebuilt the mirrors on frog ...frog 100% again
d) put B0 and B1 in their correct slots on toad and booted to "hpux -lm" on B0 OK
e) could not activate vg00 ...so neve got to the point of changing netconf and building the mirrors on A0 and A1

any suggestions would be greatly appreciated

hola
9 REPLIES 9
Martin Johnson
Honored Contributor

Re: moving PVs between systems

Have you run fsck on the file systems to verify that they are ok?

HTH
Marty
Rich Wright
Trusted Contributor

Re: moving PVs between systems

Do you need -lq in addition to -lm? Are you getting a quorum error?
A. Clay Stephenson
Acclaimed Contributor

Re: moving PVs between systems

I assume that all of these are identical drives (or at least your mirror pairs are identical).

I suggest that you alter the boot string to override LVM quorum. e.g.
mkboot -a "hpux -lq (;0)/stand/vmunix /dev/rdsk/c1t6d0" using your correct raw disk device.

--------------------------------------------

Now lvreduce/vgreduce your mirrors so that only the original's remain. We are now going to make a rawdisk copy of your boot disks. This should be done while the system is rather quiescent. Because we are copying active filesystems, you will not get an absolutely clean system but the system will automatically run fsck's and your clone will be good to go. I've never had a 'lifeboat' to fail. I'm attaching a 'copy_boot.sh' script. Make sure that you set the SRC and DEST entries to match your system. The first defined SRC entry is copied to the first defined DEST entry and likewise for any addition entries.

I actually run this script on all my boxes during the weekend, in addition to mirroring.
The 'lifeboat' can protect you from two things that mirrors alone cannot: 1) really bad patches 2) your own stupidity.

------------------------------------------

Be aware that because this is a clone, you are instantly going to have duplicate IP's on your network.

All you have to do is run the copy_boot.sh script and then move the copied disks into the original boot slots on the clone machine and then boot. Again, expect the cloned box to fsck the first time you boot but subsequent boots will be perfectly normal.



If it ain't broke, I can fix that.
Marc Ahrendt
Super Advisor

Re: moving PVs between systems

i think the problem is how i am vgreducing the two disks on frog. maybe i need to vgreduce both disks at the same time instead of removing one drive at a time. just feel i can use LVM commands to make toad.

Clay, i just want to let you know that i used "dd" to make toad. your "lifeboat" approach worked fine. i knew that would work (and had to use it to get toad to my users quickly), but really wanted to try a pure LVM approach. think i am doing something wrong on frog when removing the disks that prevents me from making toad from those removed PVs.
hola
S.K. Chan
Honored Contributor

Re: moving PVs between systems

Just curious at e) when you activate it what error message did you get ? Did you try with..
# vgchange -a y -q n /dev/vg00
Have you also try recreating the LVM device file and use vgimport before activating it ?
Side note ..another technique that has worked quite well for me is manually duplicating the root disk (without using MirrorUX). You might want to try that if you have the time.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x37204b3ef09fd611abdb0090277a778c,00.html
Marc Ahrendt
Super Advisor

Re: moving PVs between systems

S.K. i went to the link u gave and that is not what i want. below is what i have done on toad and the problem i get with these two PVs that i took from frog and want to use to make toad, then mirror them to the other 2 blank drives on toad

ISL> hpux -lm -lq
unknown:[/]# vgchange -a y /dev/vg00
still cannot activate vg00
unknown:[/]# mount -p
all 7 LVs that are to be mounted appear to have been mounted ...strange
unknown:[/]# ls -al /usr/bin/vi
/usr/bin/vi not found
unknown:[/]# mount /usr
mount - Cannot open /dev/vg00/lvol7: No such device or address
unknown:[/]# mount -v
only /dev/root on /
unknown:[/]# vgchange -a y -q n /dev/vg00
still cannot activate vg00
unknown:[/]# mount -p
only /dev/root on / ...changed!?!
unknown:[/]# vgimport -p -v /dev/vg00 /dev/dsk/c1t0d0 /dev/dsk/c2t2d0
says /dev/vg00 already exists in /etc/lvmtab
unknown:[/]# ioscan -fnkC disk //OK
unknown:[/]# mv /etc/lvmtab /etc/lvmtab.last
unknown:[/]# vgscan -v
sees that c1t0d0 and c2t2d0 belong to an unknown VG
sees that c1t2d0 and c2t0d0 belong to an unknown VG
makes an empty /etc/lvmtab
unknown:[/]# vgimport -p -v /dev/vg00 /dev/dsk/c1t0d0 /dev/dsk/c2t2d0
looked like it may work
unknown:[/]# vgimport -v /dev/vg00 /dev/dsk/c1t0d0 /dev/dsk/c2t2d0
unknown:[/]# vgchange -a y -q n /dev/vg00
still cannot activate vg00
unknown:[/]# ls -al /etc/lvmconf/vg00*
/etc/lvmconf/vg00.conf had 0 bytes
/etc/lvmconf/vg00.conf.old
unknown:[/]# vgcfgrestore -f /etc/lvmconf/vg00.conf.old -l
looks good ...yet has all 4 PVs
unknown:[/]# vgcfgrestore -f /etc/lvmconf/vg00.conf.old /dev/rdsk/c1t0d0 //OK
unknown:[/]# vgcfgrestore -f /etc/lvmconf/vg00.conf.old /dev/rdsk/c2t2d0 //OK
unknown:[/]# vgchange -a y -q n /dev/vg00
activated but complained about re-synchronizing stale partitions ...OK, since no mirrors yet
NEVER could get any fsck's to work ...couldn't open the LVs even though vgdisplay works
hola
George Petrides_1
Honored Contributor

Re: moving PVs between systems

I have a feeling that you cannot use B0 and B1 on the new system cause you executed the lvreduce and vgreduce commands therefore the LVM info on the disks do not reflect the state that you are looking for (e.g. I belong to a group with another disk, I am a mirror, etc). This would work if you shutdown frog, take away the disks (without executing any LVM commands) and then use them to boot on the new server but you'll need the -q to disable the quorum. The problem however, is that frog will complain that it's missing disks and you will have to boot frog with no quorum as well. Now, I am not sure if you can reduce the VGs on frog since the drives will not be there.
Also, keep in mind that all the VG/LVM info is kept on the disks on a special area and (created with the pvcreate) command. When you execute the vgscan or vgimport command all it does is place an entry in the lvmtab file, mostly for the vgchange command, and create the /dev/vg.../lvol1,2... in order to access the volumes. Therefore, when you execute the vgscan command it does not 'see' any volume groups on the VG label of the disks since you executed the lvreduce/vgreduce command on frog that cleared the disks from any volume group.
Hope this helps.
George
George Petrides_1
Honored Contributor

Re: moving PVs between systems

What might also work on toad now, is to save the LVM config of FROG by using the vgcfgbackup command, then copy the file to TOAD and recover the LVM info by specifying a restore of A1 info to B1. Make sure that you do a vgcfgbackup on toad before you attempt this, just in case, and also check the boot info with the lvlnboot command before and after you recover the A1 info with the vgcfgrestore command. If lvlnboot shows the wrong disk, then use the same command with different options to correct the information.
George
George Petrides_1
Honored Contributor

Re: moving PVs between systems

Disclaimer... the vgcfgbackup on frog and vgcfgrestore on toad commands will only provide the wright results if mirroring was exact, e.g. lvol1 was mirrored first, lvol2 second, etc. else if the mapping of logical extends in the lvol and the Physical extends on A1 and B1 where not the same, this is not going to work.
George