Operating System - HP-UX
1748150 Members
3604 Online
108758 Solutions
New Discussion юеВ

Re: vgexport and vgimport

 
newunix
Frequent Advisor

vgexport and vgimport

why vgexport and vgimport are used.

can i have with an example
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: vgexport and vgimport

Hi:

You use 'vgexport' and 'vgimport' to (1) move LVM volume groups from one server to another; (2) to rename a volume group; (3) to copy volume group information from one server to another in a cluster (e.g. under Serviceguard); and (4) to remove a volume group from a server ('vgexport' without any subsequent 'vgimport').

The manpages for each command provide examples and more information.

Regards!

...JRF...
srm_2
Occasional Advisor

Re: vgexport and vgimport

also we use vgexport to take configuration backup of a vg (in the form of a map file), so that in the event of a failure we can recreate the vg from that backup.
SoorajCleris
Honored Contributor

Re: vgexport and vgimport

Hi Rahman,

"also we use vgexport to take configuration backup of a vg (in the form of a map file), so that in the event of a failure we can recreate the vg from that backup"

I am confused. Could you please explain it ?
Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
SoorajCleris
Honored Contributor

Re: vgexport and vgimport

Hi,

(11.31)

/usr/sbin/vgexport [-m mapfile] [-p] [-v] [-f outfile] vg_name

Using the format of the above command line the vgexport command can be used to remove a volume group from the system.
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
or /etc/lvmtab_p 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 another system with the
vgimport command


/usr/sbin/vgexport -m mapfile -s [-p] [-v] vg_name


Using the format of the above command line,
vgexport command generates a mapfile that can be copied to other
systems that are part of a high availability cluster (use the -p
option if you do not want to remove the volume group from the system
the command is being run from) and the vgimport command (see
vgimport(1M)) can be used to recreate the volume group. See also
vgchange(1M). The mapfile contains a description of the volume group
and its associated logical volume(s) (if any). The logical volume
information found on the physical volumes is not modified.



Regards,
Sooraj



"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
srm_2
Occasional Advisor

Re: vgexport and vgimport

Hi Sooraj,

i was talking about the second one you mentioned:
/usr/sbin/vgexport -p -v -s -m mapfile vg_name

using this, we get the mapfile and the vg will not be removed from system.

If later on, while working on this vg, if it is removed using vgexport or like that, then using the existing mapfile we can regenerate the vg by vgimport:
/usr/sbin/vgimport -v -s -m mapfile vg_name
SoorajCleris
Honored Contributor

Re: vgexport and vgimport

Hi

Thank you verymuch for the reply.

==>to take configuration backup of a vg (in the form of a map file),

The command used for this is vgcfgbackup.

vgimport will take the configuration from disks only , not for the mapfile.

in case of vgexport, map file is only used to save the "VGID" so that it can search for the disks which is having same VGID. it saves the name of the LV also.

you can import a VG with data without help of any mapfile.. all you need is disks.

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Hakki Aydin Ucar
Honored Contributor
Hakki Aydin Ucar
Honored Contributor

Re: vgexport and vgimport

SoorajCleris
Honored Contributor

Re: vgexport and vgimport

http://forums13.itrc.hp.com/service/forums/helptips.do?#28
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie