1833810 Members
3825 Online
110063 Solutions
New Discussion

Re: stale extents

 
ViS_2
Frequent Advisor

stale extents

Hi
I have lost one disk in my 2-disk mirrored vg00.
For some reason all lvols on the surviving disk have become stale.

The question is: is any means to convert these stale extents to current ones without synchronization?
Something like this magic:
vgchange -a y -forceAllStaleExtsToBeUsedAsCurrent vg00

HP-UX B.11.23 ia64

Thanks.
16 REPLIES 16
James R. Ferguson
Acclaimed Contributor

Re: stale extents

Hi:

No, you force (at attempt at) synchronization of stale file extents by doing:

# vgsync /dev/vgNN

or:

# lvsync /dev/vgNN/lvolX

Regards!

...JRF...
Mel Burslan
Honored Contributor

Re: stale extents

unless you do not want to replace your failed disk and do a vgsync afterwards, i.e., you want to proceed with a single disk in your vg00 (strongly discouraged by any sysadmin with a sane mind), you can go ahead and lvreduce the failed disk from each lvol.

But again, you need to replace the bad disk ASAP.
________________________________
UNIX because I majored in cryptology...
ViS_2
Frequent Advisor

Re: stale extents

James R. Ferguson
I cant do vg/lvsync. the second disk IS dead.
James R. Ferguson
Acclaimed Contributor

Re: stale extents

Hi (again):

> I cant do vg/lvsync. the second disk IS dead.

Then you must replace it! See:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

...for the correct procedure!

Regards!

...JRF...
ViS_2
Frequent Advisor

Re: stale extents

Mel Burslan
And after reduction of number of mirror copies for some lvol will all the stale extents become the current ones?
Jozef_Novak
Respected Contributor

Re: stale extents

Hello,

are you saying that you now have two disks, both with stale extents ?

J.
ViS_2
Frequent Advisor

Re: stale extents

James R. Ferguson

> Then you must replace it!
From where can i sync data to the new disk?
The surviving disk contains the stale extents only. As pvdisplay displays it for me.


ViS_2
Frequent Advisor

Re: stale extents

Jozef_Novak
No.
I have:
* one disk is unavailable for LVM. dd says that it is not possible to open the device file.
* the remaining disk contains the stale extents only.
ViS_2
Frequent Advisor

Re: stale extents

And all that i wish is to fly up on the stale extents.))
Mel Burslan
Honored Contributor

Re: stale extents

Considering this server you have is a relatively decent one, which allows hot swapping of the disk drives, you will find the bad disk (by looking at the h/w address and server documents) and replace it with a good one first

then you will run

vgcfgrestore -n vg00 /dev/rdsk/cXtXdX

where cXtXdX is the driver for the failed disk drive

then you will run

vgchange -a y vg00

then

vgsync vg00

(this most probably will take more than 30 minutes or even longer if you have a large disk drive or an older server)

Then your stale extents will all be current, provided your mirroring was done correctly.

Other than this, if you remove the failed mirror disk from each lvol as follows

lvreduce -m 0 /dev/dsk/cXtXdX

the lvdisplay -v output will only list 1 disk drive and provided there is no bad sectors on this disk drive, everything will be current. But I strongly discourage you from doing this as you are jeopardizing your operating system by doing it.
________________________________
UNIX because I majored in cryptology...
ViS_2
Frequent Advisor

Re: stale extents

Mel Burslan.
I still do not understand how vgsync will be able to synchronize the new STALE extents (on the replacing disk) from the old STALE extents (on the remaining disk).
Is it possible at all?
And even if it is possible, will all extents become current after that operation?

sorry for my english.
Mel Burslan
Honored Contributor

Re: stale extents

Okay,

after you replace the bad disk drive

vgcfgrestore command will restore the disk headers (for the lack of a better term)

vgchange command will make the new disk active in the volume group

vgsync command basically copies the data from the current disk to the newly installed and blank disk, block-by-block.

Once both disks are identical in content then they you see them as current.

Hope this helps you understand the operation.
________________________________
UNIX because I majored in cryptology...
ViS_2
Frequent Advisor

Re: stale extents

Mel Burslan.

>vgsync command basically copies the data from the current disk to the newly installed and blank disk, block-by-block.

No CURRENT disks in the server.
The remaining disk is STALE TOTALLY.
Mel Burslan
Honored Contributor

Re: stale extents

vgdisplay -v vg00

at the bottom, you should see a block with header, which says Physical Volumes.

How many physical volumes do you see there and what is the PV status say for each of them. If there are two volumes and one says PV status available and the other is not available, then the one that says available has the data. If both say unavilable (or not available) then you have bigger problems than a mirror going bad and you need to be looking for ignite tapes for this server for a possible OS rebuild. But if one of the disks is available, my suggestion above will work perfectly fine.

