 We will see about the NFS setup, NFS is network file system. So you have a server where you store all the files and say you want to access those files by logging into any other machines. So you share those files using NFS. So NFS file system does what it does is as it says clients are it is a client server system that allows users to access files across the network and it treats them as the local file. So user will not know that the file they are accessing is on actually on the server. They will think that it is on their local machine. So for the sake of this example there are two machines provided to each everybody one is the NFS server and another will be the NFS client. So for this demonstration OSL 4 this machine will be used as NFS server and OSL 5 will be used as NFS client. So who are working on the servers follow these steps. The deep packages are stored in this URL. The last three are the deep packages for installing NFS. You download them in your home directory then in OSL 4 run these commands. These are the package names. So you have to give the path where these packages are stored. As most of you have stored these packages in the home directory just these commands will be enough. This DPKG command will install the deep packages. So copy paste this command in the terminal you have to give the path where it is stored. In the handout the command is given. So go to the path and do port map write PORT and click tab. So it will complete the name you do not have to write the complete name manually. So first package to be installed is the port map press enter. So we will use apt-get to install the required packages for NFS. You go to this URL after going here download this sources.lst file. Right click save link as save it in your home directory. After you do that open a terminal that is applications accessories terminal we have to copy the sources.list file that we have just downloaded. So cp is the copy command as you give the path of sources.lst as we have saved it in the home directory. I am giving sources.list it should be copied to slash etc slash apt slash sources.list use sudo for both server and client should do follow this procedure. After copying this file we have to update the repositories. So use apt-get update command it will update the repository. Open a terminal go to applications accessories terminal you will get this screen. Go to super user mode using su enter password is reset to root 1, 2, 3. Root password is set to root 1, 2, 3. After that for server installation we have to install some packages. The packages in Linux are installed with this command apt-get install and then the package name. So here we are installing three packages for NFS server. One is NFS kernel server, second is NFS common and third is port map. So write these commands as it is press enter. It might ask for yes no confirmation press y and press enter. There are three packages it has to be written space separated port map is 1, NFS common is second and NFS kernel server is third. Next thing is what we have to do is we have to create a file in server and that has to be ultimately shared using NFS with the client. So we have basic purpose for our server now is we have to create a directory and in that directory we will create a one file. So as you see in the slide we will create a directory called slash extra slash dir. So for that write mkdir slash extra slash dir. By the way who is running server should do this thing. The one with the server machine there is client server player. So one should install client and one should install server. So the server machine should do this thing. So make dir space slash extra slash dir now for the server machine see what is your IP. So for that run if config command if config press enter you will see your IP here note down this IP only fourth octet is you may you have to note down first three are same 10.105.11.xyz okay after noting down this IP you create you go to this file using CD slash extra slash dir press enter. So you have shifted to this directory now create a file using VIM so VIM some name say abc enter press so that you can write in this file write something some word say nishant to close this file press escape shift colon wq. Now this is the file we want to share on all the clients which we will install in future. So the after creating this file open one more file VIM slash etc slash exports slash etc slash exports it will open one file press I to insert the insert into the file open slash etc slash exports file with using VIM so open this file press I to write into this file then see the handouts you have to enter the first entry this entry into the file only the IP is to be changed so write slash extra slash dir space your IP address that you got from if config command so my machine is acting as a server so I am writing 10.105.11.251 remember these commands are to be done on the server side only okay since you are using different machine let me restate my statements after opening this on client machine run if config command on terminal and note down the clients IP and this thing is to be written in the exports file let me state again in the slash on the server side in slash etc slash exports you have to write clients IP what this statement means is this directory is to be shared on this client machine using read write permissions so let me restate on server side in slash etc slash exports file you have to write clients IP address yeah on server side in that file you have to write clients IP address is everybody done with it okay next thing so here understand you have created this directory on server side and you have given permission to this machine that is client machine to have read write permission to whatever is there in that directory this is the meaning of this complete line come out of the file then you have to start a service it is given in the handout slash etc slash init dot d slash nfs kernel server restart nothing is to be done in the client side till now client will not do anything for now the services will start giving message okay so I hope you have run this command to start the nfs server next thing to do is run the last command export fs export fs minus ra after this you have enabled the access for the client machine to read and write the files in the server so now we have to set up the client so servers server side is done now you the client's client machines will follow the next procedure I will log in to the client I had specified this IP as the client so I am logging in there to set up the client side you do not need to do to do this in the next slide of handout you will see these commands this is for nfs client installation so run the first command abgate install nfs common and port map this is to be done on the client side after that the packages will be installed you now have to create one more directory in the client side mkdir slash root slash temp you go to this directory with CDs slash root slash temp and do LS you will find that there is no file we are just created the directory and after doing LS there is no file in that directory now we run the third command this mount command will mount the directory so what this command will do is it will mount this directory which we have created on the server side so this is the server at IP address so this directory from this server will be mounted at this place on the client side this command is to be run at the client side and the IP address given here should be of the server side because we are mounting this directory from server at this client path press enter now do LS you will find that previously there was no file in the root slash root slash temp directory now the file which was created on the server this ABC will be listed on the client side you can open this file from the client side and see the content the file see still research in the at the server side but client doesn't know client thinks that it is in the in his local file system that is slash root slash temp but in the reality we have just mounted the file from the server at the client side now open the file again from the client side make some changes in the file press I write something else in the file save it using escape shift colon WQ now go to the server server side open the file at the server side and you will see the changes reflected back at the server side also out of this file now as we are mounted this file system using mount command at the client side so after we restart the client this changes will not do I will not be reflected so to make the changes permanent so that after each reboot of the client this system this file system to be mounted on the client side you need to change the fstap file the file is slash etc slash fstap open this file on the client side slash etc slash fstap it will list the currently mounted file systems so at the end you can write one more line that is given in the handout if you write this line in the fstap of your client machine after each reboot of the client this changes will be made and you will see the changes permanent so here server side IP is to be given so that it will mount the server side directory in the clients this directory and after each reboot you would you do not have to do run the mount command again and again we will not do that actually because it requires rebooting the system and see this thing so what we have done is current now we have installed NFS server and we have created a directory in that directory we have created a file we have installed NFS client machine this NFS client is used to mount the directory from the server side to the client side and the we can we have seen the changes that was done in the server side reflected back at the client side and as we have shared this directory in read write mode the client side the changes which client makes are reflected back at the server side also so this is the NFS setup