Asume the share is created on NFS server.
Run in bash:
sudo apt update
sudo apt install nfs-common
sudo mkdir -p /mnt/nfs_data_folder
sudo mount nfs_server_ip:/export/nfs_storage /mnt/nfs_data_folderThen edit the fstab file for persistent mount:
nano /etc/fstabadd a line at the end (change the IP):
192.168.1.100:/export/nfs_storage /mnt/nfs_data_folder nfs _netdev,rw,bg,soft,noatime,nodiratime 0 0
_netdev:
Indicates that the filesystem is a network device.
Ensures the system waits for network services to be available before attempting to mount the filesystem.
Useful for preventing boot failures if the network is not yet up.
rw:
Mount the filesystem as read-write (allows both reading and writing).
bg:
Background retry for mounting: If the first mount attempt fails, it retries in the background.
Prevents blocking the boot process if the remote system is unreachable.
soft:
A soft mount option means that the system will time out and return an error if the server becomes unresponsive.
Safer for clients but may result in data loss if operations are interrupted.
noatime:
Disables updates to file access timestamps on reads.
Improves performance by reducing unnecessary disk writes.
nodiratime:
Similar to noatime, but specifically for directory access timestamps.
Further boosts performance by avoiding updates to directory metadata on access.
defaults:
The defaults option is a shorthand that includes a set of commonly used mount options. These are:
rw: Read-write access.
suid: Allow programs to run with the setuid bit.
dev: Allow device files (e.g., /dev/null) to be interpreted on the filesystem.
exec: Allow execution of binaries.
auto: Automatically mount the filesystem at boot.
nouser: Only the root user can mount the filesystem.
async: Perform file operations asynchronously (better performance).
The defaults option is a convenience for typical mounts. You can override any of its individual components by specifying other options explicitly.