免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5149 | 回复: 8
打印 上一主题 下一主题

奇怪的LVM ghost 问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-03 10:33 |只看该作者 |倒序浏览
最近遇到个奇怪的LVM ghost问题,vgreduce -f 后出现的LV显示为“. ”,非常奇怪,问题如下,欢迎大家讨论:
swt3[/]#strings /etc/lvmtab
/dev/vg00
/dev/disk/disk3_p2
swt3[/]#vgcfgbackup vg00
vgcfgbackup: /etc/lvmtab is out of date with the running kernel:Kernel indicate.
Cannot proceed with backup.
swt3[/]#vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write     
VG Status                   available                 
Max LV                      255   
Cur LV                      9      
Open LV                     8      
Max PV                      16     
Cur PV                      3      
Act PV                      1      
Max PE per PV               4384         
VGDA                        2   
PE Size (Mbytes)            16              
Total PE                    4312   
Alloc PE                    2376   
Free PE                     1936   
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)            1792            
   Current LE                  112      
   Allocated PE                112         
   Used PV                     1      

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

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd           
   LV Size (Mbytes)            2032            
   Current LE                  127      
   Allocated PE                127         
   Used PV                     1      

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

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd           
   LV Size (Mbytes)            10240           
   Current LE                  640      
   Allocated PE                640         
   Used PV                     1      

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

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

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


   --- Physical volumes ---
   PV Name                     /dev/disk/disk3_p2
   PV Status                   available               
   Total PE                    4312   
   Free PE                     1936   
   Autoswitch                  On        


swt3[/]#vgreduce -f vg00
Not all extents are free. i.e. Out of 4319 PEs, only 3999 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    .               2376     stale  
         0001    .               2377     stale  
         0002    .               2378     stale  
         0003    .               2379     stale  
         0004    .               2380     stale  
         0005    .               2381     stale  
         0006    .               2382     stale  
         0007    .               2383     stale  
         0008    .               2384     stale  
         0009    .               2385     stale  
         0010    .               2386     stale  
         0011    .               2387     stale  
         0012    .               2388     stale  
         0013    .               2389     stale  
         0014    .               2390     stale  
         0015    .               2391     stale  
         0016    .               2392     stale  
         0017    .               2393     stale  
         0018    .               2394     stale  
         0019    .               2395     stale  
         0020    .               2396     stale  
         0021    .               2397     stale  
         0022    .               2398     stale  
         0023    .               2399     stale  
         0024    .               2400     stale  
         0025    .               2401     stale  
         0026    .               2402     stale  
         0027    .               2403     stale  
         0028    .               2404     stale  
         0029    .               2405     stale  
         0030    .               2406     stale  
         0031    .               2407     stale  
         0032    .               2408     stale  
         0033    .               2409     stale  
         0034    .               2410     stale  
         0035    .               2411     stale  
         0036    .               2412     stale  
         0037    .               2413     stale  
         0038    .               2414     stale  
         0039    .               2415     stale  
         0040    .               2416     stale  
         0041    .               2417     stale  
         0042    .               2418     stale  
         0043    .               2419     stale  
         0044    .               2420     stale  
         0045    .               2421     stale  
         0046    .               2422     stale  
         0047    .               2423     stale  
         0048    .               2424     stale  
         0049    .               2425     stale  
         0050    .               2426     stale  
         0051    .               2427     stale  
         0052    .               2428     stale  
         0053    .               2429     stale  
         0054    .               2430     stale  
         0055    .               2431     stale  
         0056    .               2432     stale  
         0057    .               2433     stale  
         0058    .               2434     stale  
         0059    .               2435     stale  
         0060    .               2436     stale  
         0061    .               2437     stale  
         0062    .               2438     stale  
         0063    .               2439     stale  
         0064    .               2440     stale  
         0065    .               2441     stale  
         0066    .               2442     stale  
         0067    .               2443     stale  
         0068    .               2444     stale  
         0069    .               2445     stale  
         0070    .               2446     stale  
         0071    .               2447     stale  
         0072    .               2448     stale  
         0073    .               2449     stale  
         0074    .               2450     stale  
         0075    .               2451     stale  
         0076    .               2452     stale  
         0077    .               2453     stale  
         0078    .               2454     stale  
         0079    .               2455     stale  
         0080    .               2456     stale  
         0081    .               2457     stale  
         0082    .               2458     stale  
         0083    .               2459     stale  
         0084    .               2460     stale  
         0085    .               2461     stale  
         0086    .               2462     stale  
         0087    .               2463     stale  
         0088    .               2464     stale  
         0089    .               2465     stale  
         0090    .               2466     stale  
         0091    .               2467     stale  
         0092    .               2468     stale  
         0093    .               2469     stale  
         0094    .               2470     stale  
         0095    .               2471     stale  
         0096    .               2472     stale  
         0097    .               2473     stale  
         0098    .               2474     stale  
         0099    .               2475     stale  
         0100    .               2476     stale  
         中间省略.....
         0319    .               2695     stale  
