Index List

02 February 2010

How To Setting Network File Sharing (NFS) in Ubuntu

Settings Network File Sharing on Ubuntu Linux is required if you want to share or share files or folders with other computers. Especially if the other computer that uses linux OS as well, if you just want to share files with other computers with windows OS, then you need Samba File Sharing which I will discuss in the next Linux tutorials on this blog.

Well, here’s how to Settings Network File Sharing (NFS) in Ubuntu Linux :

Settings Network File Sharing-NFS – on the Server/Host

1. Install NFS Package

#sudo apt-get install nfs-kernel-server nfs-common portmap

2. Portmap package configuration

#sudo dpkg-reconfigure portmap

(select no when asked to bind loopback)

3. Edit file /etc/exports

#sudo vi /etc/exports

Insert the following parameters for full access read-write of some client

/Data 192.168.2.1/24(rw,no_root_squash,async)

- /Data>> folder location that will be shared
- 192.168.2.1/24>> IP client that can access the shared folder (192.168.2.2 – 192.168.2.254)
- (rw,no_root_squash,async)>> Permissions attribute, in this case full read-write

for read-only access from only one client, insert the following parameters

/Data 192.168.2.2 (ro,async)

4. Restart and activate the NFS Server

#sudo /etc/init.d/nfs-kernel-server restart
#sudo exportfs -a

Setting Network File Sharing – NFS – on thh Client

1. Install NFS Package

#sudo apt-get install portmap nfs-common

2. Portmap package configuration

#sudo dpkg-reconfigure portmap

(select no when asked to bind loopback)

3. Create a local folder to mount the shared folder on the server

#sudo mkdir /media/Data

4. Manually mount the shared folder on the server to a local folder

#sudo mount 192.168.2.1:/Data /media/Data

- 192.168.2.1 >> ip address NFS server
- /Data >> Shared folder on NFS server
- /media/Data >> mount point on Client

5. Restart portmap and NFS Client

#sudo /etc/init.d/portmap restart
#sudo /etc/init.d/nfs-common restart

6. Edit file /etc/fstab for automount when restart/booting

#sudo vi /etc/fstab

insert the following parameters

192.168.2.1:/Data /media/Data nfs rw,hard,intr 0 0

Up to this stage you should be able to share files and folders with other Linux computers on your local network, hopefully linux tutorial on Setting Network File Sharing (NFS) on Ubuntu Linux this can be useful.

source : www.situsinformasiinternet.com