Step-by-Step Guide to Create and Attach an NFS Mount Point to a New Server
Prerequisites:
- NFS Server: A server with NFS (Network File System) installed and configured to export the directory.
- Client Server: The server where the NFS mount point will be attached.
- Network Connectivity: Ensure both servers can communicate over the network.
Steps on the Source NFS Server where the storage is present
1. Install NFS Utilities
2. Create the Directory to Export
3. Set Permissions for the Directory
4. Edit the Exports File
Add the directory to /etc/exports
with the appropriate permissions:
Add the following line to export the directory:
- rw: Read-write access.
- sync: Synchronize changes immediately.
- no_root_squash: Allows root on the client to act as root on the NFS server.
5. Export the Directory
Run the following command to make the changes effective:
6. Start and Enable the NFS Service
Steps on the Client Server
1. Install NFS Utilities
2. Create a Mount Point
3. Mount the NFS Share Temporarily
Use the mount
command to mount the NFS share:
Replace <NFS_SERVER_IP>
with the IP address of the NFS server.
4. Verify the Mount
Check if the NFS share is mounted:
You should see the NFS share listed as /mnt/nfs_shared
.
Persist the Mount Across Reboots
Open the
fstab
file:Add an entry for the NFS share:
Save the file and exit.
Test the
fstab
entry by unmounting and remounting all filesystems:
Verification
Test writing and reading files on the mount point:
Ensure the file appears on both the NFS server and client.
Troubleshooting
Firewall:
- Ensure the required NFS ports are open:
- Ensure the required NFS ports are open:
SELinux:
- Allow NFS through SELinux:
- Allow NFS through SELinux:
Post a Comment
Post a Comment