NFS On Ubuntu
NFS On Ubuntu
NFS On Ubuntu
– in the Windows environment. It offers the ability to share the hard disk space of a big server
with many smaller clients. Again, this is a client/server environment. While this seems like a
standard service to offer, it was not always like this. In the past, clients and servers were unable
to share their disk space.
Thin clients have no hard drives and thus need a “virtual” hard-disk. The NFS mount their hard
disk from the server and, while the user thinks they are saving their documents to their local (thin
client) disk, they are in fact saving them to the server. In a thin client environment, the root, usr
and home partitions are all offered to the client from the server via NFS.
NFS Advantages
• Local workstations use less disk space because commonly used data can be stored on a single
machine and still remain accessible to others over the network.
• There is no need for users to have separate home directories on every network machine. Home
directories could be set up on the NFS server and made available throughout the network.
• Storage devices such as floppy disks, CDROM drives, and Zip® drives can be used by other
machines on the network. This may reduce the number of removable media drives throughout
the network.
When configuring portmap do =not= bind loopback. If you do you can either edit
/etc/default/portmap using the following
sudo vi /etc/default/portmap
NFS exports from a server are controlled by the file /etc/exports. Each line begins with the
absolute path of a directory to be exported, followed by a space-seperated list of allowed clients.
You need to edit the exports file using the following command
sudo vi /etc/exports
Here are some quick examples of what you could add to your /etc/exports
For Full Read Write Permissions allowing any computer from 192.168.1.1 through
192.168.1.255
/files 192.168.1.1/24(rw,no_root_squash,async)
A client can be specified either by name or IP address. Wildcards (*) are allowed in names, as
are netmasks (e.g. /24) following IP addresses , but should usually be avoided for security
reasons.
Now you need to restart NFS server using the following command
If you make changes to /etc/exports on a running NFS server, you can make these changes
effective by issuing the command
sudo exportfs -a
This will install all the required packages for nfs client
Mounting manually
The mount point /files must first exist on the client machine.
Create files directory using the following command
Now you may need to restart services using the following command
sudo vi /etc/fstab
If you have a firewall you need to make sure ports 32771, 111 and 2049 are open
Testing Your Configuration
mount /files