We have one VM having HP-UX, on which a storage area is already mounted from SAN as block level vxfs. We need to share the same storage area on another VM in real-time read-only mode but we can only use Linux or Windows for this one.
Can we do that? If yes, How?
Unless you are using a cluster-aware filesystem as GFS2 or OCFS2, a block device can be read-write mounted on a single machine (or, more exactly, by a single kernel image).
Mounting in read-write mode a non-cluster-aware filesystem (eg: EXT4, XFS, ZFS, etc) on two or more boxes will cause serious data corruption, at a point where the entire filesystem can be trashed. While using a read-only mount (ie:
mount -o ro,norecovery
) should be safer, it remain a very bad practice so I strongly suggest avoiding it.The simplest thing you can do to share your HP-UX filesytem is to create a (properly protected) NFS export, and mount the NFS share itself on the remote Linux or Windows host. For simple file sharing, this is way better than any other approach you can work out. Even using a cluster-aware filesystem (with its gotcha) should be an action taken only after other options can not be applied.
EDIT: I read on your edited question that you are using VxFS. Depending on its version, it can be used as a clustered filesystem. However, setting up and managing a clustered filesystem requires specific knowledge which can not be improvvised. I strongly advise against using a clustered filesystem without really knowing what are you doing. I reiterate my previous suggestion: for real-time sharing of the required dirs/files, I would use an NFS export in read-only mode.