Operating System - HP-UX
1835846 Members
2416 Online
110085 Solutions
New Discussion

share logical volumes but not simul

 
Ravinder Kaul
Advisor

share logical volumes but not simul

Is it possible for two servers to use the same LV in a VG on a disk array if we unmount the LV from one machine and mount it on the other. i.e is the following procedure O.K.
On server 1
VG01 on a disk array connected to two servers.
/dev/VG01/lv-test mounted on /test
vgexport -p -s -v -m /dev/VG01
umount /test
rcp server 2On Server 2
mkdir /dev/VG01
mknod /dev/VG01/group c 64 0x0n0000
vgimport -v -s -m /dev/VG01
vgchange -a y VG01
mount /dev/VG01/lv-test /test
Disk paths are the same in both the servers


4 REPLIES 4
Michael Tully
Honored Contributor

Re: share logical volumes but not simul

In between the vgchange and the mount, you will need to run an 'fsck' on the volume.
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: share logical volumes but not simul

I should have read your question more closely. You can have access to the LUN's from both servers, BUT one of the servers can only be set up as read-only. Only other way is to use NFS mount points, then you have write access from both servers. Only drawback to this is you are also relying on the network. I wish I could provide some examples, but I'm not near a system.
Anyone for a Mutiny ?
Pete Randall
Outstanding Contributor

Re: share logical volumes but not simul

The process you describe will work: the machines can share the volume but only one will be able to have access at any one time. However, I believe you're going to have to deactivate the vg before the export, so the sequence would be:
umount /test
vgchange -a n VG01
vgexport -p -s -v -m /dev/VG01rcp server 2On Server 2
mkdir /dev/VG01
mknod /dev/VG01/group c 64 0x0n0000
vgimport -v -s -m /dev/VG01
vgchange -a y VG01
mount /dev/VG01/lv-test /test

And, as Michael said, you may have to run a fsck.


Pete


Pete
Ravinder Kaul
Advisor

Re: share logical volumes but not simul

Michael

That should(RO mount) be reqd if the LV is to be accessible from both servers and it will make all the lvs in the vg RO. I want to know that is it OK for a vg to be activated on both servers while the LVs defined in that VG are available from either of the servers but not both. say we had created a vg on a disk array and using 4 lvs in it on server 1 . We unmount two of the lvs in server 1 Then export the vg in preview mode , import the vg to another server and activate it there. and mount the unmounted lvs of server 1 on server 2 and use the data in the lvs on server 2. Is this procedure OK or there are any pitfalls

Thanks
RK