NFS Sharing (linux) and Mounting (linux&windows)
April 23, 2008 by gopalkoduri
Note : All the future posts and even updates to existing ones, when it comes to howtos will take place at tidbits. There will NOT be any updates here. So, kindly go here to find recent version of this.
This is useful in case you want to have something shared on one system(server) to access it from other system(client), without having to maintain duplicate copies. Here the server is a Linux PC, client can be either Linux/Windows. The method can also be tweaked and used for getting done several other things.
On Server : (i.e. the PC which you want to have access to)
using the package manager for your distro (yum/apt-get/yast/emerge …), get the following packages installed
- nfs-kernel-server
- nfs-common
- portmap
Now suppose the directory you want to share is /home/gopi/books ,then put the following line
in /etc/exports file, what this means is : read and write permissions on /home/gopi/books to 172.16.14.35 and read only to 172.16.14.47. Now run the following commands, first one to make sure that server is running, the second one to refresh shares. make sure there are spaces ONLY between different hosts specified and no other place!
- root@localhost# /etc/init.d/nfs-kernel-server restart
- root@localhost# exportfs -a
On Client : (i.e. the PC which you want to mount the shares)
If it just for client, it is sufficient to have two packages.. so again using the respective package manager, get the following.
- nfs-common
- portmap
Now just mount the shares using the following command. say 172.16.15.3 is my server, /home/gopi/acads is my share.I would like to mount it on a directory called /home/gopi/lab_share in my sclient, which is 172.16.14.35
Thats it! Now if you want to have this done on bootup, then open /etc/mtab, copy the corresponding line and paste it in /etc/fstab. In windows, you can use ‘network drive mapping’ to mount the shared nfs share on linux.
I think there is quite a lot documentation on samba howto(an another sharing mechanism). But for NFS, there might be few, but this is something, I could say, works without a glitch.



I think we iiit’ians should blog together in some blog so that all info is at one place
.. fedora.in seems to be a good place if kulbir agrees 
if he agrees.. sure!