I'm trying ZFS on Linux for Oracle Linux (OLE) 6.1 (Red Hat RHEL 6.1 compatible clone). I successfully compiled and installed spl and zfs on it for Oracle Unbreakable Kernel. Zfs is working and I created mirror by
zpool create -f -o ashift=12 tank mirror sdb sdc
Now I'm trying to share my zfs pool caled "tank/nfs" as mentioned at zfsonlinux site.
zfs set sharenfs=on tank/nfs
So I created tank/nfs and set nfs to on.
Now I'm trying to mount nfs share at local host to test it by
mount -t nfs4 127.0.0.1:/tank/nfs /mnt
But I get mount.nfs4: mount system call failed
So question is:
How to share NFS Folder or iSCSI Volumes at OLE rightly and mount it with Linux Client via ZFS on Linux.
the answer is
mount 127.0.0.1:/tank/nfs /mnt
In order to establish an NFS mount, you need to have the
portmap
service running before attempting the mount.Run
/sbin/service portmap start
and retry your NFS mount.For RHEL6 and newer, this is in
rpcbind
-/sbin/service rpcbind start
In my experience with ZFS on FreeBSD and Debian GNU/kFreeBSD, I found that the sharenfs feature was not implemented well. You may set up your NFS exports in /etc/exports.
Each ZFS filesystem that you want to export needs its own export line. We found this to be too slow with hundreds of filesystems. You should also try using a single filesystem as though you were using a traditional filesystem.
NFS exports in Linux
You will have to edit the /etc/exports file to enable NFS in Linux. With NFSv4 in Linux, every exported filesystem must be mounted under a single directory called the NFSv4 pseudofilesystem. In this case, that would be /tank. Mountpoints under the pseudofilesystem can be exported with different access control methods and export options. Any filesystems mounted under the psuedofilesystem must get its own export line in /etc/exports.
/etc/exports:
To make changes to /etc/exports take effect, you should run
exportfs -r
.For NFSv4 you will need to run idmapd on both the client and the server to facilitate mapping from username to user id number.
In Linux NFSv4, the export is different than with NFSv3 and lower. Given that the pseudofilesystem is /tank, your mount command would be:
For NFSv3, it would be:
There must be something wrong with your nfs server configuration.
Please try following this howto for setting up RHEL 6 as an nfs server.
Consider doing ZFS natively on Solaris or SolE 11 or OpenIndiana. In my opinion ZFS on Linux is nowhere close to being in any shape, ready for production. ZFS with NFS have native integration on Solaris-based OS's, but not so on Linux.