NFS is used share a folder that could be made accessible around the network. To setup nfs, follow the following steps:
1. Install nfs package using yum utility.
#yum install nfs-utils nfs-utils-lib
2. start the associated services, (rpcbind and nfs).
3. Copy the files to be exported to file location (/etc/exports). A sample exports file is shown below with the details.
[root@localhost ~]# cat /etc/exports
/a/b/c/mount_nfs 192.168.56.101(rw,no_root_squash,no_subtree_check)
[root@localhost ~]#
rw: This option allows the client server to both read and write within the shared directory.
sync: Sync confirms requests to the shared directory only once the changes have been committed.
no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
no_root_squash: This phrase allows root to connect to the designated directory
4. Run the following command to export them:
#exportfs -a
5. You will get access denied if you have not provided privileges in "/etc/exports" file.
[root@localhost ~]# mount -t nfs IP:/a/b/c/mount_nfs /nfs_dest
mount.nfs: access denied by server while mounting 192.168.56.101:/a/b/c/mount_nfs
[root@localhost ~]#
6. Port number that is used for this is '111'.
1. Install nfs package using yum utility.
#yum install nfs-utils nfs-utils-lib
2. start the associated services, (rpcbind and nfs).
3. Copy the files to be exported to file location (/etc/exports). A sample exports file is shown below with the details.
[root@localhost ~]# cat /etc/exports
/a/b/c/mount_nfs 192.168.56.101(rw,no_root_squash,no_subtree_check)
[root@localhost ~]#
rw: This option allows the client server to both read and write within the shared directory.
sync: Sync confirms requests to the shared directory only once the changes have been committed.
no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
no_root_squash: This phrase allows root to connect to the designated directory
4. Run the following command to export them:
#exportfs -a
5. You will get access denied if you have not provided privileges in "/etc/exports" file.
[root@localhost ~]# mount -t nfs IP:/a/b/c/mount_nfs /nfs_dest
mount.nfs: access denied by server while mounting 192.168.56.101:/a/b/c/mount_nfs
[root@localhost ~]#
6. Port number that is used for this is '111'.