1834659 Members
2447 Online
110069 Solutions
New Discussion

Vgexport & Vgimport

 
SOLVED
Go to solution
susee_sundar
Regular Advisor

Vgexport & Vgimport

Hi ,

What is the use of vgexport & vgimport command in LVM.Can anybody share the scenerio of using this commands.


9 REPLIES 9
Chauhan Amit
Respected Contributor
Solution

Re: Vgexport & Vgimport

vgexport - export an LVM volume group and its associated logical volumes.

vgimport - import an LVM volume group onto the system

Scenarios:

a)vgexport can be used to remove a volume group definitions from the system

b)Support you want to Import the volume group /dev/vg01 that is located on physical disks /dev/dsk/c0t1d0 , u need to use vgimport

c)you can also Import the volume group using the mapfile that was previously specified by the vgexport command on another
system.

-Amit
If you are not a part of solution , then you are a part of problem
Chauhan Amit
Respected Contributor

Re: Vgexport & Vgimport

Another Scenario can be to move volume groups from one system to other systems within a high availability cluster.
This is pretty useful in ServiceGuard environment.

-AMit
If you are not a part of solution , then you are a part of problem
Arunvijai_4
Honored Contributor

Re: Vgexport & Vgimport

Hi Susee,

You can take a look at man pages,

http://docs.hp.com/en/B2355-60103/vgexport.1M.html
http://docs.hp.com/en/B2355-60103/vgimport.1M.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Chauhan Amit
Respected Contributor

Re: Vgexport & Vgimport

using vgexport the volume group will be removed without modifying the logical volume
information found on the physical volumes.
The volume group identified by vg_name is removed from the /etc/lvmtab
file, and the associated device files including the vg_name directory and group file are removed from the system.
The volume group information and data is untouched on the physical volume. These disks can be imported to other system with the vgimport command .

-Amit
If you are not a part of solution , then you are a part of problem
susee_sundar
Regular Advisor

Re: Vgexport & Vgimport

HI

I got Few things But not so clear

COnsider:-

If I want to Shift my disk from

SERVER1:-

/dev/dsk/c2t5d0 --> /dev/vg02/lvol3
--> /dev/vg02/lvol5
--> /dev/vg02/lvol4

TO SERVER2..How can I access these logical volumes from the SERVER2.

The SERVER2 is sensing the disk ad

/dev/rdsk/c6t5d0--->

How can I access the Logical volumes ??

lvol3 ..?
lvol4 ..
lvol5 ..

Is it possible....& Share me if so...
Chauhan Amit
Respected Contributor

Re: Vgexport & Vgimport

Follow the below steos:

Server1:
vgexport -m vgname.mapfile /dev/vgname

*copy the file "vgname.mapfile" to /tmp in server2

Server2:
vgimport -v -m /tmp/vgname.mapfile /dev/vgname /dev/dsk/c6t5d0

you will be able to see the logical volumes on server2 without any issues

Keep in mind following things:
a)Ensure backup before proceeding with any such activity
b) LV shouldn't span to any other disk , otherwise you will not be able to recover that LV

-Amit
If you are not a part of solution , then you are a part of problem
harsr
Advisor

Re: Vgexport & Vgimport

Vgexport command creates a map file which contains the LVM information of the volume group on which the command is executed . This command is used in high availability clusters to present the shared vg's to other nodes . Further the map file that was created can be referenced with the vgimport command to import the LVM information of the volume group


Albert_31
Trusted Contributor

Re: Vgexport & Vgimport

One more thing.. it is used when you want to change the volume group names as well.
susee_sundar
Regular Advisor

Re: Vgexport & Vgimport

Closing the thread...