Linux How-To

Methods to import VG utilizing completely different VG title

SEOClerks

Learn to import VG with completely different title. Helpful when system has identical title VG already present and you are attempting to import VG there.

How to import VG using different VG nameChange VG title throughout import

 

On this tutorial, we’ll stroll you thru the method to import VG with the completely different title. Throughout migrations, knowledge motion actions and so on you might face points in VG import course of. Generally you’ve got disks with VGs exported on them & identical VG title is exiting on the server the place you attempt to import VG from these disks.

In such instances, the place you attempt to import VG when identical VG title already present within the system you get beneath error :

# vgimport vg02 /dev/xvdg
A number of VGs discovered with the identical title: skipping vg01
Use –select vg_uuid= rather than the VG title.

 

# vgimport vg02 /dev/xvdg

  A number of VGs discovered with the identical title: skipping vg01

  Use choose vg_uuid=<uuid> in place of the VG title.

 

Now, you’ve got two selections to import VG in such case.

Import utilizing VG UUID whereas protecting VG title identical. On this case, you should have 2 VG on the system with the identical title and administer them & mounting LVs in them is havocUse vgimportclone command and import VG utilizing a distinct title.

Import VG utilizing the identical title with UUID

In the event you took the VG map file whereas exporting VG then you may get VG UUID from it or you need to have famous it down from vgdisplay output as nicely. This course of can be reply for how one can import VG with duplicate title!

# vgimport –select vg_uuid=kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2
Quantity group “vg02” efficiently imported

 

# vgimport  –select vg_uuid=kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2

  Quantity group “vg02” efficiently imported

 

Now you see vg02 is imported. However we already had VG named vg02 in our system. So, now we’ve two VGs with identical title in our system.

# vgdisplay
— Quantity group —
VG Title vg02
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Entry learn/write
VG Standing resizable
MAX LV zero
Cur LV zero
Open LV zero
Max PV zero
Cur PV 1
Act PV 1
VG Dimension 1020.00 MiB
PE Dimension four.00 MiB
Whole PE 255
Alloc PE / Dimension zero / zero
Free PE / Dimension 255 / 1020.00 MiB
VG UUID aRmosT-KZCY-5k40-DGSK-3WGd-ZwWD-eEXXgk

— Quantity group —
VG Title vg02
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Entry learn/write
VG Standing exported/resizable
MAX LV zero
Cur LV 1
Open LV zero
Max PV zero
Cur PV 1
Act PV 1
VG Dimension <5.00 GiB PE Dimension four.00 MiB Whole PE 1279 Alloc PE / Dimension 25 / 100.00 MiB Free PE / Dimension 1254 /

1

2

three

four

5

6

7

eight

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

 

# vgdisplay

   Quantity group

  VG Title               vg02

  System ID

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  2

  VG Entry             learn/write

  VG Standing             resizable

  MAX LV                zero

  Cur LV                zero

  Open LV               zero

  Max PV                zero

  Cur PV                1

  Act PV                1

  VG Dimension               1020.00 MiB

  PE Dimension               four.00 MiB

  Whole PE              255

  Alloc PE / Dimension       zero / zero

  Free  PE / Dimension       255 / 1020.00 MiB

  VG UUID               aRmosTKZCY5k40DGSK3WGdZwWDeEXXgk

 

   Quantity group

  VG Title               vg02

  System ID

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  5

  VG Entry             learn/write

  VG Standing             exported/resizable

  MAX LV                zero

  Cur LV                1

  Open LV               zero

  Max PV                zero

  Cur PV                1

  Act PV                1

  VG Dimension               <5.00 GiB

  PE Dimension               four.00 MiB

  Whole PE              1279

  Alloc PE / Dimension       25 / 100.00 MiB

  Free  PE / Dimension       1254 / <four.90 GiB

  VG UUID               kzwQmcqIzFIZcv9eW8ToA1mkDVfLari2

 

Now the actual problem is to mount LV inside them. You are able to do that however to ease out your ache, you possibly can merely rename newly imported VG to some completely different title. It’s best to use VG UUID once more in vgrename command.

# vgrename kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2 vg03
Processing VG vg02 due to matching UUID kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2
Quantity group “kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2” efficiently renamed to “vg03”

 

# vgrename kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2 vg03

  Processing VG vg02 as a result of of matching UUID kzwQmcqIzFIZcv9eW8ToA1mkDVfLari2

  Quantity group “kzwQmc-qIzF-IZcv-9eW8-ToA1-mkDV-fLari2” efficiently renamed to “vg03”

 

When you renamed newly imported VG, your present and new VG has completely different names as nicely. Now, it is possible for you to to mount LVs inside them with out a lot problem.

Therefore its really helpful in such situation you need to import VG with the completely different title.

Import VG with the completely different title utilizing vgimportclone command

vgimportclone command ought to be provided with a brand new title with which you need VG to be imported with swap -n adopted by disk title on which you exported VG

# vgimportclone -n vg01 /dev/xvdg
VG vg02 is exported, use the –import possibility.

 

# vgimportclone -n vg01 /dev/xvdg

  VG vg02 is exported, use the import possibility.

 

So, command right here detected that VG was exported and asks us to verify import operation with –import swap. Let’s do this –

# vgimportclone –import -n vg01 /dev/xvdg

 

# vgimportclone –import -n vg01 /dev/xvdg

 

And command ran efficiently. It received’t print any message on the terminal. You’ll be able to confirm that new VG on the system utilizing vgdisplay command.

In case you are wanting solutions for how one can change VG title throughout import? or how one can import VG with new title? then vgimportclone is the reply!

That’s it. You efficiently imported VG with a distinct title. Since present VG and your imported VG has completely different names now you received’t face any hurdles in mounting LVs from each of them.

 

Source link

Related Articles

Leave a Reply

Back to top button