NFS Network File System Wee San Lee weesancs

  • Slides: 12
Download presentation
NFS – Network File System Wee. San Lee <weesan@cs. ucr. edu> http: //www. cs.

NFS – Network File System Wee. San Lee <weesan@cs. ucr. edu> http: //www. cs. ucr. edu/~weesan/

Roadmap n n n Introduction How to setup a NFS server? How to setup

Roadmap n n n Introduction How to setup a NFS server? How to setup a NFS client? nfsstat Automatic Mounting Q&A

Introduction n Created by Sun in 1985 Was original designed for diskless clients Version

Introduction n Created by Sun in 1985 Was original designed for diskless clients Version 2 is slow q n Version 3 permits async writes q n Write operation is not complete until receiving ACK from the server Faster Version 4 q Supports strong security, ACLs, unicode filenames, replication and migration, etc

Introduction (cont) n Uses RPC q n Remote Procedure Call – a system-independent way

Introduction (cont) n Uses RPC q n Remote Procedure Call – a system-independent way for process communication over a network Could be UDP and TCP q Now, TCP is preferable

How to setup a NFS server? n /etc/exports q $ cat /etc/exports n n

How to setup a NFS server? n /etc/exports q $ cat /etc/exports n n n Map root UID & GID to nobody /home/ftp /import 10. 0/24(rw, async, root_squash) (noaccess) 10. 0/24(ro) $ exportfs -a /etc/hosts. allow q $ cat /etc/hosts. allow n n portmap: mountd: 10. 0/255. 255. 0

How to setup a NFS server? (cont) n /etc/init. d/nfs {start|stop|restart|reload|status} portmap q rpc.

How to setup a NFS server? (cont) n /etc/init. d/nfs {start|stop|restart|reload|status} portmap q rpc. statd q nfsd q rpc. mountd q rpc. rquotad Turns NFS on over reboot q $ chkconfig nfs on q n

How to setup a NFS client? n /etc/init. d/portmap start q q n Manual

How to setup a NFS client? n /etc/init. d/portmap start q q n Manual mount the NFS partitions q q n portmap rpc. statd $ mount 10. 0. 0. 1: /home $ mount 10. 0. 0. 1: /import Mount the NFS partitions at boot time q $ cat /etc/fstab n n q 10. 0. 0. 1: /home 10. 0. 0. 1: /import $ mount -a /home /import nfs defaults 0 0

How to setup a NFS client? (cont) n Experiment defaults with q q n

How to setup a NFS client? (cont) n Experiment defaults with q q n To umount a NFS partition q n soft, timeo=5 hard, intr $ umount /home To show the NFS server's export list q $ showmount -e 10. 0. 0. 1

nfsstat n n Displays stats. about NFS server and client For server q n

nfsstat n n Displays stats. about NFS server and client For server q n $ nfsstat -s For client q $ nfsstat -c

Automatic Mouting n n n Mount filesystems on-demand Originally comes from Sun To start

Automatic Mouting n n n Mount filesystems on-demand Originally comes from Sun To start q n $ /etc/init. d/autofs start Master map file (/etc/auto. master) q q Associates each mount point with a indirect map $ cat /etc/auto. master n n /misc /etc/auto. misc /net -host

Automatic Mouting (cont) n To automount /home & /import q Add the following lines

Automatic Mouting (cont) n To automount /home & /import q Add the following lines into /etc/auto. master n n q /etc/auto. home /etc/auto. import $ cat /etc/auto. home n q /home /import * -soft, timeo=5 10. 0. 0. 1: /home/& $cat /etc/auto. import n * -soft, timeo=5 10. 0. 0. 1: /import/&

Reference n LAH q Ch 16: The Network File System

Reference n LAH q Ch 16: The Network File System