For NFS4 you have to:
1. Define root directory for sharing, for example I have /srv/nfs.
2. Create there directories which will act as mountpoints for shared directories, for ex.
Code:
mkdir -p /srv/nfs/tmp
mkdir -p /srv/nfs/Music
3. Mount there with option bind what you want to share, by fstab or manualy, for example in fstab
Code:
/tmp /srv/nfs/tmp none auto,bind 0 0
/home/data/Music /srv/nfs/Music none auto,bind 0 0
4. Modify /etc/exports (note fsid option):
Code:
/srv/nfs 10.0.0.0/24(rw,async,nohide,no_root_squash,fsid=0)
/srv/nfs/tmp 10.0.0.0/24(rw,async,nohide,no_root_squash)
/srv/nfs/Music 10.0.0.0/24(rw,async,nohide,no_root_squash)
5. And if you want to mount on the client you first specify -t nfs4 and second give path relative to root defined on the server in 1. point:
Code:
mount -t nfs4 10.0.0.2/tmp /mnt/tmp
mount -t nfs4 10.0.0.2/Music /mnt/Music
I think, you can also mount whole structure, but I do not tested that:
Code:
mount -t nfs4 10.0.0.2/ /mnt