Operating System - HP-UX
1836796 Members
2710 Online
110110 Solutions
New Discussion

Re: /etc/lvmtab file has wrong info. How to fix?

 
SOLVED
Go to solution
Johns Manville
Frequent Advisor

/etc/lvmtab file has wrong info. How to fix?

I was moving file systems from EVA1 to EVA2 via the mirroring process. This worked great.

However, one of the disks on the SAN was deleted while it was still attached to the volume group vg12. At least this is what I believe happened.

When I do a vgdisplay -v /dev/vg12, I get the following:

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c17t0d6":
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/vg12
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 32
Cur PV 2
Act PV 1
Max PE per PV 12800
VGDA 2
PE Size (Mbytes) 8
Total PE 127
Alloc PE 127
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c17t0d6":
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/vg12/lvol1
LV Status available/stale
LV Size (Mbytes) 1016
Current LE 127
Allocated PE 254
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c12t0d1
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c17t0d6":
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 127
Free PE 0
Autoswitch On
Proactive Polling On

I ran diskinfo and it says it can't open the disk: invalid argument.

Running "spmgr display" does not show this disk. I'm sure the disk is gone.

However, when I run "strings /etc/lvmtab," I that /dev/vg12 still lists /dev/dsk/c17t0d6.

This is on a production server, so I need to do this right the first time. How do I update/remove this missing disk? The /dev/dsk/c12t0d1 disk is currently being used and contains the data.
21 REPLIES 21
Steven E. Protter
Exalted Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Shalom,

This procedure might help.

cd /etc
mv lvmtab lvmtab.sav
vgscan -av

You may be forced to restore the old file if there are other discrpeancies.

There are vgreduce commands -l that may be of assistance. vgextend may be required to add an additional disk to the volume group.

It may be necessary to deactivate the volume group as follows for certain kinds of work.

vgchange -a n

It looks to me like before the transition there were two disks in the volume group and now there are one.

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
Fabio Ettore
Honored Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Hi,

when facing this kind of problem

Cur PV 2
Act PV 1

I do use

vgreduce -f

From man of vgreduce:

-f vg_name force reduction of missing physical volume(s) in a
given volume group. This option does not require
a physical volume (PV) to be supplied on the
command line.
[...]
option. This option is most commonly used when
the vgdisplay(1M) command shows "Cur PV" higher
than "Act PV" and all of the PVs belonging to the
volume group are attached.

Hope this helps you.

Best regards,
Fabio
WISH? IMPROVEMENT!
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

I am not able to do a vgreduce. The results are:

# vgreduce /dev/vg12 /dev/dsk/c17t0d6
vgreduce: Couldn't query physical volume "/dev/dsk/c17t0d6":
The specified path does not correspond to physical volume attached to
this volume group

I also cannot use vgreduce -f. The results are:

vgreduce -f /dev/vg12
Not all extents are free. i.e. Out of 1791 PEs, only 1664 are free.
You must free all PEs using lvreduce/lvremove before the PV can be removed.
Example: lvreduce -A n -m 0 /dev/vg01/lvol1.
lvremove -A n /dev/vg01/lvol1
Here's the map of used PEs

