Operating System - HP-UX
1838121 Members
3704 Online
110124 Solutions
New Discussion

Re: vgcfgrestore correct config

 
SOLVED
Go to solution
Kim Kendall
Regular Advisor

vgcfgrestore correct config

Had a disk fail, replaced it, now want to restore it to the mirror.

vg00 has (or is supposed to have) 4 drives. The /etc/lvmtab file shows 3. The /etc/lvmconf/vg00.conf shows all 4.

Q: When I do the vgcfgrestore -n /dev/vg00 /dev/rdsk/cxtxdx , will it restore from /etc/lvmconf/vg00.conf, or should I use a -f to specify it?
11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: vgcfgrestore correct config

The syntax you specify is correct.

Here's a document on how to replace a mirrored root disk.
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000065011459
James R. Ferguson
Acclaimed Contributor
Solution

Re: vgcfgrestore correct config

Hi Kim:

You don't specify '-f vg_conf_path' if/when the configuration you want is the standard one; i.e. '/etc/lvmconf/vgNN.conf'.

Rather, in that case, use:

# vgcfgrestore -n /dev/vgNN -l

...the '-l' optionally lists the configuration data, too.

Regards!

...JRF...
Kim Kendall
Regular Advisor

Re: vgcfgrestore correct config

Nevermind... just looked at vgcfgrestore -n /dev/vg00 -l
and it shows it will restore the config I am expecting.

S.K. Chan
Honored Contributor

Re: vgcfgrestore correct config

Yes it will because /etc/lvmconf is the default location. No need for the "-f" option.
Kim Kendall
Regular Advisor

Re: vgcfgrestore correct config

well - phase 2

All went well 'till vgsync

#vgcfgrestore -n /dev/vg00 /dev/rdsk/c2t0d0
Volume Group configuration has been restored to /dev/rdsk/c2t0d0

#vgchange -a y /dev/vg00
Volume group "/dev/vg00" has been successfully changed.

#vgsync /dev/vg00
Resynchronized logical volume "/dev/vg00/lvol1".
Resynchronized logical volume "/dev/vg00/lvol2".
Resynchronized logical volume "/dev/vg00/lvol3".
Resynchronized logical volume "/dev/vg00/lvol4".
vgsync: Couldn't re-synchronize stale partitions of the logical volume:
I/O error
vgsync: Couldn't resynchronize logical volume "/dev/vg00/lvol9".
vgsync: Couldn't resynchronize volume group "/dev/vg00".
Uday_S_Ankolekar
Honored Contributor

Re: vgcfgrestore correct config

Try
# vgchange -a y /dev/vg00

also let us know what vgdisplay -v /dev/vg00 give you?

-USA..
Good Luck..
Kim Kendall
Regular Advisor

Re: vgcfgrestore correct config

you can see above that I did the vgchange

You can see that the Curr and Act PV's is off

--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 4
Act PV 3
Max PE per PV 4350
VGDA 6
PE Size (Mbytes) 4
Total PE 13020
Alloc PE 11878
Free PE 1142
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 128
Current LE 32
Allocated PE 64
Used PV 2

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 1664
Current LE 416
Allocated PE 416
Used PV 1

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 168
Current LE 42
Allocated PE 84
Used PV 2

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 3072
Current LE 768
Allocated PE 768
Used PV 1

LV Name /dev/vg00/lvol9
LV Status available/stale
LV Size (Mbytes) 21548
Current LE 5387
Allocated PE 10774
Used PV 3

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 1524
Current LE 381
Allocated PE 381
Used PV 1

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 256
Allocated PE 256
Used PV 1

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 256
Allocated PE 256
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4340
Free PE 1142

PV Name /dev/dsk/c1t2d0
PV Status available
Total PE 4340
Free PE 0

PV Name /dev/dsk/c2t2d0
PV Status available
Total PE 4340
Free PE 0
Jeff Schussele
Honored Contributor

Re: vgcfgrestore correct config

Hi Kim,

Appears c2t0d0 did NOT get added to the vg00 config in /etc/lvmtab.
DO this
mv /etc/lvmtab /etc/lvmtab.old
vgscan -a -v
Then do another vgchange -a y vg00 (May need to do another vgcfgretore prior)
Then try the vgdisplay -v vg00 again. Verify the vg00 config contains all 4 drives.
Verify with
lvdisplay -v /dev/vg00/lvolX
where X = each lvol number
to check that you have strict mirror allocation ON.
This prevents mirror copies from residing on the same PV - which defeats the main purpose of mirroring - drive failure.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Kim Kendall
Regular Advisor

Re: vgcfgrestore correct config

Gets stranger...

Rebuilt the lvmtab. Did a vgcfgrestore again, then vgchange. Then looked at vgdisplay. Looks good:

#vgdisplay -v /dev/vg00 | more
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 4
Act PV 4
Max PE per PV 4350
VGDA 8
PE Size (Mbytes) 4
Total PE 17360
Alloc PE 12999
Free PE 4361
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

Then... tried to vgsync
---------------------------
#vgsync /dev/vg00
Resynchronized logical volume "/dev/vg00/lvol1".
Resynchronized logical volume "/dev/vg00/lvol2".
Resynchronized logical volume "/dev/vg00/lvol3".
Resynchronized logical volume "/dev/vg00/lvol4".
vgsync: Couldn't re-synchronize stale partitions of the logical volume:
Device offline/Powerfailed

vgsync: Couldn't resynchronize logical volume "/dev/vg00/lvol9".
vgsync: Couldn't resynchronize volume group "/dev/vg00".


Did a diskinfo on the device:
-----------------------------
#diskinfo /dev/rdsk/c2t0d0
SCSI describe of /dev/rdsk/c2t0d0:
vendor: SEAGATE
product id: ST318203LC
type: direct access
size: 17783240 Kbytes
bytes per sector: 512



I don't quite get it. ioscan sees it and is CLAIMED, diskinfo sees it fine, but vgsync thinks it's dead
S.K. Chan
Honored Contributor

Re: vgcfgrestore correct config

I noticed not all of your lvols are mirrored. LVs 2,4,6,7,8 are not mirrored. Anyway that's not the issue here. Take a look at lvol9 (which is mirrored) and resides in 3 disks.
# lvdisplay -v /dev/vg00/lvol9 | more
It should show you which disk/disks are those stale extents on. Maybe it's not on c2t0d0. The success of ioscan and diskinfo commands do not mean you won't find any stale extents.
Kim Kendall
Regular Advisor

Re: vgcfgrestore correct config


Turns out the new disk they brought out was bad, too!

Even though ioscan saw it as claimed, and diskinfo saw the device okay, it still wouldn't sync.

Got support on the line today, they had me try a new one (at least to me)...

echo 2400?20X | adb /dev/dsk/cxtxdx

That showed the bad disk.

What a relief, I'm not crazy afterall! ;)