Previous Page | Next Page

  1. Introduction
  2. About Linux
  3. Installation and getting started
  4. Logging in and out
  5. Basic Linux Commands
  6. Linux Files and File Permissions
  7. Linux Directory Structure
  8. Finding Files
  9. Linux Help
  10. Setting Time
  11. Devices
  12. Tips
  13. Accessing Other Filesystems
  14. Accessing Removable Media
  15. Making and Managing Filesystems
  16. Emergency Filesystems and Procedures
  17. LILO and Runlevels
  18. Init
  19. Environment, Shell Selection, and Startu
  20. Linux Kernel
  21. Package Installation and Printing
  22. Configuration, Logging and CRON
  23. Keys and Terminal Configuration
  24. Sound Configuration
  25. Managing Users
  26. Passwords
  27. Process Control
  28. Configuration and Diagnostic Tools
  29. Overall Configuration
  30. Using PAM
  31. Basic Network Setup
  32. Tools and Terms
  33. Novell and Printing
  34. Inetd Services
  35. Xinetd Services
  36. Other Network Services
  37. FTP and Telnet
  38. Samba
  39. Identd (auth)
  40. X Configuration
  41. X Use
  42. Using X Remotely
  43. X Documentation
  44. DNS
  45. DHCP and BOOTP
  46. Apache
  47. NFS
  48. PPP
  49. Mail
  50. Routing
  51. IP Masquerading
  52. Proxy Servers and ipchains
  53. UUCP
  54. News
  55. NIS
  56. Network Security
  57. Secure Shell
  58. Text Processing
  59. Shell Programming
  60. Emacs
  61. VI
  62. Recommended Reading
  63. Credits

Linux Network File System (NFS)

Linux Server Setup

NFS requires RPC to operate. The following daemons are run when the linuxconf nfs service is started:

  1. rpc.rquotad - Enforces the set quotas for remote mounted NFS systems.
  2. rpc.mountd - Performs the requested mounts.
  3. rpc.nfsd - Handles the user interface to the kernel module that performs NFS.

Server Configuration
To set up the server side:

  1. Edit the file "/etc/exports" as in one of the examples below.
  2. Then type "exportfs -a".
  3. Activate NFS services using linuxconf.
  4. After making any changes, restart the nfs daemon either by using "linuxconf" or typing "/etc/rc.d/init.d/nfs restart". Also if you want changes to the /etc/exports file to take place immediately, install them with the "exportfs -r" command. Doing this, you will not need to restart nfs for changes to be in effect.

This is an example of an exports file for general use:

/data/installs		jimslinux(rw,no_root_squash)
/data/docs		*.mycompany.com(ro,root_squash)
/data			markslinux(rw,no_root_squash) tomscomputer(ro)
/tftpboot		linux3(ro,no_root_squash)
/data			tedslinux(ro,no_root_squash)

The third line allows markslinux to have full access even at the root level to all files in /data, but tomscomputer has read only access, at the world (other) level.

This is an example of an exports file set up for diskless computers with remote booting:

/tftpboot/lts/ltsroot	10.1.0.101/255.255.0.0(ro,no_root_squash)
/tftpboot/lts/ltsroot	10.1.200.1/255.255.0.0(ro,no_root_squash)
/tftpboot/lts/ltsroot	10.1.200.2/255.255.0.0(ro,no_root_squash)
/tftpboot/lts/linux3	10.1.200.2/255/255.0.0(rw,no_root_squash)

The format of the file is:

	directoryname      hostname(options)

The hostname can be the IP address followed by the netmask as shown above.

Options include:

  • no_root_squash - Allows root users on client computers to have root access on the server. Mount requests for root are not be mounted to the anonomous user. This option is needed for diskless clients.
  • root_squash - Requests from root clients are mapped to the nobody user and group ID so they will only have file privileges associated with other.
  • ro - read only access
  • rw - read write access

There are many more options documented in the exports(5) man page.

Performing the mount from the client

To do the mount on the remote machine:

  1. On the remote boot machine, "linux3", after making a /tmp/mnt directory on the remote machine "linux3", type "mount -n 10.1.0.100:/tftpboot/lts/linux3 /tmp/mnt -t nfs".
  2. The -n is only needed if the /etc directory on the remote boot machine is read only.
  3. The 10.1.0.100 address is the address of the NFS server machine with the filesystem being mounted.

Client Setup
To set up the client side on a fully functional Linux machine type "mount -o rsize=1024,wsize=1024 mymachine:/data /mnt/mymachine/data