该错误是在AIX上扩展LVM的时候发生的,具体场景如下。

我们从另一台终止服务的AIX分区上,将LUN划分到了目标分区后,重新扫描设备,得到了新的PV:【hdisk31】

root@uxgdc106:/ # lspv
hdisk0          00cd7651bf1cd905                    rootvg          active      
hdisk1          00cc37c298f35cbb                    rootvg          active      
hdisk2          00cd7661b5479fc2                    rootvg          active      
hdisk3          00cd7651b521c300                    rootvg          active      
hdisk4          00cd76515d26cced                    datavg          active      
hdisk5          00cd76517f129ed2                    datavg          active      
hdisk9          00cd7651812de1cc                    datavg          active      
hdisk6          00cd7651f5cc22f4                    datavg          active      
hdisk7          00cd7651f920d8e3                    datavg          active      
hdisk8          00cd76515a4936b8                    datavg          active      
hdisk10         00cd7651cf913b39                    datavg          active      
hdisk11         00cd76510af824ee                    datavg          active      
hdisk12         00cd765133e8e886                    datavg          active      
hdisk13         00cd765154e18c41                    datavg          active      
hdisk14         00cd7651bba54981                    datavg          active      
hdisk15         00cd7651bbfaa194                    datavg          active      
hdisk16         00cd7651227303c0                    datavg          active      
hdisk17         00cd765166046229                    datavg          active      
hdisk18         00cd765184acc859                    datavg          active      
hdisk19         00cd765184ad5a25                    datavg          active      
hdisk20         00cd765184b44c9f                    datavg          active      
hdisk21         00cd7651e7481ac3                    datavg          active      
hdisk22         00cd7651e748753f                    datavg          active      
hdisk23         00cd7651f1464933                    datavg          active      
hdisk24         00cd7651abb6064c                    datavg          active      
hdisk25         00cd7651c8ea9e05                    datavg          active      
hdisk26         00cd765142576fde                    datavg          active      
hdisk27         00cd76517b9b0488                    datavg          active      
hdisk28         00cd7651ecb8f2f4                    datavg          active      
hdisk29         00cd7651e8e17c49                    datavg          active      
hdisk30         00cd7651b3fd1a33                    datavg          active      
root@uxgdc106:/ # 
root@uxgdc106:/ # cfgmgr
Method error (/usr/lib/methods/cfgefscsi -l fscsi1 ):
        0514-061 Cannot find a child device.
root@uxgdc106:/ # 
root@uxgdc106:/ # lsdev -Cc disk
hdisk0  Available 07-08-00 SAS Disk Drive
hdisk1  Available 07-08-00 SAS Disk Drive
hdisk2  Available 07-08-00 SAS Disk Drive
hdisk3  Available 07-08-00 SAS Disk Drive
hdisk4  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk5  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk6  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk7  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk8  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk9  Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk10 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk11 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk12 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk13 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk14 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk15 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk16 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk17 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk18 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk19 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk20 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk21 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk22 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk23 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk24 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk25 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk26 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk27 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk28 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk29 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk30 Available 05-00-02 Huawei XSG1 FC Disk Drive
hdisk31 Available 05-00-02 Huawei XSG1 FC Disk Drive
root@uxgdc106:/ # 
root@uxgdc106:/ # lspv
hdisk0          00cd7651bf1cd905                    rootvg          active      
hdisk1          00cc37c298f35cbb                    rootvg          active      
hdisk2          00cd7661b5479fc2                    rootvg          active      
hdisk3          00cd7651b521c300                    rootvg          active      
hdisk4          00cd76515d26cced                    datavg          active      
hdisk5          00cd76517f129ed2                    datavg          active      
hdisk31         00cd765185d58327                    None                        
hdisk9          00cd7651812de1cc                    datavg          active      
hdisk6          00cd7651f5cc22f4                    datavg          active      
hdisk7          00cd7651f920d8e3                    datavg          active      
hdisk8          00cd76515a4936b8                    datavg          active      
hdisk10         00cd7651cf913b39                    datavg          active      
hdisk11         00cd76510af824ee                    datavg          active      
hdisk12         00cd765133e8e886                    datavg          active      
hdisk13         00cd765154e18c41                    datavg          active      
hdisk14         00cd7651bba54981                    datavg          active      
hdisk15         00cd7651bbfaa194                    datavg          active      
hdisk16         00cd7651227303c0                    datavg          active      
hdisk17         00cd765166046229                    datavg          active      
hdisk18         00cd765184acc859                    datavg          active      
hdisk19         00cd765184ad5a25                    datavg          active      
hdisk20         00cd765184b44c9f                    datavg          active      
hdisk21         00cd7651e7481ac3                    datavg          active      
hdisk22         00cd7651e748753f                    datavg          active      
hdisk23         00cd7651f1464933                    datavg          active      
hdisk24         00cd7651abb6064c                    datavg          active      
hdisk25         00cd7651c8ea9e05                    datavg          active      
hdisk26         00cd765142576fde                    datavg          active      
hdisk27         00cd76517b9b0488                    datavg          active      
hdisk28         00cd7651ecb8f2f4                    datavg          active      
hdisk29         00cd7651e8e17c49                    datavg          active      
hdisk30         00cd7651b3fd1a33                    datavg          active      
root@uxgdc106:/ # 