swt3[/]#cd /etc/
swt3[/etc]#strings /etc/lvmtab.backup
/dev/vg00
/dev/disk/disk3_p2
swt3[/etc]#mv lvmtab lvmtab.backup
swt3[/etc]#vgscan -av
Creating "/etc/lvmtab".
Couldn't stat physical volume "/dev/dsk/c0t0d0":
Invalid argument

vgscan:  has no corresponding valid raw device file under /dev/rdsk.
Verification of unique LVM disk id on each disk in the volume group
/dev/vg00 failed.

Scan of Physical Volumes Complete.
*** LVMTAB has been created successfully.
*** Do the following to resync the information on the disk.
*** #1.  vgchange -a y
*** #2.  lvlnboot -R
swt3[/etc]#cd /dev/rdsk/  
swt3[/dev/rdsk]#ls
c0t0d0    c2t1d0s1  c2t1d0s3  c3t2d0s1  c3t2d0s3
c2t1d0    c2t1d0s2  c3t2d0    c3t2d0s2  vg00.map
swt3[/dev/rdsk]#rm *
swt3[/dev/rdsk]#ls
swt3[/dev/rdsk]#insf -e
insf: Installing special files for sdisk instance 2 address 0/0/2/0.0.0.0
insf: Installing special files for sdisk instance 0 address 0/1/1/0.1.0
insf: Installing special files for sdisk instance 1 address 0/1/1/1.2.0
insf: Installing special files for asio0 instance 0 address 0/6/1/0
insf: Installing special files for asio0 instance 1 address 0/6/1/1
insf: Installing special files for ipmi instance 0 address 250/0
insf: Installing special files for asio0 instance 2 address 250/1
insf: Installing special files for asio0 instance 3 address 250/2
insf: Installing special files for side instance 0 address 0/0/2/0.0
insf: Installing special files for side instance 1 address 0/0/2/0.1
insf: Installing special files for mpt instance 2 address 0/1/1/0
insf: Installing special files for mpt instance 3 address 0/1/1/1
insf: Installing special files for td instance 0 address 0/3/1/0
insf: Installing special files for esdisk instance 3 address 64000/0xfa00/0x0
insf: Installing special files for esdisk instance 4 address 64000/0xfa00/0x1
insf: Installing special files for esdisk instance 5 address 64000/0xfa00/0x2
insf: Installing special files for pseudo driver cn
insf: Installing special files for pseudo driver mm
insf: Installing special files for pseudo driver arp
insf: Installing special files for pseudo driver ptym
insf: Installing special files for pseudo driver ptys
insf: Installing special files for pseudo driver devkrs
insf: Installing special files for pseudo driver dmem
insf: Installing special files for pseudo driver ip
insf: Installing special files for pseudo driver nuls
insf: Installing special files for pseudo driver rawip
insf: Installing special files for pseudo driver dev_config
insf: Installing special files for pseudo driver strlog
insf: Installing special files for pseudo driver sad
insf: Installing special files for pseudo driver stcpmap
insf: Installing special files for pseudo driver tcp
insf: Installing special files for pseudo driver telm
insf: Installing special files for pseudo driver asyncdsk
insf: Installing special files for pseudo driver tels
insf: Installing special files for pseudo driver tlclts
insf: Installing special files for pseudo driver tlcots
insf: Installing special files for pseudo driver tlcotsod
insf: Installing special files for pseudo driver echo
insf: Installing special files for pseudo driver udp
insf: Installing special files for pseudo driver dlpi
insf: Installing special files for pseudo driver vols
insf: Installing special files for pseudo driver dmp
insf: Installing special files for pseudo driver ptm
insf: Installing special files for pseudo driver pts
insf: Installing special files for pseudo driver beep
insf: Installing special files for pseudo driver framebuf
insf: Installing special files for pseudo driver klog
insf: Installing special files for pseudo driver sy
insf: Installing special files for pseudo driver kepd
insf: Installing special files for pseudo driver diag2
insf: Installing special files for pseudo driver root
insf: Installing special files for pseudo driver escsi
swt3[/dev/rdsk]#ls
c0t0d0    c2t1d0s1  c2t1d0s3  c3t2d0s1  c3t2d0s3
c2t1d0    c2t1d0s2  c3t2d0    c3t2d0s2
swt3[/dev/rdsk]#vgscan -av
Couldn't stat physical volume "/dev/dsk/c0t0d0":
Invalid argument

