System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing SAN LV from two hosts, do I run pvcreate from both?

Daniel Ölvebrink
Occasional Visitor

Accessing SAN LV from two hosts, do I run pvcreate from both?

Hi,

I'm setting up a SAN, where I will be using and accessing a logical volume from two hosts, although only having one host mounting at the time.

I have got my one host to see the PV, VG and LV, the second host can see the physical device (LUN) from the SAN but cannot detect the PV using pcscan or VG using vgscan.

Do I have to run pvcreate from BOTH hosts until the second host will recognize that there is existing VGs and LVs on the physical device on the SAN?

Best Regards,
Daniel
7 REPLIES
Steven E. Protter
Exalted Contributor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

Shalom Daniel,

Prior to storing any data on the LUN, I would run pvcreate from both nodes.

pvcreate will not damage the data that is already on shared storage if you plan a vgimport.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Daniel Ölvebrink
Occasional Visitor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

Thanks. The problem I have here is that I am upgrading two servers who are using the same LV to a newer O/S release,

Server 1 is still on the old release, it can view and activate the LV correctly,

After upgrading Server 2, completely wiping the O/S, the server can still see the physical device (say /dev/sdb), but it cannot detect any physical volumes on it.

So I was thinking if I had to rerun pvcreate for this to happen. There is data on the partition.

Best Regards,
Daniel
Daniel Ölvebrink
Occasional Visitor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

I've investigated some more, could it be that the PV is created on a partition of the whole device? I.e. say /dev/sdb1,

--- Physical volume ---
PV Name /dev/sdb1

And this is why the pvscan cannot find a physical volume when scanning through the complete device?

What do I then need to do to be able to fix this?
Matti_Kurkela
Honored Contributor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

So your servers are running different OS versions. What is the name of the Linux distribution you're using and what are the version numbers?

If your older server is running Linux kernel version 2.4.* and the newer uses kernel version 2.6.*, it is likely they are running different versions of Linux LVM. The LVM of the older kernel series is now called LVM1, and the modern version is LVM2.

LVM2 can understand LVM1 disks, but not necessarily vice versa.

Some distributions may have packaged this compatibility feature into an optional software package. This is distribution-specific, so knowing the name and version of the distribution(s) used is rather important.

MK
MK
Daniel Ölvebrink
Occasional Visitor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

The server on which the LVM partitioning was created runs RedHat 7.2, the new operating system on which I have problems accessing the old LVM partitions is running RedHat Entetprise 4 Update 3.

Best Regards,
Daniel
Brem Belguebli
Regular Advisor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

Hi,

RHEL 4u3 runs kernel 2.6 and LVM2 and is able to understand LVM1 pv's (RH 7).

You shouldn't have to pvcreate on the second node, as the information should be written in the LVM metadata on the disk if created with LVM2, but if I remmember well, with LVM1 metadata was in /etc/lvmtab, may be try a vgimport on all the vg's from node1 on node2
Daniel Ölvebrink
Occasional Visitor

Re: Accessing SAN LV from two hosts, do I run pvcreate from both?

FYI

We did a reinstallation and recreation of LVM2 using RHEL4 Update 3 on both hosts, and it worked.

I'm not sure what caused the incompatability. I agree that according to LVM developers it should be backward compatible.