How to mount an NFS share on a client machine?

Published on Aug. 22, 2023, 12:20 p.m.

To mount an NFS share on a client machine, you can use the mount command. Here are the general steps:

  1. Create a mount point directory on the client machine where you want to mount the NFS share. For example:
sudo mkdir /mnt/nfs-share
  1. Use the mount command to mount the NFS share. For example:
sudo mount -t nfs server_ip_address:/path/to/share /mnt/nfs-share

Here, server_ip_address is the IP address of the NFS server, and /path/to/share is the path to the directory that you want to share on the server. You’ll also need to specify the mount point directory that you created in the previous step.

  1. Verify that the share has been mounted by using the df command to display mounted file systems:
df -h

This will show you a list of mounted file systems, including the NFS share that you just mounted.

Note that you may need to modify the /etc/fstab file to ensure that the NFS share is mounted automatically on boot. You can add an entry to the file that specifies the NFS share to mount, the mount point directory, and any additional options. For example:

server_ip_address:/path/to/share /mnt/nfs-share nfs rw,sync,hard,intr 0 0

Tags:

nfs