Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Share Files Between Linux Computers Using Nfs

Learn how to share files between linux computers using nfs with clear steps, practical context, and useful troubleshooting guidance.

Table of Contents

This updated guide examines How to Share Files Between Linux Computers Using Nfs and organizes the essential facts, background, and practical takeaways in clear American English.

Part 1of 2:

Creating the Server

  1. How to Share Files Between Linux Computers Using Nfs — contextual image 1 Use NFS (Network File System) to share files between Linux computers on a local network. If you need to share files with Windows or Mac computers, you will be much more successful using Samba.
  2. How to Share Files Between Linux Computers Using Nfs — contextual image 2 Understand how NFS works. When sharing files with NFS, there are two side: the server and the clients. The server is the computer that is actually storing the files, while the clients are the computers that are accessing the shared folder by mounting the shared folder as a virtual drive. NFS will need to be configured on both the server and any client that wants to connect.
  3. How to Share Files Between Linux Computers Using Nfs — contextual image 3 Open the terminal on the server computer. This is the computer that will be hosting the shared files. The server computer will need to be turned on and logged in in order for clients to mount the shared folder. NFS requires using the terminal to install and configure both the server and client.
  4. How to Share Files Between Linux Computers Using Nfs — contextual image 4 Type. sudo apt-get install nfs-kernel-server nfs-common portmap and press ?Enter . This will begin downloading and installing the NFS files on your computer.
  5. How to Share Files Between Linux Computers Using Nfs — contextual image 5 After installation, type. dpkg-reconfigure portmap . Select "No" from the menu that appears. This will enable other computers on the network to connect to your shared folder.
  6. How to Share Files Between Linux Computers Using Nfs — contextual image 6 Type. sudo /etc/init.d/portmap restart to restart the portmap service. This will ensure that your changes take effect.
  7. How to Share Files Between Linux Computers Using Nfs — contextual image 7 Make a dummy directory that will be used to share the data. This is an empty directory that will direct the clients to the actual shared directory. This will allow you to change the shared directory on your server later without having to make any changes to the clients.
    • Type.mkdir -p /export/dummyname and press ?Enter . This will create a directory nameddummynamethat the clients will see.
  8. How to Share Files Between Linux Computers Using Nfs — contextual image 8 Typepico /etc/fstaband press?Enter. This will open the /etc/fstab file and allow you to automatically mount the shared drive whenever the server boots up.
  9. How to Share Files Between Linux Computers Using Nfs — contextual image 9 Add. sharedpathdummypathnone bind 0 0 to the end of the file. Replacesharedpathwith the location of the shared drive, and replacedummypathwith the location of the dummy directory you created earlier.
    • For example, to share the/dev/sdbdrive with the clients using the dummy directory created earlier, you would type/dev/sdb /export/Shared none bind 0 0. Save the changes to the file.
  10. How to Share Files Between Linux Computers Using Nfs — contextual image 10 Open the. /etc/exports file. You will need to add your dummy directory as well as the IPs that are allowed to access it to this file. Use the following format to share with all the IP addresses on your local network:/export/dummyname192.168.1.1/24(rw,no_root_squash,async).[1]
  11. How to Share Files Between Linux Computers Using Nfs — contextual image 11 Use the. sudo /etc/init.d/nfs-kernel-server restart command to restart the NFS server. [2]

Part 2of 2:

Connecting the Client Computers

  1. How to Share Files Between Linux Computers Using Nfs — contextual image 12 Open the terminal on the client computer.
  2. How to Share Files Between Linux Computers Using Nfs — contextual image 13 Type. sudo apt-get install portmap nfs-common and press ?Enter to install the NFS client files.
  3. How to Share Files Between Linux Computers Using Nfs — contextual image 14 Create the directory that the shared files will be mounted in. You can name this whatever you'd like. For example, you can typemkdir /sharedFilesto create a folder called "sharedFiles".
  4. How to Share Files Between Linux Computers Using Nfs — contextual image 15 Type. pico /etc/fstab to open the /etc/fstab file.
  5. How to Share Files Between Linux Computers Using Nfs — contextual image 16 Add. serverIP:sharedDirectorynfs rsize=8192,wsize=8192,timeo=14,intr to the end of the file. ReplaceserverIPwith the IP address of the NFS server computer. ReplacesharedDirectorywith the dummy directory you created on the NFS server and the local directory you just created. Leave the rest of the values as they are for now.
    • Using the above examples, the line might look like:192.168.1.5:/export/Shared /sharedFiles nfs rsize=8192,wsize=8192,timeo=14,intr.
  6. How to Share Files Between Linux Computers Using Nfs — contextual image 17 Type. sudo /etc/init.d/portmap restart to restart portmap and use the new settings. The drive will automatically mount each time the computer reboots.
  7. How to Share Files Between Linux Computers Using Nfs — contextual image 18 Test the drive by manually mounting it before restarting. Typemount -aand thenls /sharedFilesto see if the shared files are displayed.
  8. How to Share Files Between Linux Computers Using Nfs — contextual image 19 Repeat this process for each connecting computer. You should be able to enter the same settings and successfully connect.[3]

FAQ

What is How to Share Files Between Linux Computers Using Nfs about?

It provides a structured overview of nfs, explains the main context, and highlights practical takeaways for readers.

Why does this topic matter?

Understanding the main concepts helps readers evaluate the issue, avoid common mistakes, and make better-informed decisions.

How should readers use this information?

Use the guidance as a practical starting point, confirm details that may have changed, and follow current product, safety, or security recommendations.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.