vgscan:  has no corresponding valid raw device file under /dev/rdsk.
Verification of unique LVM disk id on each disk in the volume group
/dev/vg00 failed.

Scan of Physical Volumes Complete.
swt3[/dev/rdsk]#strings /etc/lvmtab
swt3[/dev/rdsk]#cd /etc/
swt3[/etc]#mv lvmtab.backup  lvmtab
swt3[/etc]#strings /etc/lvmtab
/dev/vg00
/dev/disk/disk3_p2
swt3[/etc]#ioscan -m lun
Class     I  Lun H/W Path  Driver  S/W State   H/W Type     Health  Description
======================================================================
disk      3  64000/0xfa00/0x0   esdisk  CLAIMED     DEVICE       online  HP 73.
             0/1/1/0.0x1.0x0
                      /dev/disk/disk3      /dev/rdisk/disk3   
                      /dev/disk/disk3_p1   /dev/rdisk/disk3_p1
                      /dev/disk/disk3_p2   /dev/rdisk/disk3_p2
                      /dev/disk/disk3_p3   /dev/rdisk/disk3_p3
disk      4  64000/0xfa00/0x1   esdisk  CLAIMED     DEVICE       online  HP 73.
             0/1/1/1.0x2.0x0
                      /dev/disk/disk4      /dev/rdisk/disk4   
                      /dev/disk/disk4_p1   /dev/rdisk/disk4_p1
                      /dev/disk/disk4_p2   /dev/rdisk/disk4_p2
                      /dev/disk/disk4_p3   /dev/rdisk/disk4_p3
disk      5  64000/0xfa00/0x2   esdisk  CLAIMED     DEVICE       online  TEAC   
             0/0/2/0.0.0x0.0x0
                      /dev/disk/disk5   /dev/rdisk/disk5
swt3[/etc]#ll /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Jan  8 17:29 /dev/vg00/group
swt3[/etc]#ioscan -m dsf
Persistent DSF           Legacy DSF(s)
========================================
/dev/rdisk/disk3         /dev/rdsk/c2t1d0
/dev/rdisk/disk3_p1      /dev/rdsk/c2t1d0s1
/dev/rdisk/disk3_p2      /dev/rdsk/c2t1d0s2
/dev/rdisk/disk3_p3      /dev/rdsk/c2t1d0s3
/dev/rdisk/disk4         /dev/rdsk/c3t2d0
/dev/rdisk/disk4_p1      /dev/rdsk/c3t2d0s1
/dev/rdisk/disk4_p2      /dev/rdsk/c3t2d0s2
/dev/rdisk/disk4_p3      /dev/rdsk/c3t2d0s3
/dev/rdisk/disk5         /dev/rdsk/c0t0d0
swt3[/etc]#lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/disk/disk3_p2 -- Boot Disk
Boot: lvol1     on:     /dev/disk/disk3_p2
Root: lvol3     on:     /dev/disk/disk3_p2
Swap: lvol2     on:     /dev/disk/disk3_p2
Dump: lvol2     on:     /dev/disk/disk3_p2, 0

论坛徽章:
0
2 [报告]
发表于 2009-04-03 12:32 |只看该作者
Cur PV                      3      
Act PV                      1

这点很奇怪的,另外的2块盘呢,现在你vg00里面只有一块盘的,vgreduce -f 命令没作用的.

估计你的机器是实验机.

论坛徽章:
0
3 [报告]
发表于 2009-04-05 20:22 |只看该作者
lvreduce -m 0 -k /dev/vg00/lvol1,2,3,4,5,6,7,8

论坛徽章:
0
4 [报告]
发表于 2009-04-06 23:05 |只看该作者
有去ghost的文档吗?
最好先按照文档做~~~

论坛徽章:
0
5 [报告]
发表于 2009-04-07 00:23 |只看该作者
vg00 lvol1到lvol8都是正常的,
lvreduce -m 0 -k /dev/vg00/lvol1,2,3,4,5,6,7,8是不起作用的。
vgreduce已经很明显提示存在还未free的lv
--- Logical extents ---
         LE      LV              PE     Status 1
         0000    .               2376     stale  
         0001    .               2377     stale  
         0002    .               2378     stale  
         0003    .               2379     stale  
