Operating System - HP-UX
1836426 Members
3855 Online
110100 Solutions
New Discussion

Re: how to put this disk back to vg00?

 
Hanry Zhou
Super Advisor

how to put this disk back to vg00?

I have a disk in vg00, and was a mirror to another disk in the same vg00. I did "lvreduce -m 0 /dev/vg00/lvolX pv_disk", and vgreduce /dev/vg00 pv_disk.

Now I want to put the disk back, recover everything on the disk, including every one of logical volume. How do I do that?

I can use vgextend to inlcude the disk in vg00 now, but when I do lvextend -m 1 ...
it is show me stale pe...
none
8 REPLIES 8
Geoff Wild
Honored Contributor

Re: how to put this disk back to vg00?

Steps would be:

pvcreate pv_disk
vgextend /dev/vg00 pv_disk
lvextend -m 1 /dev/vg00/lvolx pv_disk

You might have to vgsync

vgsync /dev/vg00

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
James R. Ferguson
Acclaimed Contributor

Re: how to put this disk back to vg00?

Hi Hanry:

Mirror synchronization takes some time. If all is proceeding well, doing:

# lvdisplay -v /dev/vg00/lvol7|grep -c stale

...for example, should show a decreasing count of stale extents.

Remember that LVM mirroring occurs at the *logical volume* level, not at the volume group nor at the physical disk level.

Regards!

...JRF...
Calandrello
Trusted Contributor

Re: how to put this disk back to vg00?

friend
he follows the procedure to come back to synchronize lvols of vg00 lvextem - m 1 /dev/vg00/lvxx (to execute in all lvols of vg00) to verify if this ok with the command lvdisplay - v /dev/vg00/lvolxx in case that some PE with status of stale exists to execute the command lvsync /dev/vg00/lvolxxx
Yang Qin_1
Honored Contributor

Re: how to put this disk back to vg00?

If you want "this disk" is bootable you have to:
1. pvcreate -B -f /dev/rdsk/c#t#d#
2. vgextend vg00 /dev/dsk/c#t#d#
3. mkboot /dev/rdsk/c#t#d#
4. mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c#t#d#
5. for lv in /dev/vg00/lvol*
do
lvextend -m 1 $lv /dev/dsk/c#t#d#
done
6. lvlnboot -v
7. setboot -a

Yang
Hanry Zhou
Super Advisor

Re: how to put this disk back to vg00?

I have to say most of you did not answer my question. Sorry, I did not make myself clearly.

I am not asking how to configure the disk in vg00, and make the mirror. The disk used to be one of the mirror in vg00, and I did lvreduce -m 0..., and vgreduce, therefore, the disk was taken out. Now, I want to add the disk back in vg00 as it was before.

Without going through all normal steps, is there any simple way to recover everything as the way is was before?
none
Ivan Krastev
Honored Contributor

Re: how to put this disk back to vg00?

Hi Hanry,

after removing disk from vg00 and break mirror you cannot put it back without following the normal procedure for creating mirrors on vg00 - it taka aprox 30-40 min (depend on data).


regards,
ivan
James R. Ferguson
Acclaimed Contributor

Re: how to put this disk back to vg00?

Hi Hanry:

So, you reduced the mirrors for logical volumes residing on a particular physical volume of a volume group. Then, you 'vgreduce'd the disk from the volume group. Good.

Now, to put everything back the way it was, you must 'vgextend' the volume group and 'lvextend -m 1' every logical volume that you want mirrored to the physical disk. There is no short-cut.

Regards!

...JRF...
Yang Qin_1
Honored Contributor

Re: how to put this disk back to vg00?

As you have run a vgreduce /dev/vg00 pv_disk. I don't think you still have a chance to run "vgcfgrestore" -- I think "vgcfgrestore" is what you are looking for.

run "vgcfgrestore -n /dev/vg00 -l" if you could find your old pv_disk there, or you could find a "/etc/lvmconf/vg00.conf.old" which contain old pv_dsk info, then you can run
man vgcfgrestore
vgcfgrestore -n /dev/vg00 /dev/rdsk/c#t#d#

Yang