--- Logical extents ---
LE LV PE Status 1
0000 lvol1 0000 stale
0001 lvol1 0001 stale
0002 lvol1 0002 stale
0003 lvol1 0003 stale
0004 lvol1 0004 stale
0005 lvol1 0005 stale
0006 lvol1 0006 stale
0007 lvol1 0007 stale
0008 lvol1 0008 stale
0009 lvol1 0009 stale
0010 lvol1 0010 stale
0011 lvol1 0011 stale
0012 lvol1 0012 stale
0013 lvol1 0013 stale
0014 lvol1 0014 stale
0015 lvol1 0015 stale
0016 lvol1 0016 stale
0017 lvol1 0017 stale
0018 lvol1 0018 stale
0019 lvol1 0019 stale
0020 lvol1 0020 stale
0021 lvol1 0021 stale
0022 lvol1 0022 stale
0023 lvol1 0023 stale
0024 lvol1 0024 stale
0025 lvol1 0025 stale
0026 lvol1 0026 stale
0027 lvol1 0027 stale
0028 lvol1 0028 stale
0029 lvol1 0029 stale
0030 lvol1 0030 stale
0031 lvol1 0031 stale
0032 lvol1 0032 stale
0033 lvol1 0033 stale
0034 lvol1 0034 stale
0035 lvol1 0035 stale
0036 lvol1 0036 stale
0037 lvol1 0037 stale
0038 lvol1 0038 stale
0039 lvol1 0039 stale
0040 lvol1 0040 stale
0041 lvol1 0041 stale
0042 lvol1 0042 stale
0043 lvol1 0043 stale
0044 lvol1 0044 stale
0045 lvol1 0045 stale
0046 lvol1 0046 stale
0047 lvol1 0047 stale
0048 lvol1 0048 stale
0049 lvol1 0049 stale
0050 lvol1 0050 stale
0051 lvol1 0051 stale
0052 lvol1 0052 stale
0053 lvol1 0053 stale
0054 lvol1 0054 stale
0055 lvol1 0055 stale
0056 lvol1 0056 stale
0057 lvol1 0057 stale
0058 lvol1 0058 stale
0059 lvol1 0059 stale
0060 lvol1 0060 stale
0061 lvol1 0061 stale
0062 lvol1 0062 stale
0063 lvol1 0063 stale
0064 lvol1 0064 stale
0065 lvol1 0065 stale
0066 lvol1 0066 stale
0067 lvol1 0067 stale
0068 lvol1 0068 stale
0069 lvol1 0069 stale
0070 lvol1 0070 stale
0071 lvol1 0071 stale
0072 lvol1 0072 stale
0073 lvol1 0073 stale
0074 lvol1 0074 stale
0075 lvol1 0075 stale
0076 lvol1 0076 stale
0077 lvol1 0077 stale
0078 lvol1 0078 stale
0079 lvol1 0079 stale
0080 lvol1 0080 stale
0081 lvol1 0081 stale
0082 lvol1 0082 stale
0083 lvol1 0083 stale
0084 lvol1 0084 stale
0085 lvol1 0085 stale
0086 lvol1 0086 stale
0087 lvol1 0087 stale
0088 lvol1 0088 stale
0089 lvol1 0089 stale
0090 lvol1 0090 stale
0091 lvol1 0091 stale
0092 lvol1 0092 stale
0093 lvol1 0093 stale
0094 lvol1 0094 stale
0095 lvol1 0095 stale
0096 lvol1 0096 stale
0097 lvol1 0097 stale
0098 lvol1 0098 stale
0099 lvol1 0099 stale
0100 lvol1 0100 stale
0101 lvol1 0101 stale
0102 lvol1 0102 stale
0103 lvol1 0103 stale
0104 lvol1 0104 stale
0105 lvol1 0105 stale
0106 lvol1 0106 stale
0107 lvol1 0107 stale
0108 lvol1 0108 stale
0109 lvol1 0109 stale
0110 lvol1 0110 stale
0111 lvol1 0111 stale
0112 lvol1 0112 stale
0113 lvol1 0113 stale
0114 lvol1 0114 stale
0115 lvol1 0115 stale
0116 lvol1 0116 stale
0117 lvol1 0117 stale
0118 lvol1 0118 stale
0119 lvol1 0119 stale
0120 lvol1 0120 stale
0121 lvol1 0121 stale
0122 lvol1 0122 stale
0123 lvol1 0123 stale
0124 lvol1 0124 stale
0125 lvol1 0125 stale
0126 lvol1 0126 stale
Fabio Ettore
Honored Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Hi,

sorry, my understanding was that disk c17t0d6 was just ghost and not that lvol was onto. So have you tried to run

lvremove -A n /dev/vg01/lvol1

?

Best regards,
Fabio
WISH? IMPROVEMENT!
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

I don't want to remove the lvol. I will loose all my data. I just want the missing disk to disappear so I can add a new disk and do the mirroring.

The original disk was a c12txdx disk. The new disk (LUN) that had been added for mirroring was a c17txdx disk. This disk was removed from the SAN side, so it no longer exists. But, it's still listed in the /etc/lvmtab file, thus confusing the OS.

I need to fix that so the c17 disk is gone. Then I can add a new disk and do the mirroring.
Fabio Ettore
Honored Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Maybe there's something to clear...

vgreduce -f vg12

