1 / 11

Network File System

Learn about NFS, a remote file system protocol designed by Sun Microsystems, its services, installation, setup, configuration, and client connection in this detailed guide.

byrdt
Download Presentation

Network File System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network File System CIS 238

  2. NFS (Network File System) • The most commercially successful and widely available • remote file system protocol • Designed and implemented by Sun Microsystems • (Walash et al, 1985; Sandberg et al, 1985) • Reasons for success • The NFS protocol is public domain • Sun sells that implementation to all people for less than the cost of implementing it themselves • Evolved from version 2 to version 3 (which is the common implementation today).

  3. NFS Overview • Views a set of interconnected workstations as a set of independent machines with independent file systems • The goal is to allow some degree of sharing among these file systems (on explicit request) • Sharing is based on client server relationships • A machine may be both client and server • The protocol is stateless • Designed to support UNIX file system semantics • The protocol design is transport independent

  4. NFS Services • The NFS server package includes three facilities, included in the portmap and nfs-utils packages. • portmap : It maps calls made from other machines to the correct RPC service (not required with NFSv4). • nfs: It translates remote file sharing requests into requests on the local file system. • rpc.mountd: This service is responsible for mounting

  5. NFS Configuration Files • /etc/exports : Its a main configuration file of NFS, all exported files and directories are defined in this file at the NFS Server end. • /etc/fstab : To mount a NFS directory on your system across the reboots, we need to make an entry in /etc/fstab. • /etc/sysconfig/nfs - or /etc/nfsconfig: Configuration file of NFS to control on which port rpc and other services are listening and the NFS version used .

  6. Server Installation + Setup • yum install nfs-utilsnfs-utils-lib • yum install portmap (NFSv2 or NFSv3) -OR- • yum install rpcbind( NFSv4) • /etc/init.d/portmap start -OR- /etc/init.d/rpcbind start • /etc/init.d/nfs start • chkconfig --level 35 portmap (rpcbond) on • [chkconfig --level 35 nfs on • /etc/exports /nfsshare 172.27.0.0(rw,sync,no_root_squash) • exportfs -a : Exports all shares listed in /etc/exports, or given name • exportfs -v : Displays a list of shares files and options on a server • exportfs -u : Unexports all shares listed in /etc/exports, or given name • exportfs -r : Refresh the server’s list after modifying /etc/exports

  7. NFS Options • ro: With the help of this option we can provide read only access to the shared files i.eclient will only be able to read. • rw: This option allows the client server to both read and write access within the shared directory. • sync: Sync confirms requests to the shared directory only once the changes have been committed. • no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger file system, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security. • no_root_squash: This phrase allows root to connect to the designated directory.

  8. NFS Client • showmount -e <NFS Server> • showmount –d • mount -t nfs <NFS Server>:/nfsshare /mnt/nfsshare • /etc/fstab - <NFS Server>:/nfsshare /mntnfs defaults 0 0 See text or man page for mount options • df -h

  9. RPC(BIND) • Transport: both TCP and UDP • Data types: atomic types and non-recursive structures • Pointers are not supported • Complex memory objects (e.g., linked lists) are not supported • NFS is built on top of RPC

  10. The mount protocol • Is used to establish the initial logical connection between a server and a client • Each machine has a server process (daemon) (outside the kernel) performing the protocol functions • The server has a list of exported directories (/etc/exports) • The portmap service is used to find the location (port number) of the server mount service

  11. The mount protocol • Client’s mount process send message to the server’s portmap (or RPCBIND) daemon requesting port number of the server’s mountd daemon • Server’s portmap(or RPCBIND) daemon returns the requested info • Client’s mountd send the server’s mountd a request with the path of the flie system it wants to mount • Server’s mountd request a file handle from the kernel - If the request is successful the handle is returned to the client - If not error is returned • The client’s mountd perform the mount() system call using the received file handle

More Related