280 likes | 560 Views
NFS: Sharing File System. Chapter 22. Topics. Intro to NFS Setting Up the NFS Client Mounting a Remote Directory Hierarchy Setting up the Server Side System-config-nfs Automount. NFS. NFS is the de facto standard for connecting to resources in a linux/unix environment
E N D
NFS: Sharing File System Chapter 22
Topics • Intro to NFS • Setting Up the NFS Client • Mounting a Remote Directory Hierarchy • Setting up the Server Side • System-config-nfs • Automount
NFS • NFS is the de facto standard for connecting to resources in a linux/unix environment • There are versions of NFS that run on Linux, DOS, VMS, and Windows • NFS will allow files on a remote server to appear as if they are on the local machine, the physical location becomes irreleveant
NFS Introduction • NFS is a client / server solution • From the client machine it like a regular local directory hierarchy • This ability to run system file rom another host enables developers to create Linux system that are entirely diskless. • The Linux Terminal Server Project (LTSP) is dedicated to this “Thin Client” technology
NFS Cont’d • Dataless systems are a norm in enterprise environments – no data is held on local machines – NFS accomplishes this with Linux • Excellent resource for more information:http://nfs.sourceforge.net/
Displaying Remote Resources • The df utility lists the directory hierarchies available on a system. If the resource name is preceded by a host name it is remote /instructor:/exam 30M 22M 8M 68% /instructor/exam /examview-baist:/downloads 10G 1G 9G 13% /examview-baist/downloads
Displaying Remote Resources • In this examplethere are two hierarchies on the Instructormachine thatare available to this host – exams and downloads • Use the df –h nfs to isolate the nfs hierarchies /instructor:/exam 30M 22M 8M 68% /instructor/exam /examview-baist:/downloads 10G 1G 9G 13% /examview-baist/downloads
The NFS Server • Prerequisites for NFS Server – Install the following package: • NFS utils • Run the following commands: • # /sbin/chkconfignfs on --this will set the service to start automatically when the system enters multiuser mode • # /etc/rc.d/init.d/nfs start -- this starts nfs
In this training environment it will be more efficient to turn off the firewall and disable SELinux as these two elements will need to be configured in a production environment to maintain security
Configuring the NFS Server • NFS config window • System-config-nfs or from the menus on either Gmone or KDE • This utility will generate an “export” file called /etc/exports • “Exports” specifies which hierarchies get shared and how they are shared (Read / Write) • Each exported hierarchy is called a “share”
Exporting a Directory Hierarchy • Exporting makes the hierarchy available for mounting – it does not make the resources mounted • It places the directory structure on a list of hierarchies that may be mounted
Showmount Utility • Use the showmount utility to display a list of systems that are allowed to mount the local directories • If showmount gives this error – “ RPC: Program not registered” – nfs is not running on that server – start nfs
Testing the server setup • From the server run the nfs init script with the status argument • /sbin/service nfs status • If all is well it will identify the related PIDs for the nfs daemon and RPC connectors • To check port mappings run: • /usr/sbin/rpcinfo –p localhost | grep nfs • This will return the port numbers nfs is bound to
Installing NFS Client • Prerequisites: Install the following packages: • NFS-utils • System-config-nfs • Portmap package
Mounting the remote directory • You mount a remote directory the same way you mount a local one (p.466) • mount instructor:/downloads /instructor.downloads • mount server:/export /local_mountpoint • RPC: Program not registered error means that the NFS daemon is not running on the server
unmount • The unmount utility will disconnect from the server export and is done the same way you unmount a local resource (p.469) • Unmount /instructor/downloads
Automount • By default mount has to be run at each session to connect to network resources. • Automount allows you to configure a recurring connection to the resource
Summary • Intro to NFS • Setting Up the NFS Client • Mounting a Remote Directory Hierarchy • Setting up the Server Side • System-config-nfs • Automount
Exercise • Set up nfs • 2 systems – client / server • Static IP • HOSTS entries for each / on each