How to mount NFS in Ubuntu?

To mount NFS shares on Ubuntu, you can use the following method:

  1. Install the nfs-common package: Run the following command to install the nfs-common package.
  2. Update the system using the “sudo apt-get update” command and then install the nfs-common package using “sudo apt-get install nfs-common”.
  3. Create a local mount directory: Select a local directory as the mount point and create that directory. For example:
  4. Create a directory called “nfs_share” under the “/mnt” directory.
  5. Mounting NFS shares: Use the mount command to mount NFS shares to a local directory. Here is the general format of the mount command.
  6. Mount the NFS server address and the shared directory to the local mount directory using sudo.
  7. “In other words,”
  8. Mount the /home/user/share directory from the IP address 192.168.1.100 to /mnt/nfs_share using sudo.
  9. Verify mounting: run the following command to confirm if the NFS share has been successfully mounted to the local directory.
  10. Show the disk space usage in a human-readable format.
  11. You should be able to see the mounted NFS share displayed in the list.
  12. Automatic mounting: If you want to automatically mount NFS shares at system startup, you can add mount configuration to the /etc/fstab file. Open the /etc/fstab file and add the following line.
  13. : nfs defaults 0 0
  14. For example:
  15. Mount the NFS share at /home/user/share on 192.168.1.100 to /mnt/nfs_share using the defaults with no special options.
  16. Save and close the file.
  17. To uninstall NFS shares: If you need to uninstall NFS shares, you can use the following command:
  18. could you please unmount the NFS share from the /mnt directory using the sudo command

Please replace the NFS server address and shared directory with your actual information in the above steps. Make sure the NFS server is running properly, the shared directory is correctly set up, and can be accessed on the Ubuntu system.

bannerAds