is trying to reduce c17t0d6 but it cannot do that because of "You must free all PEs using lvreduce/lvremove before the PV can be removed"

If there are extents of lvol1 working onto c17t0d6 you cannot remove the PV from the VG. To doublecheck on which disks lvol1 is working then run

lvdisplay -v /dev/vg12/lvol1

Best regards,
Fabio
WISH? IMPROVEMENT!
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

Yes, you are correct. But the missing disk was only a mirror, not original data. Here is a shortened version of the lvdisplay command:

--- Logical volumes ---
LV Name /dev/vg12/lvol1
VG Name /dev/vg12
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1016
Current LE 127
Allocated PE 254
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/c12t0d1 127 127

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c12t0d1 00000 current ??? 00000 stale
00001 /dev/dsk/c12t0d1 00001 current ??? 00001 stale
00002 /dev/dsk/c12t0d1 00002 current ??? 00002 stale
00003 /dev/dsk/c12t0d1 00003 current ??? 00003 stale
00004 /dev/dsk/c12t0d1 00004 current ??? 00004 stale
00005 /dev/dsk/c12t0d1 00005 current ??? 00005 stale
00006 /dev/dsk/c12t0d1 00006 current ??? 00006 stale
00007 /dev/dsk/c12t0d1 00007 current ??? 00007 stale
chris huys_4
Honored Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Hi,

Remove the stale mirror extents with the pvkey method. something like : lvdisplay -v -k /dev/..; lvremove -k /dev/.. ..

manpage of lvdisplay/lvremove should have examples.

Greetz,
Chris
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

lvremove appears to only have two switches: -A and -f.

Do you have another guess?
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

The lvreduce command "lvreduce -m 0 -k /dev/vg12/lvol1 /dev/dsk/c17t0d6" should work, but it does not.

# lvreduce -m 0 -k /dev/vg12/lvol1 /dev/dsk/c17t0d6
Physical extents on remaining physical volumes are stale or
Remaining physical volumes are not responding.
lvreduce: The LVM device driver failed to reduce mirrors on
the logical volume "/dev/vg12/lvol1".
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

BTW, this server is running HP-UX 11.11.
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

Steven,

The vgscan totally removed lvol12 from the lvmtab file, so I put the old one back.

I'm thinking of just copying the files to a new VG and delete this one. I think this might be a file system that I can do that with.
chris huys_4
Honored Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Hi,

The lvdisplay/"lvremove" advise, lvremove should have been indeed lvreduce, came from a larger "replacing a faulty disk / secure way" procedure as can be seen below.

And this procedure, indeed makes the assumption, that at the start of the procedure, both the problem disk, is still part of /etc/lvmtab and even that the "faulty" disk is somehow visible in ioscan -fn, however the disk somehow visible in ioscan -fn, is not a must, I think.

Greetz,
Chris

>>>>>>>
replacing a faulty disk / secure way

Remove all extents from the defective lvol


#lvdisplay -v /dev/vg01/lvol4 > /tmp/lvdisplay_lvol4.out

#lvdisplay -v -k /dev/vg01/lvol4



#lvreduce -m 0 -k /dev/vg01/lvol4 7


Repeat above procedure for each affected lvol

Note : The lvreduce command will also remove extents off disks that are not defective, if this disks are so "unlucky" to be at the "same

side" as the defective disk.

* Remove the failed disks from /etc/lvmtab


#vgreduce -f /dev/vg01


Note : The vgreduce doesnt always work out. If you receive a error like

"/etc/lvmtab is out of date with the running kernel" then you will have to solve

this first.


"/etc/lvmtab is out of date" error


#cp /etc/lvmtab /etc/lvmtab.orig

#vgscan -p -v

a preview vgscan to check if the missing disks are left out

OK!

#mv /etc/lvmtab /etc/lvmtab.orig

#vgscan -v

">

works OK!

#vgchange -a y /dev/vg01

#lvlnboot -R

#vgreduce -f /dev/vg01

OK!

* Reactivate the volumegroup, which included the failed disk

#vgchange -a y /dev/vg01

#vgdisplay -v /dev/vg01

Act 9

Cur 9

pulled out defective disk
[cut]
>>>>>>>
hbhua_231
Advisor
Solution

Re: /etc/lvmtab file has wrong info. How to fix?

