[linux-lvm] vgimport/vgexport commands when logically moving disks between systems

Dave davo_muc at yahoo.com
Tue Dec 5 09:38:36 UTC 2006


I believe I might be misunderstanding whether vgimport and vgexport are needed in my
particular situation.  It would be great to get some feedback for clarification.


LVM1 (1.0.8-14) on two RedHat AS3 systems (kernel: 2.4.21-47.ELsmp).
I think the same concept applies for LVM2 as well though.
Machine A is primary and Machine B is backup in a two-node Linux heartbeat cluster.
Both machines are connected to the same SAN via fiber, and see the same disks, where
the volume groups reside.


The idea is for A to have the LVM file systems mounted, and when a failure is
detected, have the LVM file systems "moved" to (or seen by) system B.  The way this
is currently accomplished is for A to do the following upon detection of a failure:

+ unmount file systems
+ deactivate (vgchange -an $vg)
+ export (vgexport $vg)

then, on system B:

+ import & activate (vgimport $vg $disks)
+ mount file systems


The export works as expected on A, but upon import on B, a return code of 4 is
returned meaning "volume group already exists".  The mounting works properly, but
all the disks are shown like this:

"inactive PV /dev/sdx  is in EXPORTED VG $vg"  

when inspected with pvscan.

Does a vgimport and/or vgexport mark the disks themselves, or simply update the
system on which the commands are run???  I suppose that is essentially the heart of
this issue.

I'm starting to believe that for our strategy the vgexport and vgimport commands are
not necessary, and are actually causing the problem.  (The HOWTO mentions these
commands are used to move disks between systems, but perhaps that is meant to refer
to disks that are only physically moved?)

Instead, the following strategy might be correct in case system A fails (Note: no
vgimport or vgexport commands):

+ unmount fs
+ vgchange -an $vg

then, on system B:

+ vgchange -ay $vg
+ mount fs


Thanks in advance for any helpful feedback.

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.

More information about the linux-lvm mailing list