Operating System - Linux
1829279 Members
8407 Online
109989 Solutions
New Discussion

How can I export / import a VG from one server to another server?

 
praveen..
Super Advisor

How can I export / import a VG from one server to another server?

Hi.
I need to export a volume group vg02 from server-A

and i need to import it into server-B without losing the data.

Please suggest what will be step by step commands?

Thanks in advance
3 REPLIES 3
Vipulinux
Respected Contributor

Re: How can I export / import a VG from one server to another server?

Hi

Are you referring to NFS export and import?
if yes do the following

a. on server-A
vi /etc/exports and put the mount points of vg02

then exportfs -a

b. On Server-B
mkdir /mountpoint
mount -t nfs //Server-A/vg02_mounts /mountpoints

then copy the /mountpoints to a local partition using mv or cp

Cheers
Ivan Ferreira
Honored Contributor

Re: How can I export / import a VG from one server to another server?

Here you get detailed steps:

http://www.linux.com/howtos/LVM-HOWTO/recipemovevgtonewsys.shtml
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
VK2COT
Honored Contributor

Re: How can I export / import a VG from one server to another server?

Hello,

Here is a real-life example of poor-man's
failover.

The two servers run Red Hat Linux ES4.
The OPEN-V LUNs are presented to both
servers from XP 12000 SAN.

The customer did not want to purchase
any vendor-based clustering solution.

a) Servers server1 and server2 have
the following line in /etc/fstab:

/dev/vgdard00/lvdar00 /msd/videoapp ext3 defaults,noauto 1 2

This is required to ensure that at reboot, this file system is not mounted
automatically.

b) Initial setup:

Server server1:

# umount /msd/videoapp

# vgchange -an /dev/vgdard00
0 logical volume(s) in volume group "vgdard00" now active

# vgexport /dev/vgdard00
Volume group "vgdard00" successfully exported


Server server2:

# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vgdard00" using metadata type lvm2
Found volume group "vg00" using metadata type lvm2

# vgimport /dev/vgdard00

# vgchange -ay /dev/vgdard00

# mount /msd/videoapp

c) We did many tests of "crashing" both
servers and mounting the file system.
It worked fine each time.

d) Note that both servers have volume group
vgdard00 active. As long as they do not mount
the file system at the same time,
no harm done.

If the two servers, by accident, mount the file system /msd/videoapp,
then the status of the volume group will be undefined (each server might create a
different version of the data).

e) Next steps were:

RC startup script with commands to
add virtual interface eth1:1, mount the
file system and start application.

Shell script for ICMP tests to remote
server (ping) and lynx(1) or curl(1)
test for application port activity. If
both tests fail, then we assume remote
server is down and application services
will start on this side...

You an be creative as to how to monitor
the applications :)

Regards,

VK2COT
VK2COT - Dusan Baljevic