Download presentation
Presentation is loading. Please wait.
1
NFS – Network File System WeeSan Lee http://www.cs.ucr.edu/~weesan/
2
Roadmap Introduction How to setup a NFS server? How to setup a NFS client? nfsstat Automatic Mounting Q&A
3
Introduction Created by Sun in 1985 Was original designed for diskless clients Version 2 is slow Write operation is not complete until receiving ACK from the server Version 3 permits async writes Faster Version 4 Supports strong security, ACLs, unicode filenames, replication and migration, etc
4
Introduction (cont) Uses RPC Remote Procedure Call – a system-independent way for process communication over a network Could be UDP and TCP Now, TCP is preferable
5
How to setup a NFS server? /etc/exports $ cat /etc/exports /home10.0.0.0/24(rw,async,root_squash) /home/ftp(noaccess) /import10.0.0.0/24(ro) $ exportfs -a /etc/hosts.allow $ cat /etc/hosts.allow portmap:10.0.0.0/255.255.255.0 mountd:10.0.0.0/255.255.255.0 Map root UID & GID to nobody
6
How to setup a NFS server? (cont) /etc/init.d/nfs {start|stop|restart|reload|status} portmap rpc.statd nfsd rpc.mountd rpc.rquotad Turns NFS on over reboot $ chkconfig nfs on
7
How to setup a NFS client? /etc/init.d/portmap start portmap rpc.statd Manual mount the NFS partitions $ mount 10.0.0.1:/home /home $ mount 10.0.0.1:/import /import Mount the NFS partitions at boot time $ cat /etc/fstab 10.0.0.1:/home/homenfsdefaults 0 0 10.0.0.1:/import/importnfsdefaults 0 0 $ mount -a
8
How to setup a NFS client? (cont) Experiment defaults with soft,timeo=5 hard,intr To umount a NFS partition $ umount /home To show the NFS server's export list $ showmount -e 10.0.0.1
9
nfsstat Displays stats. about NFS server and client For server $ nfsstat -s For client $ nfsstat -c
10
Automatic Mouting Mount filesystems on-demand Originally comes from Sun To start $ /etc/init.d/autofs start Master map file (/etc/auto.master) Associates each mount point with a indirect map $ cat /etc/auto.master /misc/etc/auto.misc /net-host
11
Automatic Mouting (cont) To automount /home & /import Add the following lines into /etc/auto.master /home/etc/auto.home /import/etc/auto.import $ cat /etc/auto.home *-soft,timeo=510.0.0.1:/home/& $cat /etc/auto.import *-soft,timeo=510.0.0.1:/import/&
12
Reference LAH Ch 16: The Network File System
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.