Sharing files with NFSv4 on Fedora 7 (Server -> Multi)
This HowTo explains how to set up the Network File System version 4 on your LAN for multiple shares. It explains, also, how to mount the "exports" on your client.
Applicable to Fedora Versions
- Fedora Core 6+
- Fedora 7
Requirements
These are the server requirements:
- nfs
- rpc.idmapd
- nfs
- nfslock
- rpc.idmapd
Doing the Work
Configuring the server:
- Open up the necessary port on the firewall (port: 2049). Activate the "Security Level and Firewall" tool. You will be asked for your root password. Please enter it:
- Activate "NFS4" and click "OK".
- Edit /etc/idmapd.conf. Enter your root password when prompted:
- Configure your domain name and change the users to nfsnobody:
- Start the rpcidmapd and nfslock services, then start the nfs service. Alternatively, you can use System->Administration->Services or System->Administration->Server Settings->Services GUIs. Please enter the root password when prompted:
su -c "/sbin/service rpcidmapd start"
su -c "/sbin/service nfslock start"
su -c "/sbin/service nfs start" - Set rpcidmapd, nfslock, and nfs services to start on boot.Alternatively, you can use System->Administration->Services or
System->Administration->Server Settings->Services GUIs. Please
enter the root password when prompted:
su -c "/sbin/chkconfig --level 345 rpcidmapd on"
su -c "/sbin/chkconfig --level 345 nfslock on"
su -c "/sbin/chkconfig --level 345 nfs on" - Create the dirs of the exports inside "/nfs4exports". Enter your root password when prompted:
- Edit /etc/fstab:
- Bind the desired shares to the, recently created, dirs at /nfs4exports:
/path/to/share1 /nfs4exports/share1 none bind 0 0
/path/to/share2 /nfs4exports/share2 none bind 0 0
/path/to/share3 /nfs4exports/share3 none bind 0 0 - Remount everything. Enter your root password when prompted:
- Edit /etc/exports. Enter your root password when prompted:
- Add your shares here (available to your home network) If you want your shares to be read only, change "rw" to "ro" from these statements:
- Reload your exports. Please enter your root password when prompted:
- Edit your /etc/hosts.allow file, so your clients are allowed to access your nfs. Please enter your root password when prompted:
- Allow your LAN to access your services:
- Reboot:
su -c "system-config-securitylevel"
su -c "gedit /etc/idmapd.conf"
[General]
Domain = example.com
[Mapping]
Nobody-User = nfsnobody
Nobody-Group = nfsnobody
su -c "mkdir -p /nfs4exports/{share1,share2,share3}"
su -c "gedit /etc/fstab"
su -c "mount -a"
su -c "gedit /etc/exports"
/nfs4exports 192.168.1.0/255.255.255.0(rw,insecure,no_subtree_check,nohide,fsid=0)
/nfs4exports/share1 192.168.1.0/255.255.255.0(rw,insecure,no_subtree_check,nohide)
/nfs4exports/share2 192.168.1.0/255.255.255.0(rw,insecure,no_subtree_check,nohide)
/nfs4exports/share3 192.168.1.0/255.255.255.0(rw,insecure,no_subtree_check,nohide)
su -c "/usr/sbin/exportfs -rv"
su -c "gedit /etc/hosts.allow"
ALL: 192.168.1.0/255.255.255.0
su -c "/sbin/shutdown -r now"
Configuring the clients:
- Edit /etc/idmapd.conf. Enter your root password when prompted:
- Configure your domain name and change the users to nfsnobody:
- Edit /etc/fstab. Please enter your root password when prompted:
- Create the mounting dirs:
- Add the desired shares:
- Remount everything:
su -c "gedit /etc/idmapd.conf"
[General]
Domain = example.com
[Mapping]
Nobody-User = nfsnobody
Nobody-Group = nfsnobody
su -c "gedit /etc/fstab"
su -c "mkdir /mnt/shares /home/me/share1 /home/he/share2 /home/it/share3"
<ip-address-to-server>:/ /mnt/shares nfs4 rsize=8192,wsize=8192,timeo=14,intr
<ip-address-to-server>:/ /home/me/share1 nfs4 rsize=8192,wsize=8192,timeo=14,intr
<ip-address-to-server>:/ /home/he/share2 nfs4 rsize=8192,wsize=8192,timeo=14,intr
<ip-address-to-server>:/ /home/it/share3 nfs4 rsize=8192,wsize=8192,timeo=14,intr
su -c "mount -a"
Troubleshooting
How to test
Common problems and fixes
More Information
Disclaimer
I haven't had te opportunity to test this HowTo since I lack of a networked PC to do it, so you may run into problems, if you do, come to #fedora on irc.freenode.net or leave me messages so I know what's up. Feel free to propose changes and stuff.


Fedora 7
I was happy not to have to disable SELinux or my firewall
The only "problem" I had was with exportfs
The command in Fedora 7 is : su -c "/usr/sbin/exportfs -rv"