可以看到【hdisk31】当前是没有分配逻辑卷(VG)的,逻辑卷上为【None】

然后通过【smitty extendvg】,对VG【datavg】扩容新增PV【hdisk31】的时候,就遇到了如题所示的错误:

Command: failed        stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

0516-1398 /usr/sbin/extendvg: The physical volume hdisk31, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-792 /usr/sbin/extendvg: Unable to extend volume group.

如错误所示,目标PV【hdisk31】上面已经有VG的设置,没有清理干净,所以添加到新的VG就失败了。

既然已经有旧的VG信息,可能你会想去看看。

但是没有加载到VG,这个信息是看不到的:

root@uxgdc106:/ # lspv -l hdisk31 
0516-320 : Physical volume 00cd765185d583270000000000000000 is not assigned to
        a volume group.
root@uxgdc106:/ # 
root@uxgdc106:/ # lspv hdisk31
0516-320 : Physical volume hdisk31 is not assigned to
        a volume group.
root@uxgdc106:/ #     

需要在扩容VG的时候,启用【force】选项:

root@uxgdc106:/ # lspv
hdisk0          00cd7651bf1cd905                    rootvg          active      
hdisk1          00cc37c298f35cbb                    rootvg          active      
hdisk2          00cd7661b5479fc2                    rootvg          active      
hdisk3          00cd7651b521c300                    rootvg          active      
hdisk4          00cd76515d26cced                    datavg          active      
hdisk5          00cd76517f129ed2                    datavg          active      
hdisk31         00cd765185d58327                    None                        
hdisk9          00cd7651812de1cc                    datavg          active      
hdisk6          00cd7651f5cc22f4                    datavg          active      
hdisk7          00cd7651f920d8e3                    datavg          active      
hdisk8          00cd76515a4936b8                    datavg          active      
hdisk10         00cd7651cf913b39                    datavg          active      
hdisk11         00cd76510af824ee                    datavg          active      
hdisk12         00cd765133e8e886                    datavg          active      
hdisk13         00cd765154e18c41                    datavg          active      
hdisk14         00cd7651bba54981                    datavg          active      
hdisk15         00cd7651bbfaa194                    datavg          active      
hdisk16         00cd7651227303c0                    datavg          active      
hdisk17         00cd765166046229                    datavg          active      
hdisk18         00cd765184acc859                    datavg          active      
hdisk19         00cd765184ad5a25                    datavg          active      
hdisk20         00cd765184b44c9f                    datavg          active      
hdisk21         00cd7651e7481ac3                    datavg          active      
hdisk22         00cd7651e748753f                    datavg          active      
hdisk23         00cd7651f1464933                    datavg          active      
hdisk24         00cd7651abb6064c                    datavg          active      
hdisk25         00cd7651c8ea9e05                    datavg          active      
hdisk26         00cd765142576fde                    datavg          active      
hdisk27         00cd76517b9b0488                    datavg          active      
hdisk28         00cd7651ecb8f2f4                    datavg          active      
hdisk29         00cd7651e8e17c49                    datavg          active      
hdisk30         00cd7651b3fd1a33                    datavg          active      
root@uxgdc106:/ # 
root@uxgdc106:/ # extendvg -f datavg hdisk31
root@uxgdc106:/ # 
root@uxgdc106:/ # lspv
hdisk0          00cd7651bf1cd905                    rootvg          active      
hdisk1          00cc37c298f35cbb                    rootvg          active      
hdisk2          00cd7661b5479fc2                    rootvg          active      
hdisk3          00cd7651b521c300                    rootvg          active      
hdisk4          00cd76515d26cced                    datavg          active      
hdisk5          00cd76517f129ed2                    datavg          active      
hdisk31         00cd765185d58327                    datavg          active      
hdisk9          00cd7651812de1cc                    datavg          active      
hdisk6          00cd7651f5cc22f4                    datavg          active      
hdisk7          00cd7651f920d8e3                    datavg          active      
hdisk8          00cd76515a4936b8                    datavg          active      
hdisk10         00cd7651cf913b39                    datavg          active      
hdisk11         00cd76510af824ee                    datavg          active      
hdisk12         00cd765133e8e886                    datavg          active      
hdisk13         00cd765154e18c41                    datavg          active      
hdisk14         00cd7651bba54981                    datavg          active      
hdisk15         00cd7651bbfaa194                    datavg          active      
hdisk16         00cd7651227303c0                    datavg          active      
hdisk17         00cd765166046229                    datavg          active      
hdisk18         00cd765184acc859                    datavg          active      
hdisk19         00cd765184ad5a25                    datavg          active      
hdisk20         00cd765184b44c9f                    datavg          active      
hdisk21         00cd7651e7481ac3                    datavg          active      
hdisk22         00cd7651e748753f                    datavg          active      
hdisk23         00cd7651f1464933                    datavg          active      
hdisk24         00cd7651abb6064c                    datavg          active      
hdisk25         00cd7651c8ea9e05                    datavg          active      
hdisk26         00cd765142576fde                    datavg          active      
hdisk27         00cd76517b9b0488                    datavg          active      
hdisk28         00cd7651ecb8f2f4                    datavg          active      
hdisk29         00cd7651e8e17c49                    datavg          active      
hdisk30         00cd7651b3fd1a33                    datavg          active      
root@uxgdc106:/ # 