....
问题关键就是不知道如何删除这些显示为“."的LV,他不是常规的lvname

论坛徽章:
0
6 [报告]
发表于 2009-04-07 11:43 |只看该作者
你的机器没有镜像的,lvreduce不起作用的.

Cur LV                      9      
Open LV                     8      
很奇怪还有一个lv呢,没看到,估计就是这个lv的问题,如果lv有问题,状态是stale的.

给你贴下老外的:
vgreduce -f vg01
Not all extents are free. i.e. Out of 868 PEs, only 0 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
skip alternate link /dev/dsk/c6t0d0
skip alternate link /dev/dsk/c6t0d2
skip alternate link /dev/dsk/c4t0d1
Here's the map of used PEs

--- Logical extents ---
LE LV PE Status 1
0000 lvol57 0000 ???
0001 lvol57 0001 ???
0002 lvol57 0002 ???

0397 lvol97 0866 ???
0398 lvol97 0867 ???


vgreduce -f vg01 shows that lvol57 and lvol97 is on the system. They couldn't be lvdisplayed/lvremoved due to the lvolname is not the real one. 57 is the minor number for the lvol.

So I did like this,
convert dec 57 to hex 39. Found out that lvol57 infact is /dev/vg01/ora_tmp (minor 36); ls -la /dev/vg01 | grep 39
ls -la /dev/vg01 | grep 39
brw-r----- 1 root sys 64 0x010039 Feb 13 2007 ora_tmp
crw-r----- 1 root sys 64 0x010039 Feb 13 2007 rora_tmp

lvreduce /dev/vg01/ora_tmp
vgreduce -f vg01 (works now when /dev/vg01/ora_tmp is gone)
vgcfgbackup vg01
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

论坛徽章:
0
7 [报告]
发表于 2009-04-07 11:47 |只看该作者
这种情况下用lvreduce -k -m 0 /dev/vg00/lvol1 1才可以,建议把你的输出贴到itrc上,老外会帮你的

root@L2000:/#lvdisplay -v /dev/vg00/lvol1|more
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c15t0d2":
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/vg00/lvol1
VG Name                     /dev/vg00
LV Permission               read/write   
LV Status                   available/stale           
Mirror copies               1            
Consistency Recovery        MWC                 
Schedule                    parallel     
LV Size (Mbytes)            304            
Current LE                  19        
Allocated PE                38         
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   off         
Allocation                  strict/contiguous         
IO Timeout (Seconds)        default            

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV  
   /dev/dsk/c2t0d0    19        19        

   --- Logical extents ---
   LE    PV1                PE1   Status 1 PV2                PE2   Status 2
   00000 /dev/dsk/c2t0d0    00000 current  ???                00000 stale   
   00001 /dev/dsk/c2t0d0    00001 current  ???                00001 stale   
   00002 /dev/dsk/c2t0d0    00002 current  ???                00002 stale   
   00003 /dev/dsk/c2t0d0    00003 current  ???                00003 stale   
   00004 /dev/dsk/c2t0d0    00004 current  ???                00004 stale   
   00005 /dev/dsk/c2t0d0    00005 current  ???                00005 stale   
   00006 /dev/dsk/c2t0d0    00006 current  ???                00006 stale   
   00007 /dev/dsk/c2t0d0    00007 current  ???                00007 stale   
   00008 /dev/dsk/c2t0d0    00008 current  ???                00008 stale   
   00009 /dev/dsk/c2t0d0    00009 current  ???                00009 stale   
   00010 /dev/dsk/c2t0d0    00010 current  ???                00010 stale   
   00011 /dev/dsk/c2t0d0    00011 current  ???                00011 stale   
   00012 /dev/dsk/c2t0d0    00012 current  ???                00012 stale   
   00013 /dev/dsk/c2t0d0    00013 current  ???                00013 stale   
   00014 /dev/dsk/c2t0d0    00014 current  ???                00014 stale   
   00015 /dev/dsk/c2t0d0    00015 current  ???                00015 stale   
   00016 /dev/dsk/c2t0d0    00016 current  ???                00016 stale   
   00017 /dev/dsk/c2t0d0    00017 current  ???                00017 stale   
   00018 /dev/dsk/c2t0d0    00018 current  ???                00018 stale

论坛徽章:
0
8 [报告]
发表于 2009-04-07 13:14 |只看该作者
没办法啦,只能在维护模式下重建vg啦

论坛徽章:
0
9 [报告]
发表于 2009-04-07 17:28 |只看该作者
需要一下# lvdisplay –v –k /dev/vg00/lvol1 (lvol2,~lvol8)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP