- Thread Starter
- #26
Here is what I have tried:-There seems to be a misunderstanding. Throughout the entire instructions above, none of the server's local root file system is exported.
You’ve likely confused the NFSv4 tree root with the server’s root file system. Those are two entirely different things.
NFSv4 requires a tree root, which is defined in /etc/exports with the "V4:" line. When defined, it becomes the NFSv4 exported file system's root ( in this caseV4: /home/GRUPPEbecomes " / " for NFSv4 mounts.
Hense the "/" path in server:path : e.g.mount -o nfsv4 server:/ /mnt,
The NFSv4 mount path is relative to the NFSv4 tree root, whereas NFSv3 must be specified with a absolute path (see examples below).
nfsv4(4)
Code:The NFSv4 protocol does not use a separate mount protocol and assumes that the server provides a single file system tree structure, rooted at the point in the local file system tree specified by one or more V4: <rootdir> [-sec=secflavors] [host(s) or net] line(s) in the exports(5) file. (See exports(5) for details.)
exports(5)
Rich (BB code):In the following example some directories are exported as NFSv3 and NFSv4: V4: /wingsdl/nfsv4 /wingsdl/nfsv4/usr-ports -maproot=root -network 172.16.0.0 -mask 255.255.0.0 /wingsdl/nfsv4/clasper -maproot=root clasper Only one V4: line is needed or allowed to declare where NFSv4 is rooted. The other lines declare specific exported directories with their absolute paths given in /etc/exports. The exported directories' paths are used for both v3 and v4. However, they are interpreted differently for v3 and v4. A client mount command for usr-ports would use the server-absolute name when using nfsv3: mount server:/wingsdl/nfsv4/usr-ports /mnt/tmp A mount command using NFSv4 would use the path relative to the NFSv4 root: mount server:/usr-ports /mnt/tmp
NFS Server:-
/etc/rc.conf :-
Code:
nfs_server_enable="YES"
nfsv4_server_enable="YES"
/etc/exports :-
Code:
V4: /var/db/backup
/ -mapall="root"
mkdir /var/db/backup
zfs create -o mountpoint /var/db/backup zroot/backup
zfs sharenfs="network=192.168.1.0/24 -maproot=root" zroot/backup
NFS Client:-
mount -o nfsv4 192.168.1.250:/zroot/backup /mnt
mount_nfs: nmount: /mnt: Permission denied
mount -o nfsv4 192.168.1.250:/var/db/backup /mnt
mount_nfs: nmount: /mnt: Permission denied
Obviously something wrong.