How to Mount a Network File System?


We assume that you have the root privilege (sudo) on the machines, and you want to mount the path, such as /home, at Machine A, to Machine B under the same path /home.


Step 1: on Machine A, type "sudo vi /etc/exports" and add "/home machine_B_ip(rw,sync,no_root_squash,no_subtree_check)"


Step 2: on Machine A, type "sudo exportfs -r"


Step 3: on Machine B, if you see /home already there, we can rename it to sth else (sudo mv /home /home_bak), and go to Step 5 directly if it says "Device or resource busy"


Step 4: on Machine B, type "sudo mkdir /home"


Step 5: on Machine B, type "sudo mount -t nfs machine_A_ip:/home /home"