lvm 名稱衝突

xychong123發表於2018-08-14

Red Hat Enterprise Linux Server release 7.3 (Maipo)


原磁碟vg名稱rootvg:

[root@prod04 ~]# pvs

  PV         VG     Fmt  Attr PSize  PFree 

  /dev/sda2  rootvg lvm2 a--  49.51g 28.51g

[root@prod04 ~]# vgs -v

  VG     Attr   Ext   #PV #LV #SN VSize  VFree  VG UUID                                VProfile

  rootvg wz--n- 4.00m   1   2   0 49.51g 28.51g  jVhP2y-vMd5-u7lR-7F5C-rRTC-5cXn-cHkQkq          


新增新磁碟,新磁碟的vg 名稱 也是rootvg:

[root@prod04 ~]# pvs

  PV         VG     Fmt  Attr PSize  PFree 

  /dev/sda2  rootvg lvm2 a--  49.51g 28.51g

  /dev/sdc2  rootvg lvm2 a--  49.51g 28.51g


[root@prod04 ~]# vgs -v

    Archiving volume group "rootvg" metadata (seqno 5).

    Archiving volume group "rootvg" metadata (seqno 5).

    Creating volume group backup "/etc/lvm/backup/rootvg" (seqno 5).

    Cache: Duplicate VG name rootvg: Prefer existing WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu vs new jVhP2y-vMd5-u7lR-7F5C-rRTC-5cXn-cHkQkq

    Archiving volume group "rootvg" metadata (seqno 5).

    Archiving volume group "rootvg" metadata (seqno 5).

    Creating volume group backup "/etc/lvm/backup/rootvg" (seqno 5).

  VG     Attr   Ext   #PV #LV #SN VSize  VFree  VG UUID                                VProfile

  rootvg wz--n- 4.00m   1   2   0 49.51g 28.51g WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu         

  rootvg wz--n- 4.00m   1   2   0 49.51g 28.51g jVhP2y-vMd5-u7lR-7F5C-rRTC-5cXn-cHkQkq   


對新新增磁碟vg進行名稱更改:


[root@prod04 ~]# vgrename WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu  rootvg01

  Processing VG rootvg because of matching UUID WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu

  Volume group "WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu" successfully renamed to "rootvg01"

[root@prod04 ~]# vgs

  VG       #PV #LV #SN Attr   VSize  VFree 

  rootvg     1   2   0 wz--n- 49.51g 28.51g

  rootvg01   1   2   0 wz--n- 49.51g 28.51g

[root@prod04 ~]# vgs -v

  VG       Attr   Ext   #PV #LV #SN VSize  VFree  VG UUID                                VProfile

  rootvg   wz--n- 4.00m   1   2   0 49.51g 28.51g jVhP2y-vMd5-u7lR-7F5C-rRTC-5cXn-cHkQkq         

  rootvg01 wz--n- 4.00m   1   2   0 49.51g 28.51g WipQPA-8D8c-1vD6-0G7g-ScOz-S4hq-ZiEECu    



啟用vg:

[root@prod04 ~]# lvscan 

  inactive           '/dev/rootvg01/swap' [1.00 GiB] inherit

   inactive           '/dev/rootvg01/root' [20.00 GiB] inherit

  ACTIVE            '/dev/rootvg/swap' [1.00 GiB] inherit

  ACTIVE            '/dev/rootvg/root' [20.00 GiB] inherit

[root@prod04 ~]# vgchange -ay rootvg01

  2 logical volume(s) in volume group "rootvg01" now active

[root@prod04 ~]# lvscan 

  ACTIVE            '/dev/rootvg01/swap' [1.00 GiB] inherit

  ACTIVE            '/dev/rootvg01/root' [20.00 GiB] inherit

  ACTIVE            '/dev/rootvg/swap' [1.00 GiB] inherit

  ACTIVE            '/dev/rootvg/root' [20.00 GiB] inherit



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2200001/,如需轉載,請註明出處,否則將追究法律責任。

相關文章