Blame
| 494d79 | Anonymous | 2026-01-31 03:34:41 | 1 | # Nfs |
| 2 | ||||
| 3 | **Add the NFS shares to the /etc/exports file** |
|||
| 4 | ||||
| 5 | <code>nano /etc/exports</code> |
|||
| 6 | ||||
| 7 | <code>/nfs_share 192.168.1.1/24(rw,sync,no_subtree_check)</code> |
|||
| 8 | ||||
| 9 | **Start the NFS and RPC daemons** |
|||
| 10 | ||||
| 11 | <code>chmod 755 /etc/rc.d/rc.nfsd</code> |
|||
| 12 | <code>chmod 755 /etc/rc.d/rc.rpc</code> |
|||
| 13 | <code>/etc/rc.d/rc.nfsd start</code> |
|||
| 14 | <code>/etc/rc.d/rc.rpc start</code> |
|||
| 15 | ||||
| 16 | **Export the shares** |
|||
| 17 | ||||
| 18 | <code>exportfs -a</code> |
|||
| 19 | ||||
| 20 | Check to see if the shares are being shared |
|||
| 21 | ||||
| 22 | <code>exportfs</code> |
|||
| 23 | ||||
| 24 | ||||
| 25 | ||||
| 26 | =====mount nfs shares===== |
|||
| 27 | ||||
| 28 | ||||
| 29 | ||||
| 30 | ||||
| 31 | __Client Setup__ |
|||
| 32 | ||||
| 33 | Create the mount point |
|||
| 34 | ||||
| 35 | <code>mkdir /mnt/nfs_share</code> |
|||
| 36 | ||||
| 37 | Start the RPC daemon |
|||
| 38 | ||||
| 39 | <code>chmod 755 /etc/rc.d/rc.rpc |
|||
| 40 | /etc/rc.d/rc.rpc start</code> |
|||
| 41 | ||||
| 42 | Mounting |
|||
| 43 | ||||
| 44 | On the CLIENT machine we'll cover 2 options here: manually mounting and auto-mount at boot |
|||
| 45 | ||||
| 46 | __MANUALLY MOUNT__ |
|||
| 47 | ||||
| 48 | <code>mount my.nfs.server:/nfs_share /mnt/nfs_share</code> |
|||
| 49 | ||||
| 50 | AUTO-MOUNT AT BOOT |
|||
| 51 | Add the mount command to /etc/fstab |
|||
| 52 | ||||
| 53 | <code>nano /etc/fstab</code> |
|||
| 54 | ||||
| 55 | <code>my.nfs.server:/nfs_share /mnt/nfs_share nfs rw,defaults 0 0</code> |
|||
| 56 | ||||
| 57 | ||||
| 58 | NOTE ABOUT AUTO_MOUNTING |
|||
| 59 | If you mount at boot and the server machine is unavailable, it will cause your client machine to take a long time to boot as the NFS client will make multiple attempts to connect and you will have to wait for it to time-out for each attampt. |
