1846988 Members
3419 Online
110257 Solutions
New Discussion

Re: export vg

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

export vg

How do I export all my volume groups?
6 REPLIES 6
Marcin Wicinski
Trusted Contributor

Re: export vg

Hi,
You should use vgexport command exporting all volume groups one by one (creating separate map files). Check man pages for vgexport.
Marcin Wicinski
Tim D Fulford
Honored Contributor
Solution

Re: export vg

Why do you want to export all your vg's?...What exactly do you mean?

To try to answer your question

Option 1####
# vgchange -a n
# vgexport
This will destroy the volume group

# vgexport [-s] -p -v -m /tmp/.map
This will create a mapfile of your volume group in /tmp/.map but will not destroy it. You can then import it using the mapfile (use vgimport)

Option 2#####
but you might mean you want to NFS export your volume groups. This is not strictly possible. You can NFS export the logical volumes by
o Add the mount points to /etc/exports
# exportfs -av

On the remote machine you can use NFS to import them or the automounter.

Option 3####
Alternatively do you mean export (save) the data in a vg. Again this is not strictly possible. You can save the data on a filesystem. There are lots of tools for this such as fbackup, Ignite-UX (make_tape_recovery), tar, cpio.....

If you put a little more explaintion we/I may be able to help more

Cheers

Tim
-
Rita C Workman
Honored Contributor

Re: export vg

If your wanting to create a mapfile for later vgimporting you may want to use a command something like this:

vgexport -pvs -m /etc/lvmconf/vg_ _ _.map /dev/vg_ _

Above create for volgroup /dev/vg_ _ and places this mapfile in /etc/lvmconf

Hope that helps,
Rita
James R. Ferguson
Acclaimed Contributor

Re: export vg

Hi Jeff:

#!/usr/bin/sh
for V in `vgdisplay|awk '/dev/ {print $3}'`
do
echo $V
M=`echo $V|tr -d "/"`
echo -m /tmp/${M}.mapfile $V
done
#.end.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: export vg

Hi (again) Jeff:

Oops. Let's take out the debugging. The suggestion is this:

#!/usr/bin/sh
for V in `vgdisplay|awk '/dev/ {print $3}'`
do
M=`echo $V|tr -d "/"`
vgexport -m /tmp/${M}.mapfile $V
done
#.end.

...JRF...
Deshpande Prashant
Honored Contributor

Re: export vg

HI
vgexport command will help you in exporting volume groups.

To export vg01 from system by creating a map file use.
#vgexport -m /tmp/vg01.map vg01

To just create the map file use
#vgexport -p -v -m /tmp/vg01.map vg01

If you want to export VGs from one machine in a cluster to be imported on another machine in cluster use.
#vgexport -s -p -m -v /tmp/vg01.map vg01

Thanks.
Prashant.



Take it as it comes.