For a better understanding of your situation, it would help if you cut and paste all of the output of

vgdisplay -v vg00

command. This will help us see where you are at.
________________________________
UNIX because I majored in cryptology...
ViS_2
Frequent Advisor

Re: stale extents

Hi!
As a trouble server is far from me and I can not execute any commands on its console, I've made up a test configuration to emulate the problem on the real server.

So here is it:
# uname -srm
HP-UX B.11.23 ia64
# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c3t2d0s2
/dev/vg.test
/dev/dsk/c4t0d0s2
/dev/dsk/c5t0d0s2
# ioscan -fnkCdisk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GMAS3735NC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
/dev/dsk/c2t0d0s1 /dev/rdsk/c2t0d0s1
/dev/dsk/c2t0d0s2 /dev/rdsk/c2t0d0s2
/dev/dsk/c2t0d0s3 /dev/rdsk/c2t0d0s3
disk 2 0/1/1/1.2.0 sdisk CLAIMED DEVICE HP 73.4GMAS3735NC
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
/dev/dsk/c3t2d0s1 /dev/rdsk/c3t2d0s1
/dev/dsk/c3t2d0s2 /dev/rdsk/c3t2d0s2
/dev/dsk/c3t2d0s3 /dev/rdsk/c3t2d0s3
disk 3 0/3/1/0.0.0 sdisk CLAIMED DEVICE COMPAQ BF03689BC3
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
/dev/dsk/c4t0d0s1 /dev/rdsk/c4t0d0s1
/dev/dsk/c4t0d0s2 /dev/rdsk/c4t0d0s2
disk 4 0/3/1/0.1.0 sdisk CLAIMED DEVICE COMPAQ BF03689BC3
/dev/dsk/c4t1d0 /dev/rdsk/c4t1d0
disk 6 0/3/1/1.1.0 sdisk CLAIMED DEVICE COMPAQ BF03689BC3
/dev/dsk/c5t1d0 /dev/rdsk/c5t1d0
/dev/dsk/c5t1d0s1 /dev/rdsk/c5t1d0s1
/dev/dsk/c5t1d0s2 /dev/rdsk/c5t1d0s2
#

As you can see there is no c5t0d0 at all (rmsf -a /dev/dsk/c5t0d0 - to simulate the IO error for that disk)

# vgdisplay -v vg.test
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c5t0d0s2":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
--- Volume groups ---
VG Name /dev/vg.test
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 2
Act PV 1
Max PE per PV 8619
VGDA 2
PE Size (Mbytes) 4
Total PE 8617
Alloc PE 10
Free PE 8607
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c5t0d0s2":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
--- Logical volumes ---
LV Name /dev/vg.test/lvol1
LV Status available/stale
LV Size (Mbytes) 40
Current LE 10
Allocated PE 20
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c4t0d0s2
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c5t0d0s2":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
PV Status available
Total PE 8617
Free PE 8607
Autoswitch On
Proactive Polling On

# lvdisplay -v /dev/vg.test/lvol1
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c5t0d0s2":
The specified path does not correspond to physical volume attached to
this volume group
lvdisplay: Warning: couldn't query all of the physical volumes.
--- Logical volumes ---
LV Name /dev/vg.test/lvol1
VG Name /dev/vg.test
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 40
Current LE 10
Allocated PE 20
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c4t0d0s2 10 10

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t0d0s2 00000 stale ??? 00000 current
00001 /dev/dsk/c4t0d0s2 00001 stale ??? 00001 current
00002 /dev/dsk/c4t0d0s2 00002 stale ??? 00002 current
00003 /dev/dsk/c4t0d0s2 00003 stale ??? 00003 current
00004 /dev/dsk/c4t0d0s2 00004 stale ??? 00004 current
00005 /dev/dsk/c4t0d0s2 00005 stale ??? 00005 current
00006 /dev/dsk/c4t0d0s2 00006 stale ??? 00006 current
00007 /dev/dsk/c4t0d0s2 00007 stale ??? 00007 current
00008 /dev/dsk/c4t0d0s2 00008 stale ??? 00008 current
00009 /dev/dsk/c4t0d0s2 00009 stale ??? 00009 current
#

The question is the same: is any method to to invert the state "stale" of the extents to the "current" one?
Thanks.
Kris Knigga
Advisor

Re: stale extents

lvdisplay -v /dev/vg.test/lvol1
...
LV Status available/stale
...

"LV Status" shows as "available/stale" because half of your mirror is gone. Once either replace the failed disk and resync, or lvreduce the bad disk out of the LV, the stale condition will go away.


lvdisplay -v /dev/vg.test/lvol1
...
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t0d0s2 00000 stale ??? 00000 current
...

Because of the mirror, each LE has two PEs, one for each disk. The PEs for the bad disk show as stale; however, the PEs for the good disk are current.