这样就可以看了:

root@uxgdc106:/ # lspv hdisk31
PHYSICAL VOLUME:    hdisk31                  VOLUME GROUP:     datavg
PV IDENTIFIER:      00cd765185d58327 VG IDENTIFIER     00cd765100004c000000014e7bbd5f46
PV STATE:           active                                     
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            512 megabyte(s)          LOGICAL VOLUMES:  0
TOTAL PPs:          14335 (7339520 megabytes) VG DESCRIPTORS:   1
FREE PPs:           14335 (7339520 megabytes) HOT SPARE:        no
USED PPs:           0 (0 megabytes)          MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  2867..2867..2867..2867..2867                   
USED DISTRIBUTION:  00..00..00..00..00                         
MIRROR POOL:        None                                       
root@uxgdc106:/ # 
root@uxgdc106:/ # lspv -M hdisk31
hdisk31:1-14335
root@uxgdc106:/ # 
root@uxgdc106:/ # lspv -p hdisk31
hdisk31:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-2867  free    outer edge                                   
2868-5734  free    outer middle                                 
5735-8601  free    center                                       
8602-11468 free    inner middle                                 
11469-14335 free    inner edge                                   
root@uxgdc106:/ # 

至此,文首的问题解决了。

——————————————————————
Done。

说点什么

avatar

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
提醒