How to Install NFS Server



NFS Server

The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were a local disk. It allows for fast, seamless sharing of files across a network.
It also gives the potential for unwanted people to access your hard drive over the network (and thereby possibly read your email and delete all your files as well as break into your system) if you set it up incorrectly.

$ sudo aptitude -P install nfs-kernel-server nfs-common portmap

When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run:

$ sudo dpkg-reconfigure portmap

 
If you have edited the file by hand you can restart portmap via:

$ sudo /etc/init.d/portmap restart

 
Note: It is not necessary to install NFS on client machines which are not going to be sharing any of their own directories. Sharing Local Folders To specify a folder you will need to edit /etc/exports, which can be done like (replace vi for your favorite editor):

$ sudo vi /etc/exports

 
For an example I will share, with full read/write and privileges, my share directory. This directory will be broadcasted to every local IP from 192.168.1.1 through 192.168.1.255.

$ /home/rohan/share 192.168.1.1/24(rw,no_root_squash,async)

To share a read only drive, for example on a Windows NTFS drive, you can use something like the following:

/media/songs/music 192.168.1.1/24(ro,async)


$ sudo /etc/init.d/nfs-kernel-server restart

 
After making changes to /etc/export you can make the shares effect by issuing the:

sudo exportfs -a 


*Use on the other  PC   - Last you will need to mount the volume on the other computer. So, ether shift screens or SSH to lab2 and open a terminal. You can only mount into another folder which must be created.

sudo mkdir ~/music

 
Now mount music from lab1 into ~/music at lab2.

$ sudo mount 192.168.1.2:/media/songs/music ~/music




Share your views...

0 Respones to "How to Install NFS Server"

Post a Comment

 

© 2010 Sharing things that I like...