Operating System - HP-UX
1821804 Members
3072 Online
109637 Solutions
New Discussion юеВ

LVM Making a Volume usable by two systems

 
hpinvent_1
Occasional Contributor

LVM Making a Volume usable by two systems


I'm trying to make a shared LVM volume between two HP systems. The uname info of both my machines is "HP-UX B11.11 U 9000/800". I'm able to create the volume and export it in shared mode on the first machine. But I'm getting an error message when I'm trying to import it from the second system. I get the error message "vgimport: "/dev/lvm_test_vg/group": not a character device".

I've attached the steps that I'm doing below. I've also attached the screen display. It would be very helpful if you could tell me as to what I've missed.1. (root@vcshp5)[/dev/lvm_test_vg] pvcreate -f /dev/rdsk/c2t2d0
pvcreate: The physical volume "/dev/dsk/c2t2d0" is already recorded in the "/etc/lvmtab" file.

2. (root@vcshp5)[/dev/lvm_test_vg] mv /etc/lvmtab /etc/lvmtab1

3. (root@vcshp5)[/dev/lvm_test_vg] pvcreate -f /dev/rdsk/c2t2d0
Creating "/etc/lvmtab".
Physical volume "/dev/rdsk/c2t2d0" has been successfully created.

4. (root@vcshp5)[/dev] mkdir lvm_test_vg

5. (root@vcshp5)[/dev] cd lvm_test_vg/

6. (root@vcshp5)[/dev/lvm_test_vg] mknod /dev/lvm_test_vg/group c 64 0x060000

7. (root@vcshp5)[/dev/lvm_test_vg] vgcreate lvm_test_vg /dev/dsk/c2t2d0
Increased the number of physical extents per physical volume to 2170.
Volume group "/dev/lvm_test_vg" has been successfully created.
Volume Group configuration for /dev/lvm_test_vg has been saved in /etc/lvmconf/lvm_test_vg.conf

8. (root@vcshp5)[/dev/lvm_test_vg] vgdisplay -v lvm_test_vg
--- Volume groups ---
VG Name /dev/lvm_test_vg
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 2170
VGDA 2
PE Size (Mbytes) 4
Total PE 2170
Alloc PE 0
Free PE 2170
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0


--- Physical volumes ---
PV Name /dev/dsk/c2t2d0
PV Status available
Total PE 2170
Free PE 2170
Autoswitch On

9. (root@vcshp5)[/dev/lvm_test_vg] lvcreate -n test_vol -L 2 lvm_test_vg
Warning: rounding up logical volume size to extent boundary at size "4" MB.
Logical volume "/dev/lvm_test_vg/test_vol" has been successfully created with
character device "/dev/lvm_test_vg/rtest_vol".
Logical volume "/dev/lvm_test_vg/test_vol" has been successfully extended.
Volume Group configuration for /dev/lvm_test_vg has been saved in /etc/lvmconf/lvm_test_vg.conf

10. (root@vcshp5)[/dev/lvm_test_vg] lvdisplay -v /dev/lvm_test_vg/test_vol
--- Logical volumes ---
LV Name /dev/lvm_test_vg/test_vol
VG Name /dev/lvm_test_vg
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 4
Current LE 1
Allocated PE 1
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c2t2d0 1 1

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c2t2d0 00000 current

11. (root@vcshp5)[/dev/lvm_test_vg] vgdisplay -v lvm_test_vg
--- Volume groups ---
VG Name /dev/lvm_test_vg
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 2170
VGDA 2
PE Size (Mbytes) 4
Total PE 2170
Alloc PE 1
Free PE 2169
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/lvm_test_vg/test_vol
LV Status available/syncd
LV Size (Mbytes) 4
Current LE 1
Allocated PE 1
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c2t2d0
PV Status available
Total PE 2170
Free PE 2169
Autoswitch On

12. (root@vcshp5)[/dev/lvm_test_vg] vgexport -p -v -s -m /tmp/lvm_test_vg.map lvm_t
est_vg
Beginning the export process on Volume Group "lvm_test_vg".
vgexport: Volume group "lvm_test_vg" is still active.
/dev/dsk/c2t2d0

13. (root@vcshp5)[/dev/lvm_test_vg] vgchange -a n /dev/lvm_test_vg
Volume group "/dev/lvm_test_vg" has been successfully changed.

14. (root@vcshp5)[/dev/lvm_test_vg] vgexport -p -v -s -m /tmp/lvm_test_vg.map lvm_test_vg
Beginning the export process on Volume Group "lvm_test_vg".
/dev/dsk/c2t2d0

15. (root@vcshp5)[/dev/lvm_test_vg] rcp vcshp5:/tmp/lvm_test_vg.map vcshp6:/tmp/lvm_test_vg.map

16. (root@vcshp6)[/dev] vgimport -v -s -m /tmp/lvm_test_vg.map /dev/lvm_test_vg /dev/dsk/c2t2d0
Beginning the import process on Volume Group "/dev/lvm_test_vg".
vgimport: "/dev/lvm_test_vg/group": not a character device.

6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: LVM Making a Volume usable by two systems

At first glance it appears that you need to create the device files on vcshp6:

mkdir lvm_test_vg
mknod /dev/lvm_test_vg/group c 64 0x060000

Then try you vgimport.


Pete

Pete
RAC_1
Honored Contributor

Re: LVM Making a Volume usable by two systems

You have done following steps on second node.

mkdir /dev/vgxx (whatever you want)
mknod /dev/vgxx/group c 64 0x0?0000

Than do vgimport.
There is no substitute to HARDWORK
RAC_1
Honored Contributor

Re: LVM Making a Volume usable by two systems

Typo in my reply. You have not done the steps that I mentioned.
There is no substitute to HARDWORK
Jeff Schussele
Honored Contributor

Re: LVM Making a Volume usable by two systems

Hi,

One note on shared volumes....
If this VG is to be mounted simultaneously on two systems DO NOT mount it r/w on both or you'll blow it up big time. Mount it r/w on one & r/o on the other.

My 2 cents,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor

Re: LVM Making a Volume usable by two systems

Actually, if this is to be a filesystem (as opposed to raw/io with character devices) the only safe option is read-only on BOTH systems. The problem is buffer cache consistancy. Suppose system A updates block 3456, system B doesn't have a clue that this has occurred. Even with raw/io, the two boxes have to communicate with each other to coordinate their i/o.
If it ain't broke, I can fix that.
Kent Ostby
Honored Contributor

Re: LVM Making a Volume usable by two systems

I agree with what Clay is saying here.

Because of the way that buffer cache is implemented, there is no way to directly mount filesystems on two boxes with one of them r/w even if you use shared and r/o on the other one.

NFS is really the solution designed for this sort of thing.

You can do shared lvols for RAW I/O such as in an ServiceGuard/RAC setup.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"