| Home |
CyberKabila |
| NFS or Network file system is a means by which Linux/Unix systems shair their files
among them over a network. Note:-To share files between Windows and LInux we use SMB or Samba. |
| The NFS softwere is install automatically when we install the Linux OS. |
| It makes use of the following Demons: portmapper nfsd mountd |
| portmapper:-The portmapper services manages the remote procedure calls(RPC) connections, which are used by protocalls such as NFS. RPC is a protocol that allows the client program to access resource on the server.In Linux its called portmap. |
| nsd:-This deamon translates NFS requests into actual request on the local filesystem. |
| mountd:-The mountd deamons services the request for mounting and unmounting filesystems. |
| All these services should be running on the server which is sharing its resources to a client Linux/Unix machines. Only mountd is required to run on the client Linux machine. |
|
Setting up a NFS server(152.98.75.5) |
| STEP 1 |
| we will setup NFS server 152.98.75.5 to share its '/home' directory to client 10.23.45.3 . *Edit '/etc/host.deny' write lines portmap:ALL *Edit '/etc/host.allow' write lines portmap:10.23.45.3/255.255.255.0 Start the portmapper demon #/etc/rc.d/init.d/portmap start |
| STEP 2 |
| Reconfigure and Start nfsd and mountd demon #killall -HUP rpc.nfsd #killall -HUP rpc.mountd #/etc/rc.d/init.d/nfs start Starting NFS services: [ OK ] Starting NFS statd: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS deamon: [ OK ] |
|
Other options with /etc/rc.d/init.d/nfs start |
|
| OPTION | FUNCTION |
| restart | it stops and restarts all the services of NFS. |
| status | it display the status and process id of all the services running. |
| reload | it runs the exportfs command and creats the /var/lock/sybssys/nfs file. The exportfs command is used to maintains a list of exported(that is ,shared)filesystems on NFSserver. |
| probe | it prob the NFS file and cheks for consistencies across them. |
| Example: |
| #/etc/rc.d/init.d/nfs staus rpc.statd (pid 959) is running... rpc.mountd (pid 970) is running... nfsd (pid 975 974 973 972 971) is running... rpc.rquotad (pid 980) is running... |
| The killall command to kill a process by specifying the process name. The HUP option with the killall command causes most deamons to reread the configuration files. |
| STEP 3 |
| You can directly edit the '/etc/exports' file and the directories u want to export. The general structure of '/etc/exports' file is as follows: You must specified full path name to the directory you want to export. You can specify comment entries in the file using the "#" symbol. The hostnames must be on the same line as the directory that you have to export. The permission of every host must be put immediately after the host name. They must be in bracket , with multiple permissions being seperated by commas. If the list of hostnames is longer then the line size permits , you can use the backslash(\) continuation character to continue on the next line. You can specify the hostnames in following four ways: * You can specify simply the hostname (example: cyberkabila01). * You can use wildcard characters in hostnames (example: *.cyberkabila.com)The asterisk here will mean 'the entire cyberkabila network' .A single astrik would mean (all hosts). * You can specify only the IP Address of the machine instead of the hostname. * You can also specify the IP Address along with the subnet mask of the network to specify the machine on the network.The format is in the form ,IP/netmask_bits. For example , if you have an entry,10.23.45.3/24 ,it will match the entire 10.23.45.3 network.The number 24 , represents the netmask , 255.255.255.0 . Here is a Sample entry of the '/etc/exports' file /home 10.23.45.3(rw) The above entry specifies that you are exporting the '/home' directory,that can be accessed by the host, 10.23.45.3 .After the client host machine is configured to access the home directory,it will have the read-write(rw) access for the directory. |
|
OTHER IMPORTANT PERMISSIONS: |
|
| PERMISSION | MEANING |
| rw | read-write access,which is set by default. |
| ro | read-only access. |
| noaccess | only this directory NOT its sub-directory. |
| no_root_squash | It means Trust the client's root.Otherwise it is mapped to nobody UID on the server. |
| STEP 4 |
| Edit '/etc/exports' file enter following.. /home 10.23.45.3(rw) save it. Run command #/usr/sbin/exportfs -a #/usr/sbin/exportfs |
|
SETTING UP NFS CLIENT |
| NFS clients are machines that access the filesystem on NFS server. To access files from NFS server "mount" command is used.The general structure of the command is: #mount server_name:/exported_dir /dir_to_mount Lets access a NFS server 152.98.75.5 which is sharing its "/home" directory. #mount 152.98.75.5:/home /mydir Note: '/mydir' must exist on local machine(10.23.45.3). After You have finished using the '/home' detach it from your machine with unmount command #cd #umount /mydir |
| OTHER UTILITIES TO CONFIGURE NFS |
| Server->use GUI based tool 'netconf'; run 'netconf' from command line to get it. Client->use GUI based tool 'fsconf'; run 'fsconf' from command line to get it. |
|
this site is designed and developed by mukesh and adam |