hi, i think you made some mistake.

your command is not right, you should use PV KEY to reduce the ghost pv,not the pv name.

you should use:

lvreduce -m 0 -k /dev/vg12/lvol1 1

the last number 1 is the ghost PV key.

i have done an experiment for you.
-------------------------------------------- root@/test]#lvdisplay -v /dev/vgtest/test|more
--- Logical volumes ---
LV Name /dev/vgtest/test
VG Name /dev/vgtest
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
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/c1t0d0 500 500
/dev/dsk/c1t2d0 500 500

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
--- Logical volumes ---
LV Name /dev/vgtest/test
VG Name /dev/vgtest
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
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/c1t0d0 500 500
/dev/dsk/c1t2d0 500 500

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c1t0d0 00000 current /dev/dsk/c1t2d0 00000 stale
00001 /dev/dsk/c1t0d0 00001 current /dev/dsk/c1t2d0 00001 current
00002 /dev/dsk/c1t0d0 00002 current /dev/dsk/c1t2d0 00002 current
00003 /dev/dsk/c1t0d0 00003 current /dev/dsk/c1t2d0 00003 current
00004 /dev/dsk/c1t0d0 00004 current /dev/dsk/c1t2d0 00004 current
00005 /dev/dsk/c1t0d0 00005 current /dev/dsk/c1t2d0 00005 current
00006 /dev/dsk/c1t0d0 00006 current /dev/dsk/c1t2d0 00006 current
00007 /dev/dsk/c1t0d0 00007 current /dev/dsk/c1t2d0 00007 current
00008 /dev/dsk/c1t0d0 00008 current /dev/dsk/c1t2d0 00008 current
00009 /dev/dsk/c1t0d0 00009 current /dev/dsk/c1t2d0 00009 current
00010 /dev/dsk/c1t0d0 00010 current /dev/dsk/c1t2d0 00010 current
00011 /dev/dsk/c1t0d0 00011 current /dev/dsk/c1t2d0 00011 current
00012 /dev/dsk/c1t0d0 00012 current /dev/dsk/c1t2d0 00012 current
00013 /dev/dsk/c1t0d0 00013 current /dev/dsk/c1t2d0 00013 current
00014 /dev/dsk/c1t0d0 00014 current /dev/dsk/c1t2d0 00014 current
00015 /dev/dsk/c1t0d0 00015 current /dev/dsk/c1t2d0 00015 current
00016 /dev/dsk/c1t0d0 00016 current /dev/dsk/c1t2d0 00016 current
00017 /dev/dsk/c1t0d0 00017 current /dev/dsk/c1t2d0 00017 current
00018 /dev/dsk/c1t0d0 00018 current /dev/dsk/c1t2d0 00018 current
00019 /dev/dsk/c1t0d0 00019 current /dev/dsk/c1t2d0 00019 current
00020 /dev/dsk/c1t0d0 00020 current /dev/dsk/c1t2d0 00020 current
00021 /dev/dsk/c1t0d0 00021 current /dev/dsk/c1t2d0 00021 current
[root@/test]#lvdisplay -v -k /dev/vgtest/test|more
--- Logical volumes ---
LV Name /dev/vgtest/test
VG Name /dev/vgtest
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
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/c1t0d0 500 500
/dev/dsk/c1t2d0 500 500

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 0 00000 current 1 00000 stale
00001 0 00001 current 1 00001 current
00002 0 00002 current 1 00002 current
00003 0 00003 current 1 00003 current
00004 0 00004 current 1 00004 current
00005 0 00005 current 1 00005 current
00006 0 00006 current 1 00006 current
00007 0 00007 current 1 00007 current
00008 0 00008 current 1 00008 current
00009 0 00009 current 1 00009 current
00010 0 00010 current 1 00010 current
00011 0 00011 current 1 00011 current
00012 0 00012 current 1 00012 current
00013 0 00013 current 1 00013 current
00014 0 00014 current 1 00014 current
00015 0 00015 current 1 00015 current
00016 0 00016 current 1 00016 current
00017 0 00017 current 1 00017 current
00018 0 00018 current 1 00018 current
00019 0 00019 current 1 00019 current
00020 0 00020 current 1 00020 current
00021 0 00021 current 1 00021 current
[root@/test]#
[root@/test]#lvreduce -k -m 0 /dev/vgtest/test /dev/dsk/c1t2d0
Physical extents on remaining physical volumes are stale or
Remaining physical volumes are not responding.
lvreduce: The LVM device driver failed to reduce mirrors on
the logical volume "/dev/vgtest/test".
[root@/test]#lvreduce -k -m 0 /dev/vgtest/test 1
Logical volume "/dev/vgtest/test" has been successfully reduced.
vgcfgbackup: Invalid LVMREC on Physical Volume /dev/rdsk/c1t2d0
[root@/test]#
[root@/test]#
[root@/test]#vgdisplay -v /dev/vgtest|more
--- Volume groups ---
VG Name /dev/vgtest
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 2
Max PE per PV 4341
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 500
Free PE 8180
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgtest/test
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 500
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4340
Free PE 3840
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c1t2d0
PV Status unavailable
Total PE 4340
Free PE 4340
Autoswitch On
Proactive Polling On



