How To Set Up an NFS Mount on Ubuntu 14.04

How To Set Up an NFS Mount on Ubuntu 14.04

How To Set Up an NFS Mount on Ubuntu 14.04

NFS (Network File System) is a protocol used to share files over a network. In this tutorial, we will be setting up an NFS mount on Ubuntu 14.04.

Step 1: Install NFS server on Ubuntu 14.04

To install the NFS server on Ubuntu 14.04, run the following command:

sudo apt-get install nfs-kernel-server

Step 2: Create the shared directory

Now, we need to create a directory that will be shared over the network. To create a directory named "shared", run the following command:

sudo mkdir /shared

You can choose any other directory name and location based on your preferences.

Step 3: Configure the NFS server

The next step is to configure the NFS server by editing the "/etc/exports" file. Open the file using the following command:

sudo nano /etc/exports

Add the following line to the end of the file:

/shared *(rw,sync,no_subtree_check)

This line specifies that the "shared" directory will be exported to all clients with read and write permissions.

Step 4: Export the shared directory

To export the shared directory, run the following command:

sudo exportfs -a

This command exports all directories listed in the "/etc/exports" file.

Step 5: Configure the NFS client

Now, we need to configure the NFS client to mount the shared directory. To do this, install the NFS client on the client machine using the following command:

sudo apt-get install nfs-common

Then, create a directory on the client machine where you want to mount the shared directory. For example, to create a directory named "mnt/shared" run the following command:

sudo mkdir -p /mnt/shared

Step 6: Mount the shared directory

Finally, we can mount the shared directory on the client machine using the following command:

sudo mount server_ip:/shared /mnt/shared

Replace "server_ip" with the IP address of the NFS server.

Conclusion

Congratulations! You have successfully set up an NFS mount on Ubuntu 14.04. You can now share files between the NFS server and client machines.

Keywords: NFS, Ubuntu 14.04, NFS server, shared directory, NFS client, mount, export, network file system.

Комментарии

Популярные сообщения из этого блога

How To Modify CSS Classes in JavaScript

How To Backup MySQL Databases on an Ubuntu VPS

How To Backup PostgreSQL Databases on an Ubuntu VPS