[root@/test]#vgreduce -f /dev/vgtest
[root@/test]#vgdisplay -v /dev/vgtest|more
--- Volume groups ---
VG Name /dev/vgtest
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 2
Max PE per PV 4341
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 500
Free PE 8180
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgtest/test
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 500
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4340
Free PE 3840
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c1t2d0
PV Status unavailable
Total PE 4340
Free PE 4340
Autoswitch On
Proactive Polling On



[root@/test]#
[root@/test]#vgreduce /dev/vgtest /dev/dsk/c1t2d0
Volume group "/dev/vgtest" has been successfully reduced.
Volume Group configuration for /dev/vgtest has been saved in /etc/lvmconf/vgtest.conf
[root@/test]#
[root@/test]#
[root@/test]#vgdisplay -v /dev/vgtest|more
--- Volume groups ---
VG Name /dev/vgtest
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4341
VGDA 2
PE Size (Mbytes) 4
Total PE 4340
Alloc PE 500
Free PE 3840
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgtest/test
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 500
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4340
Free PE 3840
Autoswitch On
Proactive Polling On
Vijaykumar_1
Valued Contributor

Re: /etc/lvmtab file has wrong info. How to fix?

Hello Johns,

I guess SEP's update was perfect.

You have to reduce the PV from the LV and then from the VG. The VG reduce command will update the /etc/lvmtab. It seems that in this case its failing..

So you can follow the below steps..

#cp /etc/lvmtab /etc/lvmtab.date
#rm /etc/lvmtab
#vgscan -v
#vgchange -a y /dev/vg12

Now check the /etc/lvmtab file, the other disk should have vanished.

If this doesn't solve, have a check on the /etc/lvmconf/vg12.conf file..

Hope this helps,pls update if the issue still exists..
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

The command: lvreduce -m 0 -k /dev/vg12/lvol1 1
did remove the stale extents.

However, the VG is still screwy. vgdisplay still says it can't query physical volume "/dev/dsk/c17t0d6" when that disk doesn't exist.

An ioscan of the disk that does exist, also shows fautly info with a disk that doesn't exisdt, i.e. c13t0d1. Here is the output:

disk 4 255/255/1/0.1 sdisk CLAIMED DEVICE HSV110 (C)COMPAQ
/dev/dsk/c12t0d1 /dev/rdsk/c12t0d1 /dev/rdsk/c13t0d1

Note, the above c13 disk does not exist.

Also, the /etc/lvmtab STILL shows /dev/dsk/c17t0d6 as part of the VG vg12.

If I look in the /etc/lvmconf/vg12.conf file, I still see the /dev/rdsk/c17t0d6 disk.
hbhua_231
Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

Hi,Johns Manville

try command:

vgreduce -l /dev/vg12 /dev/dsk/c17t0d6

the "l" is not number 1 but letter "l"

this command will remove ghost pv in /etc/lvmtab,and resolve problem.
after remove the ghost pv,please do
vgcfgbackup /dev/vg12 to backup vg12 structure

Good luck.


Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

hbhua_231,

You're doing pretty good so far. :-)

When I try the vgcfgbackup, I get the following because the kernel thinks there are still 2 disks:

vgcfgbackup /dev/vg12
vgcfgbackup: /etc/lvmtab is out of date with the running kernel:Kernel indicates 2 disks for "/dev/vg12"; /etc/lvmtab has 1 disks.
Cannot proceed with backup.
hbhua_231
Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

hi, Johns Manville.

I think there still have some problem.

plese post the output.

vgdisplay -v /dev/vg12

lvdisplay -v /dev/vg12/lvol1|more

strings /etc/lvmtab

i need more infomation to resolve the problem.
Johns Manville
Frequent Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

Here you go. Thanks.

# vgdisplay -v /dev/vg12
--- Volume groups ---
VG Name /dev/vg12
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 32
Cur PV 2
Act PV 1
Max PE per PV 12800
VGDA 2
PE Size (Mbytes) 8
Total PE 127
Alloc PE 127
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg12/lvol1
LV Status available/syncd
LV Size (Mbytes) 1016
Current LE 127
Allocated PE 127
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c17t0d5
PV Status available
Total PE 127
Free PE 0
Autoswitch On
Proactive Polling On

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

# lvdisplay -v /dev/vg12/lvol1
--- Logical volumes ---
LV Name /dev/vg12/lvol1
VG Name /dev/vg12
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1016
Current LE 127
Allocated PE 127
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/c17t0d5 127 127

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c17t0d5 00000 current
00001 /dev/dsk/c17t0d5 00001 current
00002 /dev/dsk/c17t0d5 00002 current
00003 /dev/dsk/c17t0d5 00003 current
00004 /dev/dsk/c17t0d5 00004 current
00005 /dev/dsk/c17t0d5 00005 current
00006 /dev/dsk/c17t0d5 00006 current
00007 /dev/dsk/c17t0d5 00007 current . . .

---------

:# strings /etc/lvmtab
/dev/vg00
ST5DE
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0
/dev/vg12
hD|e
/dev/dsk/c17t0d5
/dev/vg11
/dev/dsk/c17t1d4
/dev/vg06
/dev/dsk/c17t0d1
/dev/vg07
/dev/dsk/c17t1d1
/dev/dsk/c17t1d3
/dev/dsk/c17t0d2
/dev/dsk/c17t1d2
/dev/dsk/c17t1d0
/dev/vg08
hBtZ
/dev/dsk/c17t0d3
/dev/vg05
ST5D
/dev/dsk/c17t0d0
/dev/vg13
ST5E58
/dev/dsk/c17t0d7
/dev/vg09
ST5J
/dev/dsk/c17t0d4

-----------

This is the one to check:

# strings vg12.conf
CONFIG01
/dev/vg12
/dev/rdsk/c12t0d1
/dev/rdsk/c17t0d6
LVMREC01E
hD|e7E
hD|e
LVMREC01
ST5L
hD|e
hD|e
hD|e7
ST5L
VGDA0001
k>c<
VGSA0001L
hbhua_231
Advisor

Re: /etc/lvmtab file has wrong info. How to fix?

hi, Johns Manville.

i find a way to resolve your problem which

i had met many days ago.

1) vgrecuce -f vg12

to reduce ghost pv

2)vgcfgbackup /dev/vg12

if /etc/lvmtab file is ok, i think no need
to do the command vgscan.

hope this could help you.

By the way,this command is no harm to your
product server.

--------------------------------------------
oot@L2000:/etc/lvmconf#lvreduce -k -m 0 /dev/vg00/mirror 1
Logical volume "/dev/vg00/mirror" has been successfully reduced.
vgcfgbackup: /etc/lvmtab is out of date with the running kernel:Kernel indicates 2 disks for "/dev/vg00"; /etc/lvmtab has 1 disks.
Cannot proceed with backup.
root@L2000:/etc/lvmconf#lvdisplay /dev/vg00/mirror
--- Logical volumes ---
LV Name /dev/vg00/mirror
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 160
Current LE 10
Allocated PE 10
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

root@L2000:/etc/lvmconf#vgreduce -f vg00
PV with key 1 sucessfully deleted from vg vg00
Repair done, please do the following steps.....:
1. save /etc/lvmtab to another file
2. remove /etc/lvmtab
3. use vgscan(1m) -v to re-create /etc/lvmtab
4. NOW use vgcfgbackup(1m) to save the LVM setup
root@L2000:/etc/lvmconf#
root@L2000:/etc/lvmconf#vgcfgbackup vg00
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf